Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Sentry Integration: Track staging commits

未关闭
#1,241 0 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@vprashrex 已经在做这个了。

开始于 2026年10月10日。

评估

这个 Issue 还没有评估数据。

描述

enhancement

Is your feature request related to a problem?
Staging deploys for every green main CI run do not correctly capture commit shas in Sentry releases. With multiple changes landing on staging, it is difficult to identify which merge introduced a staging issue.

Describe the solution you'd like
Implement the shared release-id code from the production issue:

  • Update docker-compose.staging.yml to pass RELEASE_TAG alongside GIT_SHA for backend services.
  • In deploy-staging.yml, set RELEASE_TAG=main and GIT_SHA=$DEPLOY_SHA in the docker compose build command.
  • Checkout the repo with fetch-depth: 0 after the SSM command succeeds.
  • Register the release and deploy using getsentry/action-release only if the SSM deploy is successful.
  • Reuse the SENTRY_AUTH_TOKEN secret and SENTRY_ORG variable; add SENTRY_STAGING_PROJECT as kaapi-staging.

Why is this enhancement needed?
This enhancement will ensure each staging deploy is associated with its specific commits, allowing quick identification of the source of staging issues before changes reach production.

Original issue

Describe the current behavior
Staging deploys on every green main CI run through .github/workflows/deploy-staging.yml (SSM → EC2 → docker compose -f docker-compose.staging.yml). The commit sha is already passed as the GIT_SHA build arg, but the Sentry release id ignores it, so every staging event in the kaapi-staging project reports the same release. Many changes land on staging between production releases, and there is no way to tell which merge introduced a staging issue.

Describe the enhancement you'd like
Depends on the shared release-id code from the production issue (kaapi-backend@<RELEASE_TAG or API_VERSION>+<git sha 12>).

  • docker-compose.staging.yml: pass RELEASE_TAG as a build arg next to GIT_SHA for every service that builds the backend image.
  • deploy-staging.yml:
    • set RELEASE_TAG=main alongside GIT_SHA=$DEPLOY_SHA in the docker compose build command
    • checkout the repo with fetch-depth: 0 in a step after the SSM command succeeds
    • register the release and deploy with getsentry/action-release (release: kaapi-backend@main+<DEPLOY_SHA 12>, environment: staging, set_commits: auto) only when the SSM deploy succeeded
  • GitHub setup: reuse the SENTRY_AUTH_TOKEN secret and SENTRY_ORG variable; add SENTRY_STAGING_PROJECT = kaapi-staging.

Why is this enhancement needed?
Each staging deploy becomes a Sentry release with its commits, so a new staging issue points at the merge that caused it before the change reaches production.

Additional context

  • Use DEPLOY_SHA (workflow_run.head_sha), not github.sha: this workflow is triggered by workflow_run, where github.sha is the default-branch head, not necessarily the deployed commit.
  • deploy-staging-ecs.yml (manual workflow_dispatch) is a second staging path; decide whether it stays and, if so, apply the same steps there.
  • Verify after the next main merge: Sentry → Releases in kaapi-staging shows kaapi-backend@main+<sha> under staging with commits attached.
主要语言
Python
星标
18
派生
11
平均合并
3 天 11 小时
30 天内合并 PR
8

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ProjectTech4DevAI/kaapi-backend 的其他 Issue

查看 ProjectTech4DevAI/kaapi-backend 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。