Skip to content

✨ feat(evidence): record merge.opened_at so time to merge is measurable - #12465

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-12062
Oct 16, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
scanner/fix-12062

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Refs #12062 (RFC tracker). This PR lands the time-to-merge capture that the ACMM level × median time-to-merge view needs. The remaining slices are tracked in child issues #12464 (ACMM × median TTM in the hub drill-down, built on this PR) and #12463 (per-axis criteria table). #12456 is with a human. #12369 (panel 7) is covered by #12415, and the revert rates by author kind are covered by #12428.

Base is v5, not v6. CONTRIBUTING reserves v6 for the #7563 dashboard-optional epic, and every PR in this evidence pipeline (#12241, #12322, #12385, #12415, #12428, …) targets v5.

Why

#12326 asks for ACMM level × median time-to-merge. #12428 deliberately left it out because bundles have no PR-open time. created_at on a live bundle is when review started, not when the PR opened, so time to merge cannot be honestly derived from current evidence.

What

  • evidence.MergeEvent gains an optional opened_at (omitzero). It is additive in schema v1 (schema/v1.json), so older bundles keep their hash. Validate rejects opened_at after merge.at.
  • The live merge recorder (review_evidence_merge.go) stamps it from the PR's GitHub created_at, which comes from the same PullRequests.Get call it already makes. A clock-skewed value later than the merge is dropped.
  • hivectl evidence backfill stamps it from the PR's created_at.
  • New pkg/evidence/time_to_merge.go: Bundle.TimeToMerge() and MedianTimeToMerge(bundles). Bundles that cannot be measured are skipped, never counted as 0.
  • Reporting only. Nothing feeds merge eligibility.

File-overlap guard: no file touched by open PRs #12415, #12428, #12413, #12417 or #12421 is changed here. That is why the src/docs/review-evidence.md schema-table row is deferred to #12464, since #12428 edits that doc.

Testing

go test is disabled on agent pods (hive#9845), so CI is the verdict. gofmt is clean, and check-api-reference-citations.sh reports 0 drift. New and extended tests:

  • pkg/evidence/time_to_merge_test.go: TimeToMerge edge cases; median for odd and even counts, with unmeasured bundles skipped.
  • pkg/evidence: Validate cases for opened_at (before, equal to and after the merge); the schema accepts a bundle with opened_at and rejects a malformed one.
  • pkg/github/review_evidence_ttm_test.go: an end-to-end merge records opened_at; it is left unset when GitHub omits it or the value is skewed; the bundle stays valid and is resealed.
  • hivectl backfill: 🐛 governor: force-clear agents stuck in cancellation loop >5min #105 records opened_at and a time to merge of 24h.

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

Live merges and hivectl evidence backfill stamp the PR's GitHub creation
time on the merge event; pkg/evidence adds Bundle.TimeToMerge and
MedianTimeToMerge for the ACMM level x median time-to-merge view.

Refs #12062

Signed-off-by: scanner <scanner@hive.kubestellar.io>
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 16, 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

@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

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


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

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

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

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 merged commit cc2e075 into v5 Oct 16, 2026
69 of 70 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the scanner/fix-12062 branch October 16, 2026 16:26
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants