Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: MetadataBlock refactoring #9932

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

johannes-darms
Copy link
Contributor

@johannes-darms johannes-darms commented Sep 19, 2023

What this PR does / why we need it:

Refactors code related to MetadataBlocks. Removes duplicated code and moves MetadataBlock related code from the DataverseService to the responsible MetadataBlockService.
The changed methods of DataverseService still exist (are not longer used according to IDEA) are marked as deprecated and facade to the MetadataBlockService implementation.

Furthermore, this removed the unused DatasetDistributor, DatasetKeyword , DatasetRelMaterial, DatasetTopicClass, DatasetVersionDatasetUserId and DatasetFieldDefaultValue from the codebase.

Which issue(s) this PR closes:

Closes #

Special notes for your reviewer: Just moved and removed duplicate code paths.

Suggestions on how to test this:

Does this PR introduce a user interface change? If mockups are available, please link/include them here: No

Is there a release notes update needed for this change?: No

Additional documentation:

Moved MetadataBlock related code from DataverseService to MetadataBlockService. Further, its removing duplicate code.
@coveralls
Copy link

coveralls commented Sep 19, 2023

Coverage Status

coverage: 20.085% (+0.04%) from 20.045% when pulling 526d629 on johannes-darms:refactor-metadatablock into 4e1bc5b on IQSS:develop.

@johannes-darms
Copy link
Contributor Author

@qqmyers: Initial I started with the simple refactoring of the MetadataBlock. While digging through the code I found some unused code blocks related to Datasets. I removed those in this MR as well.

@pdurbin
Copy link
Member

pdurbin commented Sep 19, 2023

I did check with @sekmiller and we agree it's certainly possible that some of the entities/tables are not used. They may have been from early experiments and never removed.

@pdurbin
Copy link
Member

pdurbin commented Sep 28, 2023

This issue is related and we could probably mark this PR as closing it:

Copy link
Contributor

@bencomp bencomp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad I am not alone in the marathon for cleaner code. Thanks for your efforts!
I would like to prevent that these changes introduce new issues, like incomplete javadoc comments, so could you have a look at them?

* @param mdb
* @return
*/
@Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add the @deprecated tag to the javadoc and provide a reason in the @Deprecated annotation, according to Sonarcloud.

/**
* The list of controlled vocabulary terms that may be used as values for
* fields of this field type.
* If the definition of the DatasetFieldType includes a definition for a controlled Vocabulary, i.e. a list of allowed values.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a complete sentence – I expect another part starting with "then", because of "If".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to complete the javadoc tags if you add them. For deprecated code, could you add @deprecated to the javadoc to explain why it is deprecated? Sonarcloud rule Java:S1123 explains why you should do this.

@bencomp
Copy link
Contributor

bencomp commented Oct 4, 2023

This issue is related and we could probably mark this PR as closing it:

I agree, @pdurbin!

@pdurbin pdurbin added Size: 10 A percentage of a sprint. 7 hours. Component: Code Infrastructure formerly "Feature: Code Infrastructure" labels Feb 28, 2024
@pdurbin
Copy link
Member

pdurbin commented Apr 10, 2024

@johannes-darms are you still interested in this? This refactoring hasn't been a priority for us. We have 107 open pull requests and I'm looking for some we can close. Maybe a "soft close" since we could always open it again if it becomes a priority. Please let us know. Thanks.

@scolapasta
Copy link
Contributor

If you are still interested in this PR, can you please merge and resolve any merge conflicts with the latest from develop? If so, we can prioritize reviewing and QAing the changes. If we don’t hear from you by May 22, 2024, we’ll go ahead and close this PR (it can always be reopened after that date, if there is still interest).

@johannes-darms
Copy link
Contributor Author

I'm working on it. I hope I can deduct some time in may to this PR.

@johannes-darms johannes-darms changed the title MetadataBlock refactoring WIP: MetadataBlock refactoring Aug 6, 2024
@pdurbin pdurbin added the Type: Feature a feature request label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Code Infrastructure formerly "Feature: Code Infrastructure" Size: 10 A percentage of a sprint. 7 hours. Type: Feature a feature request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

6 participants