fix(notifications): read gh token param in PR notifier - #114
Merged
Merged
Conversation
The GitHub PR notifier resolved its credential from a `token` key, but the notifier parameter is declared as `github_token` in notifications.yaml, which is the key the notification manager resolves dashboard configuration and the GITHUB_TOKEN environment variable into. A token supplied through dashboard configuration was enough to enable the notifier but never reached the GitHub API call, so the run logged `no GitHub token available` and posted no comment. Runs configuring the token through the environment were unaffected, because the notifier fell back to reading GITHUB_TOKEN directly. `token` is still accepted so callers constructing the notifier directly keep working. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
Author
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1ec5579. Configure here.
Phil Gran (philgran)
approved these changes
Sep 15, 2026
lelia
added a commit
that referenced
this pull request
Sep 15, 2026
Release prep for 3.3.0, bundling #114 and #115. #115 adds the `--scan-all` / `--no-scan-all` CLI flags, so this is a minor bump rather than a patch. Bumps pyproject.toml, socket_basics/version.py, socket_basics/__init__.py, action.yml and uv.lock to 3.3.0, synchronizes 83 current-release references across README.md and docs/**, and stamps [Unreleased] as [3.3.0] - 2026-09-15. Also pins the Socket Python CLI to 2.9.0 in Dockerfile.heavy and app_tests/Dockerfile, ahead of that release publishing to PyPI.
lelia
added a commit
that referenced
this pull request
Sep 15, 2026
Release prep for 3.3.0, bundling #114 and #115. #115 adds the `--scan-all` / `--no-scan-all` CLI flags, so this is a minor bump rather than a patch. Bumps pyproject.toml, socket_basics/version.py, socket_basics/__init__.py, action.yml and uv.lock to 3.3.0, synchronizes 83 current-release references across README.md and docs/**, and stamps [Unreleased] as [3.3.0] - 2026-09-15. Also pins the Socket Python CLI to 2.9.0 in Dockerfile.heavy and app_tests/Dockerfile, ahead of that release publishing to PyPI.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The GitHub PR notifier resolved its credential from a
tokenkey:The notifier parameter is declared as
github_tokeninnotifications.yaml, and that is the key the notification manager resolves dashboard configuration and theGITHUB_TOKENenvironment variable into, soself.config.get('token')was alwaysNone.Effect
A token set through dashboard config enabled the notifier (
manager.pychecksapp_config.get('github_token')when deciding whether to load it) but the value never reached the GitHub API call. The notifier loaded, then returned at theif not self.tokenguard in_send_pr_comment, loggingno GitHub token availableand posting nothing.Runs that configure the token through the environment were unaffected, because the notifier fell back to reading
GITHUB_TOKENdirectly.Change
Look up
github_tokenfirst, thentoken, then the environment. Keepingtokenmeans callers that construct the notifier directly are unaffected.Precedence now matches the manager's documented parameter resolution (app_config over env var) and the pattern the other notifiers already follow —
SlackNotifierreadsslack_webhook_url, its own parameter name.Tests
tests/test_github_pr_notifier_params.py, mirroringtest_slack_notifier_params.py: direct construction and the manager flow, each covering params, environment fallback, and precedence, plus the legacytokenkey. Four of the eight fail without the change.Note
Medium Risk
Changes how the GitHub PR notifier resolves API credentials; behavior shifts for dashboard-configured tokens while env and legacy
tokenpaths stay supported and are covered by new tests.Overview
Fixes GitHub PR comments silently failing when the token is supplied through Socket dashboard /
app_configasgithub_token. The notifier now resolvesself.tokenfromgithub_tokenfirst, then the legacytokenkey, thenget_github_token()— matchingnotifications.yamland the same pattern asSlackNotifier.Dashboard-configured tokens previously enabled the notifier in
NotificationManagerbut never reached the API, so runs logged no GitHub token available and posted nothing;GITHUB_TOKEN-only setups were unaffected.Adds
tests/test_github_pr_notifier_params.py(direct construction and manager load: params, env fallback, precedence, legacy key) and an [Unreleased] Fixed entry inCHANGELOG.md.Reviewed by Cursor Bugbot for commit 1ec5579. Configure here.