Skip to content

fix(junior-github): validate bot identity env vars in beforeToolExecute - #1566

Merged
dcramer merged 1 commit into
getsentry:mainfrom
snowyukitty:fix/junior-github-require-bot-identity
Aug 14, 2026
Merged

dcramer merged 1 commit into
getsentry:mainfrom
snowyukitty:fix/junior-github-require-bot-identity

Conversation

@snowyukitty

Copy link
Copy Markdown

Description

Fixes #1546.

When GITHUB_APP_BOT_NAME or GITHUB_APP_BOT_EMAIL was unset, beforeToolExecute in @sentry/junior-github silently returned early, leaving Git committer and author environment variables unpopulated. Downstream git commits then failed cryptically inside the prepare-commit-msg git hook with an internal configuration error.

Changes

  1. In packages/junior-github/src/plugin.ts (beforeToolExecute):
    • Replaces readEnv with requireEnv for botNameEnv and botEmailEnv.
    • Missing configuration now immediately surfaces an actionable GitHubPluginSetupError("Missing GITHUB_APP_BOT_NAME") early before any broken tool execution.
  2. In packages/junior-github/tests/github-plugin.test.ts:
    • Added unit test asserting GitHubPluginSetupError is thrown when bot identity environment variables are missing.

Testing

  • Unit tests in packages/junior-github/tests/github-plugin.test.ts pass cleanly.

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

@myukitty is attempting to deploy a commit to the Sentry Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the risk: low PR risk score: low label Aug 14, 2026

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. This uses the existing setup-error boundary, removes the silent failure, and keeps the fix local without adding new configuration or abstraction.

@dcramer

dcramer commented Aug 14, 2026

Copy link
Copy Markdown
Member

thanks!

@dcramer
dcramer merged commit 8f1588b into getsentry:main Aug 14, 2026
31 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

junior-github: missing bot identity env vars silently break every commit

3 participants