fix: break ties in audit ordering by repo ID (lowest first) #13

Merged
rcsheets merged 1 commit from fix/audit-sort-tiebreaker into master 2026-03-26 06:12:42 +00:00
Owner

When multiple repos have the same last-audit time (e.g. epoch for
never-checked repos), sort by repo ID ascending so the lowest IDs
get audited first for deterministic coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

When multiple repos have the same last-audit time (e.g. epoch for never-checked repos), sort by repo ID ascending so the lowest IDs get audited first for deterministic coverage. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix: break ties in audit ordering by repo ID (lowest first)
Some checks are pending
CI / ci (push) Waiting to run
CI / ci (pull_request) Waiting to run
E2E smoke test / e2e (pull_request) Waiting to run
58d0f0f959
When multiple repos have the same last-audit time (e.g. epoch for
never-checked repos), sort by repo ID ascending so the lowest IDs
get audited first for deterministic coverage.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator

Automated review by pr-reviewer v0.15.0 | Safety Check | anthropic | tracking id r-c4ce02-00ec07
This is an AI-generated review and may contain mistakes.

Status: Completed


Verdict: LGTM — The change adds a reasonable tiebreaker to the sorting logic without introducing any obvious bugs or security issues.
Complexity: trivial

This is a straightforward fix that adds deterministic ordering when audit timestamps are equal. The logic is correct - it first checks if timestamps are equal and breaks ties by comparing IDs numerically, then falls back to the original timestamp comparison. No security concerns or obvious bugs detected.

*Automated review by [pr-reviewer](https://git.brooktrails.org/brooktrails/pr-reviewer) v0.15.0 | Safety Check | anthropic | tracking id `r-c4ce02-00ec07`* *This is an AI-generated review and may contain mistakes.* **Status:** ✅ Completed --- **✅ Verdict: LGTM** — The change adds a reasonable tiebreaker to the sorting logic without introducing any obvious bugs or security issues. **Complexity:** trivial This is a straightforward fix that adds deterministic ordering when audit timestamps are equal. The logic is correct - it first checks if timestamps are equal and breaks ties by comparing IDs numerically, then falls back to the original timestamp comparison. No security concerns or obvious bugs detected.
rcsheets force-pushed fix/audit-sort-tiebreaker from 58d0f0f959
Some checks are pending
CI / ci (push) Waiting to run
CI / ci (pull_request) Waiting to run
E2E smoke test / e2e (pull_request) Waiting to run
to c1da07ccd4
Some checks failed
CI / ci (push) Has been cancelled
CI / ci (pull_request) Has been cancelled
E2E smoke test / e2e (pull_request) Has been cancelled
2026-03-26 06:11:23 +00:00
Compare
Collaborator

Automated review by pr-reviewer v0.15.0 | Safety Check | anthropic | tracking id r-c4ce0c-2153a7
This is an AI-generated review and may contain mistakes.

Status: Completed


Verdict: LGTM — The change adds a deterministic tiebreaker to the audit ordering logic, which is a straightforward improvement with no obvious safety concerns.
Complexity: trivial

This change adds a tiebreaker to sort audit entries by repo ID when they have equal lastAudit timestamps. The logic is sound and the implementation is straightforward - it checks for timestamp equality first, then falls back to ID comparison for deterministic ordering. No security vulnerabilities, breaking changes, or obvious bugs detected.

*Automated review by [pr-reviewer](https://git.brooktrails.org/brooktrails/pr-reviewer) v0.15.0 | Safety Check | anthropic | tracking id `r-c4ce0c-2153a7`* *This is an AI-generated review and may contain mistakes.* **Status:** ✅ Completed --- **✅ Verdict: LGTM** — The change adds a deterministic tiebreaker to the audit ordering logic, which is a straightforward improvement with no obvious safety concerns. **Complexity:** trivial This change adds a tiebreaker to sort audit entries by repo ID when they have equal `lastAudit` timestamps. The logic is sound and the implementation is straightforward - it checks for timestamp equality first, then falls back to ID comparison for deterministic ordering. No security vulnerabilities, breaking changes, or obvious bugs detected.
rcsheets merged commit ac9fb3fb23 into master 2026-03-26 06:12:42 +00:00
rcsheets deleted branch fix/audit-sort-tiebreaker 2026-03-26 06:12:43 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
brooktrails/forgejo-runner-operator!13
No description provided.