Skip to content

feat: migrate personOrOrg settings to MPConfig - #11485

Merged
ofahimIQSS merged 6 commits into
IQSS:developfrom
vera:mpconfig-personororg
Aug 29, 2025
Merged

feat: migrate personOrOrg settings to MPConfig#11485
ofahimIQSS merged 6 commits into
IQSS:developfrom
vera:mpconfig-personororg

Conversation

@vera

@vera vera commented May 12, 2025

Copy link
Copy Markdown
Member

What this PR does / why we need it:

As discussed on Zulip (https://dataverse.zulipchat.com/#narrow/channel/375707-community/topic/Setting.20dataverse.2Efiles.2Ehide-schema-dot-org-download-urls/with/514143249) for a different config option, this PR also migrates the options dataverse.personOrOrg.orgPhraseArray and dataverse.personOrOrg.assumeCommaInPersonName to MPConfig.

Which issue(s) this PR closes:

Special notes for your reviewer:

/

Suggestions on how to test this:

Running the tests: mvn test -Dtest="PersonOrOrgUtilTest"

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

/

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

I think that this PR contains a non-backwards-compatible change, with the expected format of the orgPhraseArray changing from a JSON array (e.g. ["Portable","GmbH"]) to a comma-separated list of values (Portable,GmbH), and a release note should be added for that, unless we mitigate this in some other way. Please let me know what you think about this, because I am unsure.

Additional documentation:

/

@coveralls

coveralls commented May 12, 2025

Copy link
Copy Markdown

Coverage Status

coverage: 23.229% (+0.08%) from 23.145%
when pulling e37fbce on vera:mpconfig-personororg
into 86568b5 on IQSS:develop.

@pdurbin pdurbin moved this to Ready for Triage in IQSS Dataverse Project May 12, 2025

@pdurbin pdurbin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the pull request! I left some comments.

The Schema.org metadata and OpenAIRE exports and the Schema.org metadata included in DatasetPages try to infer whether each entry in the various fields (e.g. Author, Contributor) is a Person or Organization. If you are sure that
users are following the guidance to add people in the recommended family name, given name order, with a comma, you can set this true to always assume entries without a comma are for Organizations. The default is false.

Can also be set via *MicroProfile Config API* sources, e.g. the environment variable ``DATAVERSE_PERSONORORG_ASSUMECOMMAINPERSONNAME``.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, ASSUMECOMMAINPERSONNAME is a bit hard to read. I understand you're keeping it the same as the old setting: dataverse.personOrOrg.assumeCommaInPersonName.

What sort of options do we have? Can we add underscores like ASSUME_COMMA_IN_PERSON_NAME and still have backward compatibility? (I'm not sure if there's backward compatibility with the ASSUMECOMMAINPERSONNAME anyway.)

Also, can we please have a release note snippet?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I've now changed the names of the two settings to kebab case, which is what they should be called according to the naming conventions (https://guides.dataverse.org/en/latest/developers/configuration.html#adding-a-jvm-setting).

This means they can now be set using DATAVERSE_PERSON_OR_ORG_ASSUME_COMMA_IN_PERSON_NAME and DATAVERSE_PERSON_OR_ORG_ORG_PHRASE_ARRAY. (Or asadmin create-jvm-options '-Ddataverse.person-or-org.assume-comma-in-person-name=true and asadmin create-jvm-options '-Ddataverse.person-or-org.org-phrase-array=Org,GmbH'). I've tested to confirm all of these options work.

For backwards compatibility, adding an alias so that the old name asadmin create-jvm-options '-Ddataverse.personOrOrg.assumeCommaInPersonName=true' can still be used was easy.

However, for the orgPhraseArray setting, the expected value format has changed as well. Previously, a list like ["Org","GmbH"] was expected, but now it's a list like Org,GmbH. Afaik it wouldn't be as easy to still support parsing the old value format. So I haven't added an alias for that option.

Is it OK to drop support for the old orgPhraseArray setting and require admins to migrate option name + value format? Considering it's documented as an experimental setting.

Also, I've just added a release note snippet that documents all this as well.

@pdurbin pdurbin added Component: Containers Anything related to cloudy Dataverse, shipped in containers. Size: 3 A percentage of a sprint. 2.1 hours. labels May 12, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for Triage to Ready for Review ⏩ in IQSS Dataverse Project May 13, 2025
@cmbz cmbz added FY25 Sprint 23 FY25 Sprint 23 (2025-05-07 - 2025-05-21) FY25 Sprint 24 FY25 Sprint 24 (2025-05-21 - 2025-06-04) labels May 20, 2025
@qqmyers qqmyers moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Jun 2, 2025
@qqmyers qqmyers self-assigned this Jun 2, 2025

@qqmyers qqmyers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall, switching to MPConfig this way looks fine. I do wonder whether removing the static initialization is worth it.

CSL_COMMON_STYLES(SCOPE_CSL, "common-styles"),

// PersonOrOrgUtil SETTINGS
SCOPE_PERSONORORG(PREFIX, "person-or-org", "dataverse.personOrOrg"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly curious - is the alias here needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hm, I am not sure but since I don't see any other scopes with aliases in that file, I guess not. It could be removed.


boolean isOrganization = !isPerson && Organizations.getInstance().isOrganization(name);
if (!isOrganization) {
String[] orgPhrases = JvmSettings.ORG_PHRASE_ARRAY.lookupOptional(String[].class).orElse(new String[]{});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It appears that the shift from a static block to looking these up as needed is just to be able to use the @JvmSetting annotation in tests? Putting the code here means these lookups will be done ~1M times for a /reExportAll command for Harvard Dataverse. Could/should we just call updated versions of the static methods in the tests?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We discussed this PR today and we're still concerted about these ~1 million calls.

@landreev is on vacation for a week or so but we'd like him to take a look when he gets back.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree that we should avoid making these lookups in normal operations, if at all possible. Sorry I missed this.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@vera - can you revert the change here that and go back to having a static initialization and setX methods for use in testing? I'll move this to In Progress until you're finished.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@qqmyers done :)

@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Jun 2, 2025
@ofahimIQSS

Copy link
Copy Markdown
Contributor

it looks like readthedocs job failed

@pdurbin

pdurbin commented Jun 4, 2025

Copy link
Copy Markdown
Member

Here's the failure:

Warning, treated as error:
/Users/PDurbin/github/iqss/dataverse/doc/sphinx-guides/source/admin/metadataexport.rst:68:undefined label: 'dataverse.personororg.assumecommainpersonname'

@pdurbin

pdurbin commented Jun 4, 2025

Copy link
Copy Markdown
Member

I fixed the Sphinx errors in 9a5a102.

@pdurbin pdurbin moved this from Ready for QA ⏩ to In Review 🔎 in IQSS Dataverse Project Jun 4, 2025
@pdurbin

pdurbin commented Jun 4, 2025

Copy link
Copy Markdown
Member

@landreev Jim and I would like you to take a look, please. This might result in a lot of calls on export.

@cmbz cmbz added the FY25 Sprint 25 FY25 Sprint 25 (2025-06-04 - 2025-06-18) label Jun 4, 2025
@pdurbin

pdurbin commented Jun 5, 2025

Copy link
Copy Markdown
Member

@vera can you please resolve merge conflicts?

# Conflicts:
#	src/main/java/edu/harvard/iq/dataverse/settings/JvmSettings.java
@vera

vera commented Jun 6, 2025

Copy link
Copy Markdown
Member Author

@vera can you please resolve merge conflicts?

Yes, done!

@cmbz cmbz added the FY25 Sprint 26 FY25 Sprint 26 (2025-06-18 - 2025-07-02) label Jun 19, 2025
@cmbz cmbz added the FY26 Sprint 1 FY26 Sprint 1 (2025-07-02 - 2025-07-16) label Jul 2, 2025
@pdurbin pdurbin added this to the 6.8 milestone Jul 3, 2025
@cmbz cmbz added the FY26 Sprint 2 FY26 Sprint 2 (2025-07-16 - 2025-07-30) label Jul 17, 2025
@qqmyers qqmyers moved this from In Review 🔎 to In Progress 💻 in IQSS Dataverse Project Jul 21, 2025
@qqmyers qqmyers assigned vera and unassigned landreev Jul 21, 2025
@cmbz cmbz added the FY26 Sprint 3 (2025-07-30 - 2025-08-13) label Jul 31, 2025
@cmbz cmbz added the FY26 Sprint 4 FY26 Sprint 4 (2025-08-13 - 2025-08-27) label Aug 14, 2025
@qqmyers qqmyers moved this from In Progress 💻 to In Review 🔎 in IQSS Dataverse Project Aug 21, 2025

@qqmyers qqmyers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good - thanks for reverting the dynamic lookup.

@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Aug 27, 2025
@qqmyers qqmyers unassigned qqmyers and vera Aug 27, 2025
@ofahimIQSS ofahimIQSS self-assigned this Aug 27, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Aug 27, 2025
@cmbz cmbz added the FY26 Sprint 5 FY26 Sprint 5 (2025-08-27 - 2025-09-10) label Aug 28, 2025
@ofahimIQSS

Copy link
Copy Markdown
Contributor

tests passed - merging PR

@ofahimIQSS
ofahimIQSS merged commit 6275ea9 into IQSS:develop Aug 29, 2025
16 checks passed
@github-project-automation github-project-automation Bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project Aug 29, 2025
@ofahimIQSS ofahimIQSS removed their assignment Aug 29, 2025
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Sep 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Containers Anything related to cloudy Dataverse, shipped in containers. FY25 Sprint 23 FY25 Sprint 23 (2025-05-07 - 2025-05-21) FY25 Sprint 24 FY25 Sprint 24 (2025-05-21 - 2025-06-04) FY25 Sprint 25 FY25 Sprint 25 (2025-06-04 - 2025-06-18) FY25 Sprint 26 FY25 Sprint 26 (2025-06-18 - 2025-07-02) FY26 Sprint 1 FY26 Sprint 1 (2025-07-02 - 2025-07-16) FY26 Sprint 2 FY26 Sprint 2 (2025-07-16 - 2025-07-30) FY26 Sprint 3 (2025-07-30 - 2025-08-13) FY26 Sprint 4 FY26 Sprint 4 (2025-08-13 - 2025-08-27) FY26 Sprint 5 FY26 Sprint 5 (2025-08-27 - 2025-09-10) Size: 3 A percentage of a sprint. 2.1 hours.

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

8 participants