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

Force repo config #122

Merged
merged 5 commits into from
Jan 25, 2023
Merged

Force repo config #122

merged 5 commits into from
Jan 25, 2023

Conversation

poikilotherm
Copy link
Member

@landreev said we better force people to configure everything, so hard to track bugs like IQSS/dataverse#9309 don't happen as easily.

- Make sure users of the library do add critical configuration like earliest date
- We still have some sensible defaults e.g. for list sizes
- Make it a requirement to set a configuration when creating the repository
- As the configuration is sealed and non-modifiable now, retrieve
  a builder from it again to modify and inject into a repository instance
- Add more tests for the configuration builder
- Move the "defaults()" thing to the test class, as people should not be using
  it when implementing a repository
@landreev
Copy link
Collaborator

Thank you! Will add review shortly. Since the PR is ready, we don't really need a separate issue requesting this change, do we? (And same for the other PR for the "earlier than the earliest datestamp"?)

@poikilotherm
Copy link
Member Author

Ok 🤫 Don't tell anyone we did not create an issue first.

DeletedRecord deleteMethod;
Integer maxListIdentifiers = 100;
Integer maxListSets = 100;
Integer maxListRecords = 100;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably a stupid question, but why do we need these default values hard-coded here? - considering that we have microprofile config defaults for these?

Copy link
Member Author

Choose a reason for hiding this comment

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

This has been a hardcoded default before and is also recommended within the OAI PMH implementation guidelines, too.

Yes, Dataverse has its own defaults. But anyone looking to reuse this library might have a different opinion, etc.

I do not want to add another dependency on MPConfig to this library, so I think leaving the 100 in place is a reasonable compromise between defaults, backward compatibility and reusability.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In my defense, I did acknowledge early on it was a stupid question. (I was literally confusing what we do in the Dataverse code base and what you do in this library - sorry).

Enable from parameter to be older than earliest date
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

87.5% 87.5% Coverage
0.0% 0.0% Duplication

Copy link
Collaborator

@landreev landreev left a comment

Choose a reason for hiding this comment

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

All seems prudent. Thank you.

@poikilotherm
Copy link
Member Author

Crossing fingers, merging now!

@poikilotherm poikilotherm merged commit 66d4213 into branch-5.0 Jan 25, 2023
@poikilotherm poikilotherm deleted the force-repo-config branch February 1, 2023 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants