Skip to content

fix(contract): preserve actionable Git resolver warning codes - #46

Merged
nia-sg-bot merged 1 commit into
mainfrom
nia/issue-21-resolver-warning-contract
Sep 5, 2026
Merged

fix(contract): preserve actionable Git resolver warning codes#46
nia-sg-bot merged 1 commit into
mainfrom
nia/issue-21-resolver-warning-contract

Conversation

@nia-sg-bot

@nia-sg-bot nia-sg-bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve every supported Git snapshot resolver warning as its own machine-readable DiffGraph v2 warning code
  • extend the public schema enum for commit-range, pathspec, untracked, and gitlink resolver failures
  • cover invalid refs and out-of-repository pathspecs through the structural CLI artifact

Part of #21

Remaining #21 work is the broader end-to-end coverage of any unimplemented Git snapshot edge cases; this PR specifically makes already-detected resolver failures actionable to artifact consumers without detail-string parsing.

Validation

  • python3 -m pytest tests/test_structural.py -k 'invalid_ref_warning_code or scoped_pathspec_warning_code' -q\n- python3 -m pytest tests/test_git_snapshot.py -q\n- python3 -m pytest -q

Summary by CodeRabbit

  • New Features

    • Added machine-readable warning codes for Git snapshot resolution issues, including invalid references, merge-base failures, malformed metadata, untracked-file detection failures, and gitlink problems.
    • Added a distinct warning for path specifications located outside the repository.
    • Preserved the existing unmerged-index warning code.
  • Bug Fixes

    • Structural JSON output now reports specific resolution warning codes instead of the generic UNKNOWN code when applicable.

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 1dba810f-e50a-421e-b164-6fb1f4b38d56

📥 Commits

Reviewing files that changed from the base of the PR and between e88a9b8 and 6d2aa17.

📒 Files selected for processing (3)
  • diffgraph/schema/diffgraph-v2.schema.json
  • diffgraph/structural.py
  • tests/test_structural.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The change adds recognized Git snapshot-resolution warning codes to the DiffGraph schema and structural warning handling. Structural JSON now preserves codes such as invalid_base_ref and pathspec_outside_repository instead of converting them to UNKNOWN. Tests cover both cases.

Changes

Resolution warning codes

Layer / File(s) Summary
Warning code contract
diffgraph/schema/diffgraph-v2.schema.json, diffgraph/structural.py
The schema and public RESOLUTION_WARNING_CODES set include the expanded resolution warning code list.
Warning propagation and coverage
diffgraph/structural.py, tests/test_structural.py
_resolution_warning preserves recognized codes. Tests validate invalid_base_ref and pathspec_outside_repository output.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 6d2aa

Structural JSON now retains supported Git resolution warning codes for consumers, with coverage for invalid base references and pathspecs outside the repository. No concrete current-head merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: preserving actionable Git resolver warning codes in the contract.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nia/issue-21-resolver-warning-contract

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nia-sg-bot nia-sg-bot added roadmap Tracked on the public WildestAI roadmap priority:P0 Critical path / blocks a usable product direction:aligned Aligned with the current WildestAI product direction labels Sep 5, 2026
@nia-sg-bot

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nia-sg-bot
nia-sg-bot merged commit a779095 into main Sep 5, 2026
4 checks passed
@nia-sg-bot
nia-sg-bot deleted the nia/issue-21-resolver-warning-contract branch September 5, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

direction:aligned Aligned with the current WildestAI product direction priority:P0 Critical path / blocks a usable product roadmap Tracked on the public WildestAI roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant