Repository navigation
Expand lifecycle tests for identity, validation, and merge behavior - #78940
Conversation
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Triage
This is a focused lifecycle test expansion that improves validation coverage without changing runtime behavior.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ PR Code Quality Reviewer completed the code quality review. PR Code Quality ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.
|
|
✅ PR Specification Reviewer completed successfully! PR Specification ReviewerOutcome: The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
Design Decision Gate: no ADR verifiedResult: ADR enforcement applies (177 added lines under Evidence
Next action (choose one)
|
Comment MemoryPeek at saved memory (spec-review-history)History |
There was a problem hiding this comment.
🟢 Approval recommended
The review evidence describes focused lifecycle test coverage across validation, identity, merge conflicts, fallback behavior, and timezone comparisons without flagging outstanding concerns.
No open issues 🎉
What changed in this PR
Expands lifecycle test coverage for identity classification, delivery and observation validation, merge conflict handling, fallback adoption rules, and timezone-normalized comparisons.
Changes:
- Adds table-driven tests for
IsHuman, invalid delivery identities and URLs, and invalid observations. - Covers delivery-evidence conflicts, invalid incoming records, and UTC-equivalent timestamps during merge.
- Refines identity-change and fallback tests to isolate individual behavior checks.
| File | Description |
|---|---|
| pkg/lifecycle/lifecycle_test.go | Adds lifecycle validation, identity, fallback, merge, and timezone test coverage while improving assertion structure. |
Review effort: Lite (adaptive)
Comment MemoryPeek at saved memory (pr-code-quality-reviewer)Note This comment is managed by comment memory.Expand the saved memory block to view or edit the persistent context for this thread.
|
There was a problem hiding this comment.
Found one low-severity test coverage gap: the identity test clears the baseline target URL, so it does not verify that changing one valid URL to another changes the lifecycle ID. No runtime defects were identified in this test-only PR.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K
Comment /review to run again
| require.NoError(t, err) | ||
| require.NotEqual(t, first.ID, next.ID) | ||
| identity := first.Identity | ||
| identity.TargetURL = "" |
There was a problem hiding this comment.
This baseline clears TargetURL, so the later target-URL case only checks adding a URL to an otherwise URL-less identity, not that changing one valid target URL changes the identity. That leaves regressions where target URLs are ignored or normalized indistinguishably from one another undetected.
💡 Strengthen the identity test
Keep the valid target URL in the baseline and mutate it to a different valid URL (or add a separate add-versus-change case), then retain the ID inequality assertion.
Comment MemoryPeek at saved memory (review-history)History |
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and a mutation check (/diagnosing-bugs style) to the test changes. Observations only; one narrow coverage gap, no blocking issues.
📋 Key Themes & Highlights
Key Themes
- Target URL distinctness: only empty vs. set is covered; two different non-empty URLs are not compared.
- Testify style:
assert.Errorin the table loop may triprequire-error. Lint could not run here, so this is unverified.
Positive Highlights
- ✅ Four temporary mutations in
lifecycle.go(identity hash, publisher handling, UTC normalisation, delivery-time conflict) were each caught by the new tests. - ✅
go test -count=1 ./pkg/lifecycle/passes;gofmtandgo vetare clean. - ✅ Table-driven subtests with descriptive names read as a clear specification.
@copilot please address the review comments above.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~8 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again
| {"host", func(i *Identity) { i.Host = "github.example" }}, | ||
| {"workflow", func(i *Identity) { i.Workflow = "other-worker" }}, | ||
| {"type", func(i *Identity) { i.Type = "add_comment" }}, | ||
| {"target URL", func(i *Identity) { i.TargetURL = "https://github.com/org/target/issues/8" }}, |
There was a problem hiding this comment.
[/tdd] The target URL case only checks empty vs. set. Two different non-empty URLs are never compared, so a mutation that maps every non-empty TargetURL to one value still passes the suite (verified).
💡 Suggested test
Add a second base identity with a non-empty TargetURL and assert that two different URLs yield different IDs, e.g. https://github.com/org/target/issues/7 vs .../issues/8.
@copilot please address this.
| identity := record.Identity | ||
| tt.change(&identity) | ||
| _, err := Delivered(identity, record.Delivery.At, record.Delivery.ObservedAt, record.Delivery.Source) | ||
| assert.Error(t, err) |
There was a problem hiding this comment.
[/tdd] assert.Error is used for an error check in the table loop. testifylint's require-error rule (enabled via enable-all) will likely flag this, so require.Error is the expected form. Lint could not run in this environment, so this is unverified.
@copilot please address this.
|
Category: test | Risk: low | Score 41/100 (impact 15 + urgency 12 + quality 14) | Action: auto_merge | Reason: valuable lifecycle coverage increase with low regression risk and passing CI.
|
Lifecycle tests lacked coverage for
IsHumanand severalDelivered,Observe, andMergevalidation paths. The fallback tests also changed time in both cases, leavingHumanVerifiedunisolated.