Skip to content

fix: replace peribolos --dump with dry-run for drift detection#103

Merged
marcusburghardt merged 2 commits into
complytime:mainfrom
marcusburghardt:fix/peribolos-drift-detection
May 22, 2026
Merged

fix: replace peribolos --dump with dry-run for drift detection#103
marcusburghardt merged 2 commits into
complytime:mainfrom
marcusburghardt:fix/peribolos-drift-detection

Conversation

@marcusburghardt
Copy link
Copy Markdown
Contributor

Summary

The drift detection workflow used peribolos --dump which internally calls GET /user (BotUser).
This endpoint is incompatible with GitHub App installation tokens.
Unlike the apply code path where --require-self=false bypasses BotUser, the dump code path calls it unconditionally (verified in kubernetes-sigs/prow dumpOrgConfig).

Replace the YAML-diff approach with a dry-run approach:

  • Run peribolos without --confirm (same flags as apply workflow)
  • Filter log output for mutation function names (Edit*, Update*, Remove*, Create*, Delete*, Add*)
  • If any mutations would be applied, drift exists

This is also more accurate than YAML diff because it uses peribolos own reconciliation logic, eliminating false positives from dump including fields not declared in peribolos.yaml.

Additionally standardize workflow naming:

  • Rename files: peribolos-apply.yml, peribolos-validate.yml, peribolos-drift.yml
  • Rename display names: "Peribolos: Apply", "Peribolos: Validate", "Peribolos: Drift"

Related Issues

Review Hints

  • Besides standardizing file names and titles, the logic is basically the same, but simpler.

@marcusburghardt marcusburghardt enabled auto-merge (rebase) May 19, 2026 19:03
@marcusburghardt marcusburghardt marked this pull request as draft May 19, 2026 19:24
auto-merge was automatically disabled May 19, 2026 19:25

Pull request was converted to draft

@marcusburghardt marcusburghardt force-pushed the fix/peribolos-drift-detection branch from 4643542 to 2137c69 Compare May 20, 2026 13:04
@marcusburghardt marcusburghardt marked this pull request as ready for review May 20, 2026 14:57
jpower432
jpower432 previously approved these changes May 20, 2026
Copy link
Copy Markdown
Member

@jpower432 jpower432 left a comment

Choose a reason for hiding this comment

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

LGTM

The drift detection workflow used peribolos --dump which internally
calls GET /user (BotUser). This endpoint is incompatible with GitHub
App installation tokens. Unlike the apply code path where
--require-self=false bypasses BotUser, the dump code path calls it
unconditionally (verified in kubernetes-sigs/prow dumpOrgConfig).

Replace the YAML-diff approach with a dry-run approach:
- Run peribolos without --confirm (same flags as apply workflow)
- Filter log output for mutation function names (Edit*, Update*,
  Remove*, Create*, Delete*, Add*)
- If any mutations would be applied, drift exists

This is also more accurate than YAML diff because it uses peribolos
own reconciliation logic, eliminating false positives from dump
including fields not declared in peribolos.yaml.

Additionally standardize workflow naming:
- Rename files: peribolos-apply.yml, peribolos-validate.yml,
  peribolos-drift.yml
- Rename display names: "Peribolos: Apply", "Peribolos: Validate",
  "Peribolos: Drift"

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
Apply the same temp file fix for --github-token-path as in
peribolos-apply (process substitution FIFO causes 401s on re-read).

Fix shellcheck SC2069: reorder redirects so stderr is captured to
the log file (> file 2>&1, not 2>&1 > file).

Add --ignore-enterprise-teams to skip ent:* managed teams.

Assisted-by: OpenCode (claude-opus-4-6)
Signed-off-by: Marcus Burghardt <maburgha@redhat.com>
@marcusburghardt
Copy link
Copy Markdown
Contributor Author

@jpower432 I had to rebase in order to resolve a conflict. :(

@marcusburghardt marcusburghardt enabled auto-merge (rebase) May 20, 2026 15:55
Copy link
Copy Markdown
Member

@jpower432 jpower432 left a comment

Choose a reason for hiding this comment

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

LGTM

@marcusburghardt marcusburghardt merged commit 28b1967 into complytime:main May 22, 2026
18 checks passed
@marcusburghardt marcusburghardt deleted the fix/peribolos-drift-detection branch May 22, 2026 17:51
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