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

7000 mpconfig pid doi hdl #8828

Merged
merged 23 commits into from
Apr 4, 2023
Merged

Conversation

poikilotherm
Copy link
Contributor

@poikilotherm poikilotherm commented Jun 30, 2022

What this PR does / why we need it:
This is a larger cleanup of many PID provider settings.

  1. It decouples the settings from different provider from each other by adding new names and scopes.
  2. It will reuse existing configuration values to maintain backward compatibility!
  3. The docs have been consolidated and changed as necessary to line out more of the differences and which things are important for what
  4. Sane defaults have been incorporated, pointing to test and non-production resources

Relates to #7000

Which issue(s) this PR closes:
None.

Special notes for your reviewer:
This should be done but might need discussion if we want changes to the installer. (Password aliases etc)

  • Missing Handle refactoring
  • Missing a release notes file explaining the changes
  • Maybe change installer to use new configuration names
  • HandleNet properties need aliases for old names!
  • Add tests for aliases to be functional (linking not testable before as no aliases)
  • Maybe extend like done for Solr (7000 mpconfig solr #8825) to enable protocol, provider, authority choose etc via MPCONFIG in backward compatible manner? (Much easier config for containers and those settings are VERY static - these shall never change for an installation or you'll be in trouble. Database Settings were introduced for dynamically changing settings? 🤔 ) Too large for this PR.

Suggestions on how to test this:
Play around with the settings described in the docs section and watch it work. It's not much of a change despite the renaming.

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

Is there a release notes update needed for this change?:
Not included. Let me know if we should write one now or latter (more mpconfig stuff coming). Technically, as the settings have aliases, nothing should change. There is no breaking change, just deprecated names.

Additional documentation:
Included.

@poikilotherm poikilotherm added Component: Code Infrastructure formerly "Feature: Code Infrastructure" Feature: Installer Feature: DOI & Handle Feature: Installation Guide User Role: Sysadmin Installs, upgrades, and configures the system, connects via ssh Component: Containers Anything related to cloudy Dataverse, shipped in containers. labels Jun 30, 2022
@poikilotherm poikilotherm force-pushed the 7000-mpconfig-pid-doi-hdl branch 2 times, most recently from 2a58db7 to 1f04c0e Compare July 4, 2022 13:38
@poikilotherm poikilotherm marked this pull request as ready for review July 4, 2022 17:00
@poikilotherm poikilotherm marked this pull request as draft August 22, 2022 20:51
@poikilotherm
Copy link
Contributor Author

Good catch by @landreev - the HandleNet properties are missing their aliases!

…CONFIG IQSS#7000

- Add scopes and settings to JvmSettings for strictness and fast retrieval with MPCONFIG
- Rename settings to live under scope "dataverse.pid.ezid|datacite", so they are more
  aligned to our other settings. This could change again in the future, depending
  on what other devs feel where they should be located.
- Add aliases to make settings backward compatible - in the current state of Dataverse
  code, only one PID provider can be used at the same time and the double alias is
  with the deprecated, non-public EZID provider.
- Replace SystemConfig.getDataciteRestApiUrlString() with aliases and
  a default in microprofile-config.properties
- Inline with the current setup and docs, make the DataCite MDS API URl
  default to the Test Fabrica, mds.test.datacite.org
Test execution in PersistentIdentifierServiceBeanTest requires to
construct an EZID provider. The providers constructor tries to login
with the service, which is not relevant for the test.

Providing EZID configuration settings via a
src/test/resource/META-INF/microprofile-config.properties file makes the
warnings go away about missing config options and also avoids sending
requests to the real service for every test execution.
- Refactoring the DOI related JVM settings and cross links
- Updated some facts and external links in their descriptions
Add necessary changes to lookup Handle.Net PID provider details
via MicroProfile instead of system properties.

The options where scoped within JvmSettings and renamed for better
readability.
- Documented the renaming and option to retrieve the data via MPCONFIG
- Added cross links to other sections
- Added references to tech docs of Handle.Net
- Add more context information to the three settings
@poikilotherm poikilotherm force-pushed the 7000-mpconfig-pid-doi-hdl branch from 1f04c0e to 0db9648 Compare September 19, 2022 15:23
@coveralls
Copy link

coveralls commented Sep 19, 2022

Coverage Status

Coverage: 20.184% (+0.002%) from 20.182% when pulling b7d64df on poikilotherm:7000-mpconfig-pid-doi-hdl into 3a5883c on IQSS:develop.

@mreekie mreekie added the bk2211 label Nov 1, 2022
@poikilotherm poikilotherm force-pushed the 7000-mpconfig-pid-doi-hdl branch from a14ab28 to f3969cf Compare March 31, 2023 12:17
This adds the missing MPCONFIG option to configure
the base URL for the permalink provider, which has been
added after the initial work for providers happened.
This relates to IQSS#9486, but with the switch of the properties
to come from MPCONFIG, this is much easier to do.

We do create the provider object in any case, because otherwise the
stateless EJB mechanism will be very unhappy. We do not login
if there is no password and username given, so avoid the exceptions.
We only log a warning if only one of both is given (which is clearly an
error).
@poikilotherm poikilotherm marked this pull request as ready for review March 31, 2023 16:46
@poikilotherm
Copy link
Contributor Author

poikilotherm commented Mar 31, 2023

I'm putting this back on the table. @mreekie automation dropped this into "Ready for review", could you move it to the sprint column? Thx! (I am not allowed to do this for some unclear reason...?)

About sizing: this does not need a resizing, it's still a 10.

The overall important added stuff was that Permalink provider is now configurable via MPCONFIG as well as the others.
And the EZID provider is created in any case, but no login is attempted if no username and password is given. This was not possible before because we reused the same property name for all places. As this is changed now, it can properly detect if to attempt login or not. The rest are some cosmetic changes.

@mreekie
Copy link

mreekie commented Mar 31, 2023

I'm putting this back on the table. @mreekie automation dropped this into "Ready for review", could you move it to the sprint column? Thx! (I am not allowed to do this for some unclear reason...?)

About sizing: this does not need a resizing, it's still a 10.

The overall important added stuff was that Permalink provider is now configurable via MPCONFIG as well as the others. And the EZID provider is created in any case, but no login is attempted if no username and password is given. This was not possible before because we reused the same property name for all places. As this is changed now, it can properly detect if to attempt login or not. The rest are some cosmetic changes.

@poikilotherm This is fine. Let's leave it be.

@pdurbin pdurbin self-assigned this Mar 31, 2023
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

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

@poikilotherm great work on refactoring and cleaning up the code. Off to QA!

@kcondon the code looks good but please advised that I only did the lightest of testing, just check the defaults for the FAKE and perma providers. Both worked just fine as shown in the screenshot below. I did not touch DataCite, Handle, or EZID.

Screen Shot 2023-03-31 at 5 06 38 PM

Comment on lines +52 to +56
// FIXME: Even before changing to MPCONFIG retrieval, this was pinned to be DataCite specific!
// Should this be extended to EZID and other PID systems like Handle?
String baseUrl = JvmSettings.DATACITE_REST_API_URL.lookup();
String username = JvmSettings.DATACITE_USERNAME.lookup();
String password = JvmSettings.DATACITE_PASSWORD.lookup();
Copy link
Member

Choose a reason for hiding this comment

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

This is fair. I added the PIDs API but hard coded it to DataCite. I would like to see it evolve to be useful across multiple PID providers.

@pdurbin pdurbin removed their assignment Mar 31, 2023
@kcondon kcondon self-assigned this Apr 3, 2023
@kcondon
Copy link
Contributor

kcondon commented Apr 3, 2023

Issues found:

  1. Existing, known good handle config fails with ui error and stack trace: (fixed)
    hdl_create_err.txt
    Seems like it really needs new hdl passphrase property. I am not using one for test/qa.

This avoids a "NoSuchElementException" caused by a failing lookup.
As we do a check for the necessity of a decryption anyway, this is
the logical place to require the presence of the key.
@poikilotherm
Copy link
Contributor Author

@kcondon I fixed this with b7d64df, only looking up the passphrase if it is required. Hope that helps 😄

@kcondon kcondon merged commit 82cef32 into IQSS:develop Apr 4, 2023
@poikilotherm
Copy link
Contributor Author

poikilotherm commented Apr 5, 2023

Woo-hoo!!! And another one in! Thanks for testing in depth @kcondon and the positive review @pdurbin ! 🥳

@pdurbin pdurbin added this to the 5.14 milestone May 10, 2023
@poikilotherm poikilotherm deleted the 7000-mpconfig-pid-doi-hdl branch October 2, 2024 06:39
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" Component: Containers Anything related to cloudy Dataverse, shipped in containers. D: DataverseInDocker Deliverable of running Dataverse within Docker Feature: DOI & Handle Feature: Installation Guide Feature: Installer Size: 10 A percentage of a sprint. 7 hours. User Role: Sysadmin Installs, upgrades, and configures the system, connects via ssh
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

5 participants