Add a release/build identifier to the application

オープン
#2,183 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
github-actions, rails, ruby
領域
backend, devops

調査の方向性

Start by tracing the project's CI/CD workflows and deployment configuration to see how build metadata reaches Rails, then check the app's boot configuration and existing tests. Choose and document an identifier strategy, wire it through every deployment target, and add generation, validation, and accessor coverage. Done means each deploy has a distinct identifier available through one documented Rails accessor, with missing or malformed metadata failing loudly.

索引モデルが issue の本文から書いたものです。

説明

Summary

The application has no injected identifier for "which build/deploy is currently running." Add one, generated during CI/CD and made available to the running app, so that deployed code can reliably distinguish one release from another.

Why this is needed

A release/build identifier is broadly useful operational metadata — it lets logs, error reports, and support investigations pin down exactly which deploy produced a given request, independent of whatever else changes it over time.

It also came up as a discussion point in PR #2165 (widget output caching, #2157): that PR's cache key currently includes a digest computed by hashing application source files to detect that a new deploy has occurred. In review we discussed whether a release/build identifier could serve that same deploy-detection purpose more simply than a hand-maintained file digest. That follow-up is tracked separately (see Related, below) and depends on this ticket landing first — it is not in scope here.

What needs to happen
  1. Choose a generation strategy. Likely candidates: CI commit SHA, CI build/run number, a generated timestamp/UUID, or some combination — generated once per deploy, not computed at runtime by the app.
  2. Decide how it's made available to the running app. Options include a file packaged with the deployment artifact, an environment variable injected at deploy time, or a generated Ruby constant/config value written during the build step. Pick based on what's practical for this project's deploy pipeline.
  3. Wire it into CI/CD so every deploy (to every target environment) gets a correctly generated, unique identifier, and redeploying the same commit with changed configuration still produces a new identifier (don't key solely on commit SHA if config-only redeploys need distinguishing).
  4. Expose it to Rails code through a single, well-known accessor (e.g., Rails.application.config.x.release_id), read once at boot rather than re-read per request.
  5. Fail safely if the identifier is missing or malformed in deployed environments — don't silently fall back to a placeholder like "unknown" that would mask a broken pipeline.
  6. Document where the identifier comes from, its format, and how to read it, for future consumers.
  7. Add tests covering generation (CI and any manual/local path), validation/format checking, and the Rails-side accessor.
Acceptance criteria
  • Every deploy to every environment produces a distinct, retrievable release/build identifier.
  • The identifier is accessible from Rails application code through one documented accessor.
  • Missing or malformed identifier metadata fails loudly in deployed environments rather than silently degrading.
  • Documented and tested per items 6–7 above.
Out of scope
  • Replacing FormCache's source digest with this identifier (tracked separately, see Related).
  • Any change to cache invalidation behavior.
Related
  • PR #2165 (review thread where a release/build identifier was discussed as an alternative to the widget cache's source digest)
  • Follow-up ticket: Replace widget cache source digest with a release/build identifier (depends on this ticket)
  • #2157 (original caching issue)
主要言語
JavaScript
スター
73
フォーク
38
平均マージ
14時間 53分
マージ済み PR(30日)
12

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

GSA/touchpoints のほかの issue

GSA/touchpoints の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。