Skip to content

test(pr-followup): add PrFixType assertions to ingestion tests#380

Merged
joryirving merged 2 commits into
mainfrom
fix/365-prfix-type-tests
Jun 16, 2026
Merged

test(pr-followup): add PrFixType assertions to ingestion tests#380
joryirving merged 2 commits into
mainfrom
fix/365-prfix-type-tests

Conversation

@itsmiso-ai

@itsmiso-ai itsmiso-ai commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Refs #365

Summary

Add type field assertions to the ingestion test suite to verify that each ingest function populates the correct PrFixType value. This closes the test gap identified in issue #365.

Implementation note

The implementation fix (passing correct type to enqueuePrFixItem) was already merged to main before this branch was cut. The current code in src/lib/pr-followup-ingestion.ts already passes:

  • ingestCommentEventtype: "REVIEW_FEEDBACK"
  • ingestReviewEventtype: "REVIEW_FEEDBACK"
  • ingestCheckRunEventtype: "CI_FAILURE"
  • ingestMergeStateEvent(DIRTY)type: "MERGE_CONFLICT"
  • ingestMergeStateEvent(BEHIND)type: "OTHER"

This PR adds the test assertions that verify this existing correct behavior.

Tests added

  • ingestCommentEvent → asserts type: "REVIEW_FEEDBACK"
  • ingestReviewEvent → asserts type: "REVIEW_FEEDBACK"
  • ingestCheckRunEvent → asserts type: "CI_FAILURE"
  • ingestMergeStateEvent(DIRTY) → asserts type: "MERGE_CONFLICT" (new test)
  • ingestMergeStateEvent(BEHIND) → asserts type: "OTHER"

All 34 tests pass.

Worker: saffron-normal
Model: litellm/nvidia

Add type field assertions to verify that each ingest function
populates the correct PrFixType:

- ingestCommentEvent → REVIEW_FEEDBACK
- ingestReviewEvent → REVIEW_FEEDBACK
- ingestCheckRunEvent → CI_FAILURE
- ingestMergeStateEvent(DIRTY) → MERGE_CONFLICT
- ingestMergeStateEvent(BEHIND) → OTHER

This closes the test gap identified in #365.
its-saffron[bot]

This comment was marked as outdated.

The implementation fix (passing correct type to enqueuePrFixItem) was
already merged to main before this branch was cut. This PR adds test
assertions verifying the existing correct behavior:

- ingestCommentEvent → REVIEW_FEEDBACK
- ingestReviewEvent → REVIEW_FEEDBACK
- ingestCheckRunEvent → CI_FAILURE
- ingestMergeStateEvent(DIRTY) → MERGE_CONFLICT
- ingestMergeStateEvent(BEHIND) → OTHER

Addresses reviewer concern about missing implementation changes.
@itsmiso-ai

Copy link
Copy Markdown
Contributor Author

Addressing review feedback:

The implementation fix (passing correct type to enqueuePrFixItem) was already merged to main before this branch was cut. The current code in src/lib/pr-followup-ingestion.ts already passes the correct type values in all ingest functions. This PR adds the test assertions that verify this existing behavior.

Updated the PR body to clarify this and changed "Fixes" to "Refs" since the implementation was already done on main.

@joryirving joryirving added the ai-review Request an AI pull request review. label Jun 16, 2026
@its-saffron its-saffron Bot dismissed their stale review June 16, 2026 16:28

Superseded by a newer automated review for this pull request.

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AI Automated Review

Full PR review.

Analysis engine: MiniMax-M2.7@https://litellm.jory.dev/v1 (anthropic) — escalated (fast_low_confidence)

PR PR 380 Review — test(pr-followup): add PrFixType assertions to ingestion tests

Summary

This PR adds type field assertions to the existing PR follow-up ingestion test suite (src/lib/pr-followup-ingestion.test.ts). Per the PR body, the implementation fix (correctly passing type to enqueuePrFixItem) was already merged to main; this PR adds only the test coverage that verifies that behavior.

Change-by-Change Analysis

The diff adds 6 assertions across 5 existing test cases and 1 new test case:

  1. ingestCommentEvent (actionable path) — asserts type: "REVIEW_FEEDBACK". Confirmed: ingestCommentEvent passes "REVIEW_FEEDBACK" via EnqueuePrFixInput.type in the source.
  2. ingestCommentEvent (needs_human path) — asserts type: "REVIEW_FEEDBACK". Same path; type is consistent.
  3. ingestReviewEvent — asserts type: "REVIEW_FEEDBACK". Confirmed: ingestReviewEvent passes "REVIEW_FEEDBACK" in the source.
  4. ingestCheckRunEvent (actionable path) — asserts type: "CI_FAILURE". Confirmed: ingestCheckRunEvent passes "CI_FAILURE".
  5. ingestMergeStateEvent (BEHIND) — asserts type: "OTHER". Confirmed: BEHIND maps to "OTHER" in the source.
  6. New test: ingestMergeStateEvent (DIRTY) — explicitly tests the DIRTY/merge-conflict path asserting type: "MERGE_CONFLICT". Confirmed: DIRTY maps to "MERGE_CONFLICT" in the source.

Standards Compliance

  • Code Standards: No issues. Test assertions use standard Vitest expect pattern consistent with the rest of the file.
  • No commit of secrets: N/A — test-only change.
  • Error handling: N/A — pure unit test additions.
  • Validation: N/A — assertions validate already-produced values.

Evidence Provider Findings

No evidence providers are configured for this repository.

Tool Harness Findings

The test file was read in full. Key observations:

  • The mock client (makeClient()) correctly captures type in the data object when calling prFixQueueItem.create, so assertions on client.items[0].type are valid.
  • The mock includes $transaction which wraps the create call, matching the real call path.
  • The new MERGE_CONFLICT test follows the same pattern as adjacent tests and correctly exercises the dirty merge state.

CI Check Results

All CI checks passed (Validate, Docker Build, review). This is authoritative evidence that lint, typecheck, and tests all succeed with the additions.

Linked Issue Fit

No linked issue context was provided in the corpus. The PR body references issue PR 365 as the motivation, and the implementation notes clarify the relationship between this test-only PR and the already-merged implementation fix.

Unknowns / Needs Verification

None. The implementation source was read and the type mappings are confirmed. CI confirms all 34 tests pass.

Recommendation

Approve. This is a straightforward test-coverage PR: it adds assertions that verify existing correct behavior, introduces a new test case for a previously untested path (DIRTY merge state → MERGE_CONFLICT), and all tests pass. No functional changes to production code.

@its-saffron its-saffron Bot removed the ai-review Request an AI pull request review. label Jun 16, 2026
@joryirving joryirving merged commit 0aa130a into main Jun 16, 2026
4 checks passed
@joryirving joryirving deleted the fix/365-prfix-type-tests branch June 16, 2026 16:35
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