Skip to content

fix(action): doctor preflight needs the same base fallback as the review step - #93

Merged
pdogra1299 merged 1 commit into
mainfrom
fix/action-doctor-base
Aug 30, 2026
Merged

fix(action): doctor preflight needs the same base fallback as the review step#93
pdogra1299 merged 1 commit into
mainfrom
fix/action-doctor-base

Conversation

@pdogra1299

Copy link
Copy Markdown
Collaborator

Found live by the action's first external consumer (juspay/neurolink#1514): the doctor step passes --pr but never --base, so doctor resolves the base from the remote's default branch. On a repository whose pull requests target release and which has no main/master, nothing resolves and every preflight dies with "BROKEN base ref — no base ref resolves" before the review can start.

The fix mirrors the review step's own fallback exactly: inputs.base, else origin/$GITHUB_BASE_REF (runner-provided, single argv entry). Merging releases v5.0.1; the consumer then bumps its pin.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 263d33d8-01b7-45ba-97b4-b3c2e707a512


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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Single Commit Policy - COMPLIANT

Status: Policy requirements met • 1 commit • Valid format • Ready for merge

📊 View validation details

📝 Commit Details

  • Hash: f733190e183bc0bb4202b1dca1c6d3d74d36ec01
  • Message: fix(action): doctor preflight needs the same base fallback as the review step
  • Author: Parth Dogra

✅ Validation Results

  • Single commit requirement met
  • No merge commits in branch
  • Semantic commit message format verified
  • Ready for squash merge to main branch

🤖 Automated validation by Yama Single Commit Enforcement

@github-actions

Copy link
Copy Markdown
Contributor

🤖 AI Review & Build Compliance ✅

Status: AI analysis complete • Build rules validated • Ready for review

📊 View detailed analysis results

🛡️ Analysis Complete

  • ✅ Security scan (vulnerabilities, API keys)
  • ✅ TypeScript safety & code quality
  • ✅ Error handling & best practices
  • ✅ Build rule enforcement validated
  • ✅ Commit format & compliance checks

📋 Ready for Merge When

  • All CI checks passing
  • Manual review approved
  • Any AI-flagged issues resolved

🤖 AI analysis complete - check individual code comments for specific feedback

@Tara-ag

Tara-ag commented Aug 30, 2026

Copy link
Copy Markdown

Yama review

Reviewed the change: action.yml's 'Verify the setup' (doctor) step now gains a base override mirroring the Review step — --base "$YAMA_INPUT_BASE" if set, else --base "origin/${GITHUB_BASE_REF}" when GITHUB_BASE_REF is set — so that preflight on a non-main/master repo no longer dies on 'no base ref resolves'. I verified first-hand that the doctor CLI declares --base (src/cli/index.ts, .strict() is safe because base is a declared option), that doctor.ts's gitChecks/checkChecks still resolve target.base ?? gitDefaultBranch, and that gitDefaultBranch (src/tools/git.ts) resolves the default branch from a main/master-only candidate list that returns undefined for a release/develop mainline. The change is strictly additive: no previously-working repo regresses, and the base reaches the doctor command as a single argv entry (no shell interpolation), so no new injection surface. Two INFO findings survive: the pre-existing narrow-candidate default-branch resolution that the action-level fix only sidesteps for the PR/action path (still live for local, branch, and non-PR-shell invocations), and the absence of direct test coverage for the action-shell base fallback. No weakening of any guarantee in the hot paths; this is a small, correct, well-mirrored hardening of the doctor preflight.

Verdict: APPROVE

  • 1 INFO, none at a severity the policy acts on
  • 1 ungrounded finding(s) dropped: git-defaultbranch-narrow-candidates (cites "src/tools/git.ts", which this change does not touch)

Findings (1), most serious first:

  • INFO action.yml:257 — The new base fallback in doctor's 'Verify the setup' step is confined to action.yml composite-action shell and is not exercised by any automated suite.

1 further finding(s) were not commented on inline: action-doctor-base-no-suite.

yama:run:run-2026-08-30T15-39-17-943Z

@Tara-ag Tara-ag 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.

1 INFO, none at a severity the policy acts on; 1 ungrounded finding(s) dropped: git-defaultbranch-narrow-candidates (cites "src/tools/git.ts", which this change does not touch)

@Tara-ag

Tara-ag commented Aug 30, 2026

Copy link
Copy Markdown

Yama review

Reviewed the change: action.yml's 'Verify the setup' (doctor) step now gains a base override mirroring the Review step — --base "$YAMA_INPUT_BASE" if set, else --base "origin/${GITHUB_BASE_REF}" when GITHUB_BASE_REF is set — so that preflight on a non-main/master repo no longer dies on 'no base ref resolves'. I verified first-hand that the doctor CLI declares --base (src/cli/index.ts, .strict() is safe because base is a declared option), that doctor.ts's gitChecks/checkChecks still resolve target.base ?? gitDefaultBranch, and that gitDefaultBranch (src/tools/git.ts) resolves the default branch from a main/master-only candidate list that returns undefined for a release/develop mainline. The change is strictly additive: no previously-working repo regresses, and the base reaches the doctor command as a single argv entry (no shell interpolation), so no new injection surface. Two INFO findings survive: the pre-existing narrow-candidate default-branch resolution that the action-level fix only sidesteps for the PR/action path (still live for local, branch, and non-PR-shell invocations), and the absence of direct test coverage for the action-shell base fallback. No weakening of any guarantee in the hot paths; this is a small, correct, well-mirrored hardening of the doctor preflight.

Verdict: APPROVE

  • 1 INFO, none at a severity the policy acts on
  • 1 ungrounded finding(s) dropped: git-defaultbranch-narrow-candidates (cites "src/tools/git.ts", which this change does not touch)

Findings (1), most serious first:

  • INFO action.yml:257 — The new base fallback in doctor's 'Verify the setup' step is confined to action.yml composite-action shell and is not exercised by any automated suite.

1 further finding(s) were not commented on inline: action-doctor-base-no-suite.

yama:run:run-2026-08-30T15-39-17-943Z

@Tara-ag Tara-ag 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.

APPROVE: 1 INFO, none at a severity the policy acts on; 1 ungrounded finding(s) dropped: git-defaultbranch-narrow-candidates (cites "src/tools/git.ts", which this change does not touch).

@pdogra1299
pdogra1299 merged commit f4a5dcf into main Aug 30, 2026
15 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 5.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants