Skip to content

Expose deployed commit sha at /info/release - #995

Merged
zetter-rpf merged 1 commit into
mainfrom
release-info
Sep 2, 2026
Merged

Expose deployed commit sha at /info/release#995
zetter-rpf merged 1 commit into
mainfrom
release-info

Conversation

@zetter-rpf

@zetter-rpf zetter-rpf commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What's changed?

This adds an info/release route that shows the current git sha for the release.

I intend to use this from the editor dashboard to show what apps need deploying.

After deploy:

  • exclude '/info/release' from cloudflare access in staging/test

Previously the only way to find out which commit an environment
was running was the Heroku platform API, which needs credentials
broad enough to change the app. GitHub has some deployment
information, but only for staging as production releases are
promoted.

This change adds a public InfoController with a /info/release route
that renders HEROKU_SLUG_COMMIT as plain text, falling back to
"unknown" when the variable is unset. The editor dashboard will
read it to show the currently deployed version of the API. The
same variable already tags log lines in config/application.rb, so
no new configuration is introduced.

The endpoint is unauthenticated and inherits from
ActionController::API so it does not require a session; the commit
sha is already public in the open source repository.
@cla-bot cla-bot Bot added the cla-signed label Sep 2, 2026
@zetter-rpf
zetter-rpf marked this pull request as ready for review September 2, 2026 12:54
Copilot AI lite review requested due to automatic review settings September 2, 2026 12:54

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.

🟡 Changes recommended

The endpoint should handle blank HEROKU_SLUG_COMMIT values (and related regression coverage), and the access-control expectations for a new public route need to be clarified.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds a lightweight “release info” endpoint to the Rails monolith so external tooling (e.g., the editor dashboard) can read which commit SHA is currently deployed.

Changes:

  • Adds GET /info/release route.
  • Introduces InfoController#release to return the deployed commit SHA as plain text (or unknown).
  • Adds request specs covering the env-var-present and env-var-missing cases.
File summaries
File Description
spec/requests/info_controller_spec.rb Adds request coverage for the new /info/release endpoint response body.
config/routes.rb Wires up the new GET /info/release route.
app/controllers/info_controller.rb Implements the endpoint that returns the deployed SHA as plain text.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread app/controllers/info_controller.rb
Comment thread config/routes.rb
Comment thread spec/requests/info_controller_spec.rb
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Test coverage

93.51% line coverage reported by SimpleCov.
Run: https://github.com/RaspberryPiFoundation/editor-api/actions/runs/33632598495

@raspberrypiherokubot
raspberrypiherokubot temporarily deployed to editor-api-p-release-in-0v0iw1 September 2, 2026 12:59 Inactive
@zetter-rpf
zetter-rpf merged commit e4f0838 into main Sep 2, 2026
9 checks passed
@zetter-rpf
zetter-rpf deleted the release-info branch September 2, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants