Skip to content

Pass commit hash as COMMIT_HASH to ECS task definition#103

Merged
hannahscovill merged 5 commits intomainfrom
feat/app-version-commit-hash
Feb 7, 2026
Merged

Pass commit hash as COMMIT_HASH to ECS task definition#103
hannahscovill merged 5 commits intomainfrom
feat/app-version-commit-hash

Conversation

@hannahscovill
Copy link
Owner

@hannahscovill hannahscovill commented Feb 7, 2026

Summary

  • Wire the 7-char short SHA (already computed for Docker image tagging) through CDK context (-c commitHash=...) into the COMMIT_HASH env var on the ECS task definition
  • Replace the hardcoded APP_VERSION: 'latest' with the dynamic commit hash so service.version in OTEL traces reflects the actual deployed commit
  • Update the local dev fallback from "dev" to "dev-0000000" — the 7 zeroes mirror the short SHA format, making it obvious in Grafana that a trace came from local

Test plan

  • cdk synth without -c commitHashCOMMIT_HASH: dev-0000000 (fallback)
  • cdk synth -c commitHash=abc1234COMMIT_HASH: abc1234 (CI path)
  • Deploy and verify service.version shows the commit hash in Grafana

🤖 Generated with Claude Code

@hannahscovill hannahscovill force-pushed the feat/app-version-commit-hash branch from 7ffe443 to d3c5d67 Compare February 7, 2026 21:13
Wire the 7-char git SHA through CDK context into the COMMIT_HASH env
var on the ECS task so service.version in traces shows the deployed
commit. Also clean up the deploy workflow:
- Remove redundant meta step (use get-outputs + GITHUB_SHA instead)
- Remove dead -c prerequisite=true flag
- Remove commented-out job scaffolding
- Remove orphaned ECR_REPOSITORY env var

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hannahscovill hannahscovill force-pushed the feat/app-version-commit-hash branch from d3c5d67 to 8e295b3 Compare February 7, 2026 21:23
hannahscovill and others added 4 commits February 7, 2026 13:36
Read COMMIT_HASH env var in GitHubIssueService and render it as
"- Commit: `abc1234`" in the Environment section of created issues.
This lets us correlate bug reports to the exact deployed version.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The issue route already requires authentication, so user ID is always
available from JWT claims. Make the type reflect that: &str instead of
Option<&str>. Reporter section now always renders with at least the
user ID.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add explicit guard for empty user ID in issue route handler. Update
OpenAPI schema with userAgent/pageUrl fields and reporter/commit hash
details in endpoint description. Update Bruno example request.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hannahscovill hannahscovill merged commit c91eb79 into main Feb 7, 2026
3 checks passed
@hannahscovill hannahscovill deleted the feat/app-version-commit-hash branch February 7, 2026 22:15
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