-
Notifications
You must be signed in to change notification settings - Fork 547
Database Settings: idempotent mass operations, necessary cleanup and script using it for real use case #11654
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
Merged
Merged
Changes from all commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
8279e65
feat: add `parse` method and unit tests for `SettingsServiceBean.Key`…
poikilotherm 0a95753
feat: add `listAllWithoutLocalizations` method to filter settings wit…
poikilotherm 54c3f6e
feat: implement `listAllAsJson` for settings retrieval with localizat…
poikilotherm 0ebe683
chore: add JaCoCo args placeholders to pom.xml
poikilotherm 684c7d1
feat: replace tabular ingest size limits configuration using JSON #11639
poikilotherm b11b722
feat(db): migrate TabularIngestSizeLimit settings to JSON format with…
poikilotherm 92adb8a
docs: improve TabularIngestSizeLimit documentation with JSON examples…
poikilotherm b17e52a
fix: handle unsupported JSON integers in tabular ingest size limits #…
poikilotherm 4932396
refactor: simplify `listAllAsJson` method and update corresponding te…
poikilotherm d153cac
feat: add validation for settings names and language codes in Admin S…
poikilotherm 3975db0
feat: support JSON objects in `listAllAsJson` settings output and upd…
poikilotherm 865ed5c
refactor: centralize validation logic for settings names and language…
poikilotherm 8fe9754
feat: add `validateKeys` method to validate settings keys and update …
poikilotherm 515472d
feat: add `SettingsServiceBean.convertJsonToSettings()` method and un…
poikilotherm a106111
feat: add `putAllSettings` endpoint to Admin API for bulk settings up…
poikilotherm 11c8f82
style: normalize spacing in `Setting` entity named queries #11639
poikilotherm 71a403c
fix: add unique constraint to `Setting` entity for `name` and `lang` …
poikilotherm a9b1974
refactor: update `Setting` entity and queries to treat empty string a…
poikilotherm 5ae758c
refactor: enforce non-null constraint, VARCHAR type, and limit length…
poikilotherm 974d6c4
chore: update migration script comment for clarity #11639
poikilotherm c3f1ed7
chore: add migration script to update `Setting` table structure #11639
poikilotherm 782542f
refactor: enhance `Setting` entity equality and constructor for clari…
poikilotherm aed9f36
refactor: rename `BuiltinUsers.KEY` setting to `:BuiltinUsersKey` for…
poikilotherm 48db4b3
refactor: extract `convertToJsonKey` method in `SettingsServiceBean` …
poikilotherm a736052
feat: implement atomic bulk settings replacement with detailed operat…
poikilotherm c68ac57
refactor: change `List` to `Set` for `convertJsonToSettings` #11639
poikilotherm 6f90535
fix: add null checks for `settings` in `setAllFromJson` and `validate…
poikilotherm 1f8a280
feat: return operation details from `setAllFromJson` in `SettingsServ…
poikilotherm 614fc71
fix: prevent accidental removal of all settings in `setAllFromJson` b…
poikilotherm 580039b
fix: ensure transactional integrity in `replaceAllSettings` using sel…
poikilotherm bd85f72
fix,build: ensure proper late variable binding for JaCoCo configurati…
poikilotherm c91b4fc
style: correct typo in `internalError` key in `JsonResponseBuilder`
poikilotherm 4b5b689
fix,style: update SQL and class definitions to standardize lowercase …
poikilotherm c7434a5
fix: update Flyway migration to replace constraints and indexes in `s…
poikilotherm ff45c80
fix: update `get` method in `Admin` API to handle third parameter for…
poikilotherm 1189068
test: add nested test cases for settings API in `AdminIT` #11639
poikilotherm 982e092
docs: add release note and API docs for #11639
poikilotherm 1b06dfb
feat: add `UNCHANGED` state handling in `SettingsServiceBean` operati…
poikilotherm d500650
test: add unit tests for `replaceAllSettings` in `SettingsServiceBean…
poikilotherm 4758f86
refactor: introduce `SettingsValidationException` for enhanced error …
poikilotherm e33b3f7
test: add validation test for invalid settings in `AdminIT` #11639
poikilotherm 08a2861
fix: replace `@Transactional` with `@TransactionAttribute` in `Settin…
poikilotherm 5a099ef
feat(ct): add database settings replacement script to configbaker ima…
poikilotherm 558e8f9
refactor(ct): extract common utility functions in `apply-db-settings.…
poikilotherm 8e220fb
feat(ct): support additional environment variable sources in `apply-d…
poikilotherm bde0384
feat,refactor(ct): move yq parsing and add envsubst #11639
poikilotherm 2368d7e
fix(migrate): move `UPDATE` statement post constraint drops for NULL …
poikilotherm 21ca0b8
fix(scripts): exclude hidden mounted files in `read-to-env.sh`
poikilotherm 7f83292
chore(scripts): comment out config file print in `apply-db-settings.s…
poikilotherm 37015d6
fix(settings): handle JSON string unescaping in `SettingsServiceBean`…
poikilotherm 292855b
doc suggestions for settings API #11639
pdurbin b7e541d
doc tweaks #11639
pdurbin 071f695
chore: move migrations to be part of v6.9 instead of v6.8 #11639
poikilotherm efd7bbf
create test methods for getting and setting all settings (and use the…
pdurbin 95533c6
the "not found" message now ends in a period #11639
pdurbin 30f4603
add to the enum many archive-related settings #11639
pdurbin 4d72fcb
add basic test for :TabularIngestSizeLimit #11639
pdurbin 159b189
more ingest size limit tests #11639
pdurbin 839dd79
improve docs based on ingest size limit testing #11639
pdurbin 2450ecd
add more settings to enum to pass validation #11639
pdurbin 692be46
add TODOs for WorkflowsAdmin#IP_WHITELIST_KEY db setting #11639
pdurbin a43da29
style(settings): rename `WorkflowsAdmin#IP_WHITELIST_KEY` to `:Workfl…
poikilotherm 2a97dd7
chore(settings): mark `SettingsServiceBean` methods using String for …
poikilotherm c667b18
doc(settings): clarify database changes require app reload for ORM
poikilotherm 553894a
Merge branch 'develop' into 11639-db-opts-idempotency #11639
pdurbin 525b788
Merge branch 'develop' into 11639-db-opts-idempotency
ofahimIQSS 9930242
Merge branch 'develop' into 11639-db-opts-idempotency
ofahimIQSS cd5198a
Merge branch 'develop' into 11639-db-opts-idempotency #11639
pdurbin f994cdc
Merge branch 'develop' into 11639-db-opts-idempotency
ofahimIQSS ca00bf9
Merge branch 'develop' into 11639-db-opts-idempotency
ofahimIQSS c4d2f4a
chore(settings): add deprecation notices for String-based methods in …
poikilotherm 3ce5875
style(settings): make `Op` enum public to resolve IDE warnings #11654
poikilotherm 5eea9d5
feat(util): add `getJsonValue` method for robust JSON parsing #11654
poikilotherm 9497acd
fix(settings): improve JSON handling in `SettingsServiceBean` and add…
poikilotherm b621459
Merge branch 'develop' into 11639-db-opts-idempotency
sekmiller efe575f
Merge branch 'develop' into 11639-db-opts-idempotency
sekmiller 886a9cf
feat(db): add `SettingsCleanupCallback` to remove invalid settings af…
poikilotherm 757f2e5
Merge branch 'develop' into 11639-db-opts-idempotency
sekmiller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| ## Database Settings Cleanup | ||
|
|
||
| With this release, we remove some legacy specialties around Database Settings and provide better Admin API endpoints for them. | ||
|
|
||
| Most important changes: | ||
|
|
||
| 1. Setting `BuiltinUsers.KEY` was renamed to `:BuiltinUsersKey`, aligned with our general naming pattern for options. | ||
| 2. Setting `WorkflowsAdmin#IP_WHITELIST_KEY` was renamed to `:WorkflowsAdminIpWhitelist`, aligned with our general naming pattern for options. | ||
| 3. Setting `:TabularIngestSizeLimit` no longer uses suffixes for formats and becomes a JSON-based setting instead. | ||
| 4. If set, all three settings will be migrated to their new form automatically for you (Flyway migration). | ||
| 5. You can no longer (accidentally) create or use arbitrary setting names or languages. | ||
| All Admin API endpoints for settings now validate setting names and languages for existence and compliance. | ||
|
|
||
| As an administrator of a Dataverse instance, you can now make use of enhanced Bulk Operations on the Settings Admin API: | ||
|
|
||
| 1. Retrieving all settings as JSON via `GET /api/admin/settings` supports localized options now, too. | ||
| 2. You can replace all existing settings in an idempotent way sending JSON to `PUT /api/admin/settings`. | ||
| This will create, update and remove settings as necessary in one atomic operation. | ||
| The new endpoint is especially useful to admins using GitOps or other automations. | ||
| It allows control over all Database Settings from a single source without risking an undefined state. | ||
|
|
||
| Note: Despite the validation of setting names and languages, the content of any database setting is still not being validated when using the Settings Admin API! | ||
|
|
||
| ### Updated Database Settings | ||
|
|
||
| The following database settings are were added to the official list within the code (to remain valid with the settings cleanup mentioned above): | ||
|
|
||
| - `:BagGeneratorThreads` | ||
| - `:BagItHandlerEnabled` | ||
| - `:BagItLocalPath` | ||
| - `:BagValidatorJobPoolSize` | ||
| - `:BagValidatorJobWaitInterval` | ||
| - `:BagValidatorMaxErrors` | ||
| - `:BuiltinUsersKey` - formerly `BuiltinUsers.KEY` | ||
| - `:CreateDataFilesMaxErrorsToDisplay` | ||
| - `:DRSArchiverConfig` - a Harvard-specific setting | ||
| - `:DuraCloudContext` | ||
| - `:DuraCloudHost` | ||
| - `:DuraCloudPort` | ||
| - `:FileCategories` | ||
| - `:GoogleCloudBucket` | ||
| - `:GoogleCloudProject` | ||
| - `:LDNAnnounceRequiredFields` | ||
| - `:LDNTarget` | ||
| - `:WorkflowsAdminIpWhitelist` - formerly `WorkflowsAdmin#IP_WHITELIST_KEY` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@poikilotherm do we need to note the changes to TabularIngestSizeLimit here?