Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue #3003] Add deployment info #3072

Merged
merged 3 commits into from
Dec 3, 2024
Merged

[Issue #3003] Add deployment info #3072

merged 3 commits into from
Dec 3, 2024

Conversation

coilysiren
Copy link
Collaborator

@coilysiren coilysiren commented Dec 2, 2024

Summary

Relates #3003

Time to review: 5 mins

Changes proposed

Adds the following environment variables to API deployments:

  • DEPLOY_GITHUB_REF
  • DEPLOY_GITHUB_SHA
  • DEPLOY_TIMESTAMP

You can find the definitions for these values here: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables

Testing

https://us-east-1.console.aws.amazon.com/ecs/v2/task-definitions/api-dev/288/json?region=us-east-1

image image image

^ note that terraform doesn't provide a UNIX timestamp, which I'm a bit bummed about. But maybe we only put the timestamp into the healthcheck, and keep it as is?

@coilysiren coilysiren marked this pull request as ready for review December 3, 2024 15:16
run: make release-deploy \
APP_NAME=${{ inputs.app_name }} \
ENVIRONMENT=${{ inputs.environment }} \
DEPLOY_GITHUB_REF=${{ github.ref_name }} \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the ref always the branch name, or does it become the release?

Just thinking about how we build the URLs in the API with this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will there be a consistent URL I can build if it can refer to both a branch and a release? Any pattern of github.com/something/<branch or release> that I can follow?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Err, I suppose the /tree path does, but for releases I wonder if linking to the release page would be better - could maybe regex that

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For both the ref and commit the URL is gonna be https://github.com/HHS/simpler-grants-gov/tree/< commit / branch / release >, examples:

Copy link
Collaborator

@chouinar chouinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@coilysiren coilysiren merged commit 0f8630b into main Dec 3, 2024
21 checks passed
@coilysiren coilysiren deleted the kai/deploy-info branch December 3, 2024 16:55
coilysiren added a commit that referenced this pull request Dec 9, 2024
## Summary

Relates to #3003, followup from
#3072

Completes 50% of #3149

### Time to review: __2 mins__

## Changes proposed

- adds DEPLOY_WHOAMI to the deploy metadata environment variables
- adds them to the module layer so they're present on every service we
deploy
- removes from the CLI inputs because they're being input by terraform
shell commands now (which is something I should have thought about
sooner!)

## Testing

From Github actions:

<img width="325" alt="image"
src="https://github.com/user-attachments/assets/a9417006-5a00-4aea-98e7-8885995ccb1d">

Locally:

<img width="313" alt="image"
src="https://github.com/user-attachments/assets/61972d42-eb2e-46ae-8857-acb9e5655782">
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.

2 participants