Skip to content

Fix webhook 404s and changelog check crashes - #118

Merged
TylerZeroMaster merged 4 commits into
mainfrom
fix-webhook-path-and-changelog-bugs
Aug 4, 2026
Merged

TylerZeroMaster merged 4 commits into
mainfrom
fix-webhook-path-and-changelog-bugs

Conversation

@TylerZeroMaster

Copy link
Copy Markdown
Contributor

Summary

staxly hadn't been redeployed to Heroku in ~2 years. This PR's first two commits (already on this branch) fixed the deploy-blocking issue; this commit fixes what that unmasked:

  • WEBHOOK_PATH: Probot 13 changed its default webhook listen path from / to /api/github/webhooks. GitHub's webhook URL for this app is still configured for /, so every webhook POST 404'd after the upgrade. Added WEBHOOK_PATH=/ to app.json (both as a live fix and so future deploys/Review Apps don't regress).
  • context.config() instead of probot-config: the abandoned probot-config dependency called context.github.repos.getContents(...), but context.github was renamed to context.octokit back in 2021. Replaced with Probot's built-in context.config() and dropped the dependency.
  • context.pullRequest() instead of context.issue(): changedFiles was building pulls.listFiles params from context.issue() (issue_number), but that endpoint needs pull_number. Verified the fix produces the correct request URL.
  • createCommitStatus instead of createStatus: repos.createStatus was renamed in current Octokit.
  • robot.log.info(...) instead of robot.log(...): pino loggers aren't callable directly — this call has apparently never succeeded.

None of the last four bugs were introduced by this PR — they'd all been present since 2021, each one masking the next, invisible because changelog.js has never had any test coverage (/* istanbul ignore file */, no test file). This PR adds test/changelog.test.js to close that gap.

Heads up

staxly's own .github/config.yml requires a README.md update for any PR touching src/ (via this same changelog check) — a convention that hasn't actually been followed since 2023. So this PR will likely show changelog: pending on itself once the check is live again. That's expected and non-blocking (it's an informational status, not a required check) — decided not to address it in this PR; tracking it in a follow-up issue instead.

Test plan

  • yarn jest --coverage — all suites pass
  • standard --fix — clean
  • Deploy and confirm webhooks land at / with no more 404s in Heroku logs
  • Confirm a real pull_request event produces a changelog status instead of an error in the logs

🤖 Generated with Claude Code

TylerZeroMaster and others added 3 commits July 27, 2026 11:07
Set the path the app listens on
changedFiles used context.issue() (issue_number) instead of
context.pullRequest() (pull_number), so pulls.listFiles never had a
valid pull_number. setStatus called the now-renamed
repos.createStatus (createCommitStatus). The internal log() helper
called robot.log directly, but pino loggers require a level method
(robot.log.info). All three were unreachable until the prior commit
fixed the context.config() crash that always ran first, so none of
this had ever executed successfully. Adds test/changelog.test.js
since this file had zero coverage.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@philschatz
philschatz temporarily deployed to staxly-pipel-fix-webhoo-d4fora July 27, 2026 17:12 Inactive
@TylerZeroMaster
TylerZeroMaster requested a review from Copilot July 28, 2026 15:06

Copilot AI 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.

Pull request overview

This PR restores correct operation of the Probot-based webhook app after a long gap in deployments by fixing webhook routing/config loading and updating the changelog status check to use current Probot/Octokit APIs, plus adding a new Jest test to cover the changelog check behavior.

Changes:

  • Add WEBHOOK_PATH=/ to prevent webhook 404s after Probot’s default webhook path change.
  • Replace probot-config usage with Probot’s built-in context.config() and update Octokit method usage (createCommitStatus, context.pullRequest()).
  • Add a Jest test (test/changelog.test.js) to exercise the changelog status logic and prevent regressions.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app.json Adds WEBHOOK_PATH env var default to keep GitHub App webhook URL compatible.
package.json Removes probot-config dependency now that context.config() is used.
yarn.lock Drops transitive dependencies that were only required by probot-config.
src/changelog.js Updates config loading, PR file listing, commit status API call, and logger invocation for current Probot/Octokit.
test/changelog.test.js Adds coverage for changelog status behavior on pull_request events using nock.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/changelog.js
Comment thread src/changelog.js Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@TylerZeroMaster
TylerZeroMaster merged commit bb010a2 into main Aug 4, 2026
1 check passed
@TylerZeroMaster
TylerZeroMaster deleted the fix-webhook-path-and-changelog-bugs branch August 4, 2026 19:10
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.

4 participants