Conversation
Replace pr.base.sha (GitHub API baseRefOid) with HEAD^1 in the eval-pr-run workflow's skill discovery step. baseRefOid returns the commit where the PR branch forked from main, not the current main tip. When commits land on main after the fork (e.g. baseline commits), the three-dot diff includes those changes and falsely detects all skills as changed. HEAD^1 on the refs/pull/N/merge checkout is the main branch tip GitHub used to build the merge ref, producing a diff of only the PR's actual changes. Implements TC-5102 Assisted-by: Claude Code
Reviewer's GuideThis PR changes the eval-pr-run workflow to base skill discovery diffs on the merge commit’s first parent (HEAD^1) instead of the PR’s base SHA from GitHub, and adds a reproducer shell test that simulates the refs/pull/N/merge topology to verify correct skill detection. Sequence diagram for updated skill discovery diff base in eval-pr-run workflowsequenceDiagram
actor GithubActions
participant PRIdentityStep
participant SkillDiscoveryStep
participant Git
GithubActions->>PRIdentityStep: actions/github-script
PRIdentityStep->>GithubActions: setOutput pr_number
PRIdentityStep->>GithubActions: setOutput author
GithubActions->>SkillDiscoveryStep: run Discover changed skills
SkillDiscoveryStep->>Git: git rev-parse HEAD^1
Git-->>SkillDiscoveryStep: BASE_SHA
SkillDiscoveryStep->>Git: git diff --name-only BASE_SHA...HEAD
Git-->>SkillDiscoveryStep: changed_files
SkillDiscoveryStep->>GithubActions: echo changed_files and detect skills
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Using
BASE_SHA=$(git rev-parse HEAD^1)assumes the workflow always runs on a merge commit; consider falling back to the previous behavior or a more defensive strategy (e.g., detect whenHEADis not a merge commit and choose an appropriate base) to avoid failures or incorrect diffs in other trigger contexts. - The skill discovery logic is now duplicated between the GitHub workflow and
tests/test-skill-discovery.sh; consider extracting this logic into a shared script that both the workflow and the test invoke to reduce drift and keep future changes centralized.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Using `BASE_SHA=$(git rev-parse HEAD^1)` assumes the workflow always runs on a merge commit; consider falling back to the previous behavior or a more defensive strategy (e.g., detect when `HEAD` is not a merge commit and choose an appropriate base) to avoid failures or incorrect diffs in other trigger contexts.
- The skill discovery logic is now duplicated between the GitHub workflow and `tests/test-skill-discovery.sh`; consider extracting this logic into a shared script that both the workflow and the test invoke to reduce drift and keep future changes centralized.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[sdlc-workflow/verify-pr] Re: @sourcery-ai[bot] review — Classified as suggestion (2 items):
|
Verification Report for TC-5102 (commit 290ea54)
Overall: PASSAll acceptance criteria are satisfied. The workflow fix correctly replaces the stale This comment was AI-generated by sdlc-workflow/verify-pr v0.12.2. |
Summary
pr.base.sha(GitHub APIbaseRefOid) withHEAD^1in the eval-pr-run workflow's skill discovery stepbase_shaoutput from the PR identity stepBug
Fixes TC-5101 — when baseline commits landed on main after the PR branch forked, the three-dot diff included those files and falsely detected all 8 skills as changed.
Implements TC-5102
Test plan
tests/test-skill-discovery.sh) passes — verifies old approach over-detects and new approach detects only PR-changed skillsSummary by Sourcery
Adjust eval PR workflow skill discovery to diff against the merge commit’s first parent and add coverage for the refs/pull/N/merge topology.
Bug Fixes:
Tests: