Skip to content

Conversation

@andrewazores
Copy link
Member

@andrewazores andrewazores commented Nov 22, 2025

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • Signed all commits using a GPG signature

To recreate commits with GPG signature git fetch upstream && git rebase --force --gpg-sign upstream/main


Fixes: #1178
Related to #1061

Description of the change:

Removes the old regex from the Job which runs to handle automated rule archiving and pruning. This regex would try to match against archived recording filenames found in storage and use capture groups to compare a portion of the filename to the expected recording name produced by the associated automated rule. However, the regex either made bad assumptions or fell out of sync with other changes to target names/aliases and recording names, and it is now possible for archived recording filenames to not match the regex because of characters outside of the expected character set.

Since this was originally written we now also have metadata labels for active recordings, and when a recording is started by automated rule the recording gains a rule: $name label. These labels are also automatically copied to archive recordings' labels. So, the Job can simply use this metadata label to locate recordings which originate from the associated automated rule, without needing to examine the actual filename.

Motivation for the change:

See #1178

How to manually test:

  1. Check out and build PR
  2. Patch cryostat.yml as described in [Bug] Automated Rule periodic archiving may not always cap the number of preserved copies #1178
  3. CRYOSTAT_DISCOVERY_JDP_ENABLED=false ./smoketest.bash -O quarkus-cryostat-agent
  4. Define localhost: custom target and create automated rule as in [Bug] Automated Rule periodic archiving may not always cap the number of preserved copies #1178
  5. Activate rule and ensure that archive pruning functionality now works as intended

@andrewazores andrewazores added feat New feature or request safe-to-test labels Nov 22, 2025
@andrewazores
Copy link
Member Author

/build_test

@github-actions
Copy link

Workflow started at 11/21/2025, 11:08:31 PM. View Actions Run.

@github-actions
Copy link

No GraphQL schema changes detected.

@github-actions
Copy link

No OpenAPI schema changes detected.

@github-actions
Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat/actions/runs/19590077681

@andrewazores andrewazores requested a review from a team November 22, 2025 04:44
@andrewazores
Copy link
Member Author

/build_test

@github-actions
Copy link

Workflow started at 11/22/2025, 5:30:33 PM. View Actions Run.

@github-actions
Copy link

No GraphQL schema changes detected.

@github-actions
Copy link

No OpenAPI schema changes detected.

@github-actions
Copy link

CI build and push: At least one test failed ❌
https://github.com/cryostatio/cryostat/actions/runs/19602127682

@andrewazores andrewazores force-pushed the rule-archiver-pattern branch 2 times, most recently from c046859 to e2196ee Compare November 24, 2025 05:56
@andrewazores
Copy link
Member Author

/build_test

@github-actions
Copy link

Workflow started at 11/24/2025, 8:59:36 AM. View Actions Run.

@github-actions
Copy link

No GraphQL schema changes detected.

@github-actions
Copy link

No OpenAPI schema changes detected.

@github-actions
Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat/actions/runs/19636913997

@andrewazores
Copy link
Member Author

/build_test

@github-actions
Copy link

Workflow started at 11/24/2025, 9:28:50 AM. View Actions Run.

@github-actions
Copy link

No OpenAPI schema changes detected.

@github-actions
Copy link

No GraphQL schema changes detected.

@github-actions
Copy link

CI build and push: At least one test failed ❌
https://github.com/cryostatio/cryostat/actions/runs/19637801265

@andrewazores
Copy link
Member Author

/build_test

@github-actions
Copy link

Workflow started at 11/24/2025, 9:51:30 AM. View Actions Run.

@github-actions
Copy link

No GraphQL schema changes detected.

@andrewazores
Copy link
Member Author

/build_test

@github-actions
Copy link

Workflow started at 11/24/2025, 12:17:27 PM. View Actions Run.

@github-actions
Copy link

No GraphQL schema changes detected.

@github-actions
Copy link

No OpenAPI schema changes detected.

@github-actions
Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat/actions/runs/19642991466

@andrewazores
Copy link
Member Author

/build_test

@github-actions
Copy link

Workflow started at 11/28/2025, 10:30:39 AM. View Actions Run.

@github-actions
Copy link

No OpenAPI schema changes detected.

@github-actions
Copy link

No GraphQL schema changes detected.

@github-actions
Copy link

CI build and push: All tests pass ✅
https://github.com/cryostatio/cryostat/actions/runs/19768069079

Copy link
Contributor

@Josh-Matsuoka Josh-Matsuoka left a comment

Choose a reason for hiding this comment

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

Pruning works as expected when following instructions, localhost:0 behaves correctly

@andrewazores andrewazores merged commit b9730cd into cryostatio:main Dec 2, 2025
12 checks passed
@andrewazores andrewazores deleted the rule-archiver-pattern branch December 2, 2025 15:20
mergify bot pushed a commit that referenced this pull request Dec 2, 2025
andrewazores added a commit that referenced this pull request Dec 2, 2025
…to match recordings (backport #1179) (#1203)

* fix(rules): archiver job uses metadata labels, not filename pattern, to match recordings (#1179)

(cherry picked from commit b9730cd)

* chore(schema): automatic update

---------

Co-authored-by: Andrew Azores <me@andrewazor.es>
Co-authored-by: Cryostat CI <rhjavamonitoring@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport feat New feature or request safe-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Automated Rule periodic archiving may not always cap the number of preserved copies

2 participants