From 73ae737c07521a5a70cf740250bf02e48949801d Mon Sep 17 00:00:00 2001 From: Adrian Rollett Date: Wed, 17 Apr 2024 17:32:16 +0000 Subject: [PATCH 1/4] Add datadog version config --- config/initializers/datadog.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/initializers/datadog.rb b/config/initializers/datadog.rb index eff1a3f3e9a..ac872962273 100644 --- a/config/initializers/datadog.rb +++ b/config/initializers/datadog.rb @@ -9,6 +9,7 @@ # Namespace our app c.service = 'vets-api' c.env = Settings.vsp_environment unless ENV['DD_ENV'] + c.version = AppInfo::GIT_REVISION unless ENV['DD_VERSION'] # Enable instruments c.tracing.instrument :rails From 3ded666af3ccb55ba58f9f483b3fd409123f9744 Mon Sep 17 00:00:00 2001 From: Adrian Rollett Date: Wed, 17 Apr 2024 17:32:44 +0000 Subject: [PATCH 2/4] Update datadog version tag in manifest on deploy --- .github/workflows/deploy-template.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index afab260a534..0c7d1f3ae4c 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -71,7 +71,7 @@ jobs: fetch-depth: 1 path: vsp-infra-application-manifests - - name: Update vets-api image name in Manifest repo for parent helm + - name: Update vets-api image and version name in Manifest repo for parent helm env: ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} ECR_REPOSITORY: dsva/${{inputs.ecr_repository}} @@ -81,6 +81,9 @@ jobs: for env in ${envs[*]}; do yq e -i '(.vets-api.image.tag) |= "${{ github.sha }}"' $env/values.yaml + yq e -i '(."vets-api".web.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ github.sha }}"' $env/values.yaml + yq e -i '(."vets-api".web.dbMigrate.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ github.sha }}"' $env/values.yaml + yq e -i '(."vets-api".worker.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ github.sha }}"' $env/values.yaml done git diff From 5069b84bc6281c8a2d1bf80226bb535551bc688c Mon Sep 17 00:00:00 2001 From: Adrian Rollett Date: Thu, 18 Apr 2024 21:18:54 +0000 Subject: [PATCH 3/4] Remove datadog initializer change from k8s branch --- config/initializers/datadog.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/config/initializers/datadog.rb b/config/initializers/datadog.rb index ac872962273..eff1a3f3e9a 100644 --- a/config/initializers/datadog.rb +++ b/config/initializers/datadog.rb @@ -9,7 +9,6 @@ # Namespace our app c.service = 'vets-api' c.env = Settings.vsp_environment unless ENV['DD_ENV'] - c.version = AppInfo::GIT_REVISION unless ENV['DD_VERSION'] # Enable instruments c.tracing.instrument :rails From b3b887a77c6d1b7f1b3821bd08f2524d72e05a21 Mon Sep 17 00:00:00 2001 From: Adrian Rollett Date: Thu, 18 Apr 2024 21:28:27 +0000 Subject: [PATCH 4/4] Update values editing for consistency --- .github/workflows/deploy-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-template.yml b/.github/workflows/deploy-template.yml index 0c7d1f3ae4c..8764f7852d0 100644 --- a/.github/workflows/deploy-template.yml +++ b/.github/workflows/deploy-template.yml @@ -80,7 +80,7 @@ jobs: envs=( ${{ needs.prepare-values.outputs.environments }} ) for env in ${envs[*]}; do - yq e -i '(.vets-api.image.tag) |= "${{ github.sha }}"' $env/values.yaml + yq e -i '(."vets-api".image.tag) |= "${{ github.sha }}"' $env/values.yaml yq e -i '(."vets-api".web.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ github.sha }}"' $env/values.yaml yq e -i '(."vets-api".web.dbMigrate.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ github.sha }}"' $env/values.yaml yq e -i '(."vets-api".worker.envSecrets[] | select(.name=="DD_VERSION").value) |= "${{ github.sha }}"' $env/values.yaml