Skip to content

Add audit log for successful LK version changes - #3159

Merged
cnathe merged 10 commits into
developfrom
fb_550_upgradeAudit
Aug 21, 2026
Merged

Add audit log for successful LK version changes#3159
cnathe merged 10 commits into
developfrom
fb_550_upgradeAudit

Conversation

@labkey-jeckels

Copy link
Copy Markdown
Contributor

Rationale

In order to understand when their servers were upgraded, we want to expose a new audit table that tracks deployments/startups with new builds.

Related Pull Requests

Changes

  • New upgrade test to ensure that we write entries during bootstrap and upgrade

@labkey-jeckels labkey-jeckels added this to the 26.09 milestone Aug 17, 2026
@labkey-jeckels labkey-jeckels self-assigned this Aug 17, 2026
@EarliestVersion(FIRST_AUDITED_VERSION)
public void testVersionChangeRecorded() throws Exception
{
Assume.assumeFalse("A version change is only visible after the upgrade", isUpgradeSetupPhase);

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 actually needs to check whether the setup happened on a different version. We have a sort of failsafe/sanity check for the upgrade pipeline that stays on the same version ("Upgrade validation" with no version).

Suggested change
Assume.assumeFalse("A version change is only visible after the upgrade", isUpgradeSetupPhase);
Assume.assumeFalse("A version change is only visible after the upgrade", setupVersion.equals(TestProperties.getProductVersion()));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@labkey-tchad I made a bigger change. The most recent run passed but my followup commit should fix it. This is ready for you to take another look at your convenience.

@labkey-jeckels

Copy link
Copy Markdown
Contributor Author

@labkey-tchad The latest run is now passing on the upgrade tests.

Comment on lines +207 to +210
finally
{
permissionsHelper.removeUserRoleAssignment(projectAdmin.getEmail(), PermissionsHelper.SEE_AUDIT_LOG_SITE_ROLE, "/");
}

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 isn't really necessary since we delete the user immediately after this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

True. Simplified.

cnathe added a commit to LabKey/platform that referenced this pull request Aug 21, 2026
## Rationale
In order to understand when their servers were upgraded, we want to
expose a new audit table that tracks deployments/startups with new
builds.

#### Related Pull Requests
- #7943
- LabKey/testAutomation#3159
- LabKey/labkey-ui-components#2063
- LabKey/limsModules#2418

## Changes
- New System Upgrade audit table
- Populate table with a new row every startup that's using a different
build
- Variant of getAuditEvents() for setting maxRows

---------

Co-authored-by: Susan Hert <susanh@labkey.com>
Co-authored-by: cnathe <cnathe@labkey.com>
@cnathe
cnathe merged commit c9acf87 into develop Aug 21, 2026
7 of 13 checks passed
@cnathe
cnathe deleted the fb_550_upgradeAudit branch August 21, 2026 18:24
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.

3 participants