Skip to content

action: infer compare base refs#1361

Merged
EffortlessSteven merged 2 commits into
mainfrom
action-base-inference
Apr 28, 2026
Merged

action: infer compare base refs#1361
EffortlessSteven merged 2 commits into
mainfrom
action-base-inference

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

  • infer cockpit/sensor base refs when base is omitted instead of defaulting to hardcoded main
  • use origin/$GITHUB_BASE_REF for pull request runs and origin/HEAD for other events, fetching refs when needed
  • fail clearly when no base can be resolved and keep explicit base values unchanged
  • document inferred base behavior and add Action self-tests for inferred cockpit/sensor runs plus unresolved-base rejection

Validation

  • cargo fmt-check
  • cargo xtask publish-surface --json
  • cargo xtask publish-surface --json --verify-publish
  • cargo xtask gate --check
  • cargo deny --all-features check (passes with existing duplicate/advisory warnings)
  • npm test --prefix web/runner (passes; existing real-wasm-bundle case remains skipped when bundle is absent)

Deferred follow-ups

  • browser-runner matrix consistency guard
  • browser-runner cache/progress/auth-fetch
  • queue cleanup pass

@coderabbitai

coderabbitai Bot commented Apr 28, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@EffortlessSteven has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 31 minutes and 35 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fcf400bc-4c8f-4ebc-8b1e-fa7d5316f48f

📥 Commits

Reviewing files that changed from the base of the PR and between 1c0f16d and 18eb576.

📒 Files selected for processing (3)
  • .github/workflows/test-action.yml
  • README.md
  • action.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch action-base-inference

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 and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

Glass Cockpit

Base: origin/main
Head: HEAD

Change Surface:

  • Files: 3
  • Insertions: 135
  • Deletions: 7

Composition:

  • Code: 0.0%
  • Test: 0.0%
  • Docs: 33.3%
  • Config: 66.7%

Contracts:

  • API: No
  • CLI: No
  • Schema: No

Health: 100/100 (A)
Risk: low (0/100)

Review Plan

  • .github/workflows/test-action.yml (priority: 2)
  • action.yml (priority: 2)
  • README.md (priority: 3)

Receipts

Full receipt data available in JSON format.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request implements automatic base git reference inference for the cockpit and sensor modes when the base input is omitted. It introduces a resolve_base_ref shell function that determines the appropriate reference using GITHUB_BASE_REF for pull requests or origin/HEAD for other events, including logic to fetch remote branches if they are missing. The review feedback suggests improving the debuggability of the action by allowing standard error output from git commands to be visible in the logs rather than suppressing it, which would help diagnose network or configuration issues.

Comment thread action.yml Outdated

fetch_origin_branch() {
local branch="$1"
git fetch --no-tags --depth=1 origin "${branch}:refs/remotes/origin/${branch}" >/dev/null 2>&1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Redirecting both stdout and stderr to /dev/null can make debugging difficult if the fetch fails due to authentication or network issues. While the subsequent error message at line 242 is helpful, allowing stderr to be visible here would provide more context for troubleshooting.

          git fetch --no-tags --depth=1 origin "${branch}:refs/remotes/origin/${branch}" >/dev/null

Comment thread action.yml Outdated
fi
else
if ! git symbolic-ref --quiet refs/remotes/origin/HEAD >/dev/null 2>&1; then
git remote set-head origin -a >/dev/null 2>&1 || true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Similar to the fetch command, suppressing stderr for git remote set-head hides potential configuration issues. Consider allowing stderr to flow through to the logs.

              git remote set-head origin -a >/dev/null || true

@EffortlessSteven EffortlessSteven merged commit a8473c4 into main Apr 28, 2026
26 checks passed
@EffortlessSteven EffortlessSteven deleted the action-base-inference branch April 28, 2026 12:28
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.

1 participant