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

Set the dependabot_updater_version docker env from the build arg #9116

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

Nishnha
Copy link
Member

@Nishnha Nishnha commented Feb 23, 2024

Fixes #8885 (comment) where our sentry releases are still reporting the default value of "development" instead of the build SHA.

We were passing in the DEPENDABOT_UPDATER_VERSION env as a build arg but referencing it as an ENV in docker https://docs.docker.com/reference/cli/docker/container/run/#env

Docker buildx doesn't support the --env flag, but we can still pass the variable in as a build arg and then use it to set a docker environment variable

Fixes #8885 (comment) where our sentry releases are still reporting the default value of "development" instead of the build SHA.

We were passing in the DEPENDABOT_UPDATER_VERSION env as a build arg but referencing it as an ENV in docker. Let's update these to match https://docs.docker.com/reference/cli/docker/container/run/#env
@Nishnha Nishnha requested a review from a team as a code owner February 23, 2024 16:09
@jurre
Copy link
Member

jurre commented Feb 23, 2024

How can we verify that this change resolves the issue @Nishnha ?

@Nishnha
Copy link
Member Author

Nishnha commented Feb 23, 2024

How can we verify that this change resolves the issue @Nishnha ?

We should be able to check what the value of $DEPENDABOT_UPDATER_IMAGE is on an image build from this branch.
We should also start seeing the correct release values in sentry

I also realized that docker buildx doesn't support the --env flag, but we can still pass the variable in as a build arg and then use it to set a docker environment variable
https://docs.docker.com/reference/cli/docker/buildx/build/

I'll update this PR to do that.

@Nishnha Nishnha changed the title Pass in dependabot_updater_version as env Set the dependabot_updater_version docker env from the build arg Feb 23, 2024
@Nishnha
Copy link
Member Author

Nishnha commented Feb 23, 2024

This looks right!

I pulled the build image and ran docker inspect on it

$ docker pull ghcr.io/dependabot/dependabot-updater-bundler:44819e7652f0f213e0129c25509a6bfeb1dc5e53
$ docker images

REPOSITORY                                                               TAG                                        IMAGE ID       CREATED          SIZE
ghcr.io/dependabot/dependabot-updater-bundler                            44819e7652f0f213e0129c25509a6bfeb1dc5e53   ef0479026bcd   17 minutes ago   724MB

$ docker inspect ef0479026bcd 

"Env": [
  "PATH=/home/dependabot/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
  "DEBIAN_FRONTEND=noninteractive",
  "LC_ALL=en_US.UTF-8",
  "LANG=en_US.UTF-8",
  "DEPENDABOT_HOME=/home/dependabot",
  "DEPENDABOT=true",
  "GIT_LFS_SKIP_SMUDGE=1",
  "DEPENDABOT_NATIVE_HELPERS_PATH=/opt",
  "DEPENDABOT_UPDATER_VERSION=44819e7652f0f213e0129c25509a6bfeb1dc5e53"
],

@Nishnha Nishnha merged commit 690b555 into main Feb 23, 2024
123 checks passed
@Nishnha Nishnha deleted the nishnha/sentry-release-docker-env branch February 23, 2024 16:50
@Nishnha
Copy link
Member Author

Nishnha commented Feb 23, 2024

That worked!
Screenshot 2024-02-23 at 1 08 49 PM

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.

3 participants