Skip to content

feat(sentry): Build release id from git - #1234

Closed
vprashrex wants to merge 5 commits into
feat/http-db-observability-metricsfrom
feat/sentry-release-tracking
Closed

vprashrex wants to merge 5 commits into
feat/http-db-observability-metricsfrom
feat/sentry-release-tracking

Conversation

@vprashrex

@vprashrex vprashrex commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

Closes #1155

Summary

  • Before: Release id came from the hand-maintained API_VERSION, leading to no commits or deploys being attached.
  • Now: Release id is built from Docker build args, and both deploy workflows register the release and deploy in Sentry after successful ECS rollout.
  • Required setup of runbook for manual procedure.
  • Establishment of a new workflow for Sentry integration that ensures commits are attached.

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

The Sentry step runs after the ECS rollout so a failed deploy never gets a deploy marker. fetch-depth: 0 on checkout is required for set_commits: auto.

Original PR description

Issue

Stacked on #1155. Merge that first; GitHub retargets this PR to main automatically.

Summary

Sentry has shown release 0.5.0 since April 2026 (0 commits, 0 deploys attached), because the release id came from the hand-maintained API_VERSION. Regressions, "resolved in release" and suspect commits never worked.

  • Release id is now built from the Docker build args: kaapi-backend@<tag>+<sha12> (v1.7.1 for production tags, main for staging). SENTRY_RELEASE still overrides.
  • Both deploy workflows resolve the same id, pass it as RELEASE_TAG, and register the release + deploy in Sentry with getsentry/action-release after the ECS rollout succeeds, with commits attached.
  • Runbook with the manual setup: docs/runbooks/sentry-release-tracking.md.

Checklist

  • Unit tests for resolve_sentry_release (tag + sha, sha only, unknown sha, override).
  • Before merge: create a Sentry org token (project:releases, org:read) and add SENTRY_AUTH_TOKEN secret plus SENTRY_ORG, SENTRY_PROJECT, SENTRY_STAGING_PROJECT variables. Without them the new workflow step fails the deploy job.

Notes

The Sentry step runs after the ECS rollout so a failed deploy never gets a deploy marker. fetch-depth: 0 on checkout is required for set_commits: auto.

Sentry has reported release 0.5.0 since April because the release id was
derived from the hand-maintained API_VERSION. Build it from the Docker
build args instead: kaapi-backend@<tag>+<sha12>, with RELEASE_TAG set to
the git tag (production) or main (staging).

Both deploy workflows now resolve the same id, pass it as a build arg, and
register the release and deploy in Sentry after the ECS rollout succeeds,
with commits attached (checkout fetch-depth 0). Requires the
SENTRY_AUTH_TOKEN secret and SENTRY_ORG / SENTRY_PROJECT /
SENTRY_STAGING_PROJECT variables; setup is in
docs/runbooks/sentry-release-tracking.md.
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ready-for-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: ProjectTech4DevAI/kaapi-backend/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c8175a5f-cc87-43eb-82fc-3ca673ea78f5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot changed the title feat(sentry): Build release id from git sha and register deploys feat(sentry): Build release id from git Oct 6, 2026
@vprashrex
vprashrex marked this pull request as draft October 6, 2026 08:29
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.

1 participant