-
Notifications
You must be signed in to change notification settings - Fork 1
Centralize repository context resolution for repo and pull request workflows #35
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Follow-up to #2.
Summary
Move Git-derived repository context logic into a deeper shared module so repo and PR workflows rely on one consistent source of truth.
Problem
Repository inference and branch validation logic is currently split between the repository-context module and PR-specific code. That duplication makes behavior harder to reason about and increases the chance of drift.
Scope
- Extend the repository-context layer to cover current branch resolution.
- Extend the repository-context layer to cover origin remote parsing.
- Extend the repository-context layer to cover upstream tracking validation.
- Extend the repository-context layer to cover origin-only branch checks used by PR creation.
- Refactor repo and PR workflows to use the centralized context APIs.
Non-goals
- Do not add support for complex cross-fork or multi-remote PR creation workflows.
- Do not change the public command surface.
- Do not change JSON output contracts.
Acceptance Criteria
repo viewlocal-context behavior uses the centralized repository-context module.pr createlocal head resolution and origin/upstream validation use the centralized repository-context module.- Shared Git error paths remain stable and test-backed.
- Repository-context tests cover HTTPS origin URLs.
- Repository-context tests cover SSH origin URLs.
- Repository-context tests cover missing origin remotes.
- Repository-context tests cover detached HEAD state.
- Repository-context tests cover branches not pushed to origin.
- Repository-context tests cover branches tracking a non-origin remote.
- The PR-specific duplicated Git inspection logic is removed or reduced to thin orchestration.
Notes
This issue is about architectural consolidation, not expanding workflow scope.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request