Skip to content

GH Issue 1721: Site settings API helper and tests - #3254

Merged
labkey-jeckels merged 4 commits into
developfrom
fb_site_settings_api_1721
Oct 20, 2026
Merged

labkey-jeckels merged 4 commits into
developfrom
fb_site_settings_api_1721

Conversation

@labkey-jeckels

@labkey-jeckels labkey-jeckels commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

Add a test helper for the new site settings APIs so tests can change site settings and restore them from cleanup code without navigating the browser. GH Issue 1721

Related Pull Requests

Changes

  • New helper that reads and updates site settings and restores the values a test changed.
  • New test covering the APIs' results, rejected updates, permissions, auditing, and saving through the page.
  • Pipeline tools setup uses the API instead of opening the site settings page.
  • Site settings page tests read validation errors from the page instead of a reloaded form.

@labkey-jeckels

Copy link
Copy Markdown
Contributor Author

Tested locally with SiteSettingsApiTest and AdminConsoleTest.

@labkey-jeckels labkey-jeckels self-assigned this Oct 16, 2026
@labkey-jeckels
labkey-jeckels marked this pull request as ready for review October 19, 2026 20:42

@labkey-tchad labkey-tchad 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.

This is great. Thank you.

labkey-jeckels added a commit to LabKey/platform that referenced this pull request Oct 20, 2026
…ugh them (#8189)

## Rationale
Add APIs that read and update site settings by name, and make the site
settings page save through the update API so the page and the API share
one save path and the same validation. [GH Issue
1721](LabKey/internal-issues#1721)

Tests and provisioning scripts can then change a setting and put it back
without driving the admin page.

## Related Pull Requests
- LabKey/testAutomation#3254

## Changes
- A new GET API returns every site setting, and a new POST API updates
any subset by name; an unknown name or invalid value fails the whole
request and saves nothing.
- Updates are validated against the saved values plus the requested
changes, run the HTTPS connectivity check before SSL is required, and
are audited like a page save.
- Usage reporting level can't be changed on distributions where
reporting is always on.
- The site settings page saves through the update API and shows
validation errors in place.
- Invalid reporting levels are now rejected instead of silently ignored,
and a setting left out of a save keeps its current value.

Tested locally with the SiteSettingsUpdater and AdminController
server-side tests, plus SiteSettingsApiTest and AdminConsoleTest.

## Tasks
- [x] Claude Code Review
- [x] Manual Testing @labkey-gokhano - Passed: see the test results
below. Just a minor non-blocking question also posted as comment.
- [x] Test Automation
- [ ] User Education: For someone who might have scripted site setting
updates via HTTP (no previously supported API was available):
`admin-customizeSite` no longer accepts POST and returns 405; scripts
that form-posted site settings must call `admin-updateSiteSettings.api`
with setting names from `admin-getSiteSettings.api`. @labkey-hannah
- This could have been someone's workflow as part of restoring a
production DB to a staging server, for example. We've typically
recommended doing SQL scripts for that, so I think it's unlikely to hit
anyone.
@labkey-jeckels
labkey-jeckels merged commit 1372351 into develop Oct 20, 2026
8 checks passed
@labkey-jeckels
labkey-jeckels deleted the fb_site_settings_api_1721 branch October 20, 2026 22:50
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