Skip to content

Git co-author trailer uses raw Slack user ID instead of resolved identity #522

@sentry-junior

Description

@sentry-junior

The prepare-commit-msg hook in packages/junior-github/index.js injects a Co-authored-by trailer using JUNIOR_GIT_COAUTHOR_NAME and JUNIOR_GIT_COAUTHOR_EMAIL. When the runtime context's requester identity is not resolved before sandbox env injection, the trailer is written with the raw Slack user ID and a noreply placeholder, which GitHub cannot link to any account.

Root cause (high confidence): The runtime populates the <requester> context block with full_name, user_name, and user_id all set to the raw Slack user ID (e.g. U039RR91S). requesterName() falls back through fullName → userName → userId, so it always resolves to the user ID string. requesterEmail() returns "noreply" when no email field is present. The resulting env vars are:

JUNIOR_GIT_COAUTHOR_NAME=U039RR91S
JUNIOR_GIT_COAUTHOR_EMAIL=noreply

Evidence

  • Commit messages from sandbox-authored PRs contain Co-authored-by: U039RR91S <noreply> — verified in getsentry/junior#520 and getsentry/junior-prod#137.
  • Hook source: packages/junior-github/index.jsprepareCommitMsgHook(), requesterName(), requesterEmail().
  • Runtime context shape confirmed: all three identity fields contained the raw Slack user ID at request time.

Fix direction: Resolve the Slack user profile (name + email) before the sandboxPrepare hook runs and injects the coauthor env vars. The slackUserLookup tool (or equivalent internal call) can resolve a user ID to a display name and email; that resolved identity should be what the runtime writes into JUNIOR_GIT_COAUTHOR_NAME/JUNIOR_GIT_COAUTHOR_EMAIL.

Action taken on behalf of David Cramer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions