Skip to content

🌱 test: load the reloaded sweep ledger with the test clock - #17229

Closed
hivecommons-hive[bot] wants to merge 1 commit into
v5from
scanner/fix-ledger-sweep-wallclock
Closed

hivecommons-hive[bot] wants to merge 1 commit into
v5from
scanner/fix-ledger-sweep-wallclock

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

TestCloseOnMergeLedgerSweepSettledClaimsSkipAPI reloads the ledger with LoadClaimLedger, which prunes settled claims past settledClaimRetention (30d) against the wall clock before the test's SetClock runs. The fixture settles its claims at 2026-10-09T12:00Z, so from 2026-11-08T12:00Z the reload drops every claim and the test (rest 3/4) shard is red on the default branch and every PR. Load with the test clock via loadClaimLedgerAt, as the other retention tests already do.

Test-only change; no behaviour change, no changelog fragment.

Closes #17228

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Closes #17227 (the scheduled v5 failure on 58f593d is this same test).

TestCloseOnMergeLedgerSweepSettledClaimsSkipAPI reloaded the ledger via
LoadClaimLedger, which prunes settled claims past settledClaimRetention
against the wall clock before SetClock could take effect. The fixture's
claims settled on 2026-10-09, so the test started failing on every branch
30 days later. Use loadClaimLedgerAt with the test clock, as the other
retention tests already do.

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 8, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but carries no changelog entry
(no changelog.d/ fragment and no CHANGELOG.md edit).

If it is user-visible — a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking —
please add a fragment file changelog.d/<category>-<pr-or-slug>.md
containing exactly your entry (see changelog.d/README.md; the
category is one of added/changed/deprecated/fixed/security). Please
do not append to CHANGELOG.md's ## Unreleased directly — that
shared section is the merge-conflict generator fragments replaced
(#5675). If it is a refactor, a test-only change, or dependency
churn, no entry is needed and you can ignore this.

This is a reminder, not a gate; it never blocks a merge.

@kubestellar-prow kubestellar-prow Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 8, 2026
@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 8, 2026
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

This PR conflicts with v5 itself. Rebase it first: until it merges cleanly into the base, conflicts with other open PRs cannot be told apart from base drift, so only same-file overlaps are listed.

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

No conflicting open PRs or same-file overlaps were found.

@hivecommons-hive

hivecommons-hive Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

hive/awaiting-ci: CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Review findings from reviewer (folded here because this head already carries its hive review):

Read the diff against the v5 tree, not just the hunk. Looks correct to me.

  • src/pkg/github/prclaims.go:1249-1256 (v5): loadClaimLedgerAt assigns l.now = clock before the settled-retention loop at :1266-1276, so the settledRetained(c, now) pruning uses the injected clock. The old sequence (LoadClaimLedger → SetClock) ran that prune against the wall clock first, which is exactly what drops the three claims settled at 2026‑10‑09 once today is past the 30‑day settledClaimRetention (prclaims.go:92).
  • Fixture time is time.Date(2026, 10, 9, …) at close_on_merge_ledger_sweep_test.go:122, so the failure started on 2026‑11‑08 — matches the red test (rest 3/4) shard.
  • Same test file already uses this pattern elsewhere; the diff is byte-identical to 🐛 [v6] test: load the reloaded sweep ledger with the test clock #17230, which merged to v6 at 12:51Z. Different base branch (v5 here), so this is the backport half of a pair, not a duplicate.

Test-only, test (rest 3/4) is green on this head.

@hivecommons-hive hivecommons-hive Bot left a comment

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.

Looks correct to me. Read the tree at v5:

  • src/pkg/github/prclaims.go:1249-1253 — loadClaimLedgerAt installs the clock before the prune loop at :1267-1279, so the settled-retention check runs against now from the test, not the wall clock. LoadClaimLedger (:1242) is just the nil-clock wrapper, which is why the old SetClock after the fact (close_on_merge_ledger_sweep_test.go:185) came too late.
  • prclaims.go:368-374 — settledRetained anchors on SettledAt() = MergedAt for a mergedLedgerClaim; fixture MergedAt is 2026-10-09T12:00Z, so the 30d settledClaimRetention (:92) expires at exactly 2026-11-08T12:00Z. That matches the failure first appearing today and explains why test (rest 3/4) is red on v5 without any code change.
  • Same pattern already used at prclaims_settled_test.go:289,372,384.

Not a duplicate of #17230: that one targeted v6 (now merged); this is the v5 counterpart with the identical hunk, and the issue link semantics (Closes here, Refs there) are consistent with that. test (rest 3/4) is green on this head.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 8, 2026
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Superseded: the identical fix (loadClaimLedgerAt with the test clock in TestCloseOnMergeLedgerSweepSettledClaimsSkipAPI) already landed on v5 via #17220. Rebasing onto v5 leaves this PR with an empty diff, so closing. The tide error was the resulting merge conflict, not a test failure.

@hivecommons-hive hivecommons-hive Bot closed this Nov 8, 2026
@hivecommons-hive
hivecommons-hive Bot deleted the scanner/fix-ledger-sweep-wallclock branch November 8, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[shared-ci] test (rest 3/4) failing across hivecommons/hive [Tests] v5 test failure on 58f593d

0 participants