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

Fix how to staging promotion #1928

Merged
merged 1 commit into from
Jul 6, 2024
Merged

Conversation

derrix060
Copy link
Contributor

@derrix060 derrix060 commented Jul 5, 2024

Fix how to get DOCKER_IMAGE_TAG:

By using GITHUB_ENV, only the steps on the same job will be able to get the value. When trying to get it from steps from different jobs the value is empty.

This was causing issues to promote to staging because it was trying to promote EVERYTHING in dev to staging. Luckly there was a check to not allow to overwrite the same tag, so things that were already promoted couldn't be overwritten

By using GITHUB_OUTPUT instead, it is now possible to get the variable on any step from any subsequent job

Add deployment version verification for staging and production:

The CI/CD pipeline has been updated to include a new step for verifying the deployment version in the staging and production environments. This ensures that the correct version of the Docker image is deployed to each environment before running the tests

Add set -ux to deployment verification script:

  • -u will treat any unitialized variable as an error
  • -x will print the command that is being executed

This will make sure that cases where the EXPECTED_VERSION not being passed won't cause any problem.
One example where the variable was not set and the job succeeded: https://github.com/NethermindEth/juno/actions/runs/9800486115/job/27062611554#step:3:15

By using -x, it will be useful to understand exactly what's the expected version, so no confusion will be made

Copy link

codecov bot commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.44%. Comparing base (f977358) to head (cb2fe9c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1928      +/-   ##
==========================================
+ Coverage   75.35%   75.44%   +0.09%     
==========================================
  Files          97       97              
  Lines        8676     8676              
==========================================
+ Hits         6538     6546       +8     
+ Misses       1552     1548       -4     
+ Partials      586      582       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@derrix060 derrix060 enabled auto-merge (squash) July 5, 2024 13:58
Fix how to get DOCKER_IMAGE_TAG:

  By using GITHUB_ENV, only the steps on the same job will be
able to get the value.  When trying to get it from steps from
different jobs the value is empty.

  This was causing issues to promote to staging because it was
trying to promote EVERYTHING in dev to staging.  Luckly there
was a check to not allow to overwrite the same tag, so things
that were already promoted couldn't be overwritten

  By using GITHUB_OUTPUT instead, it is now possible to get the
variable on any step from any subsequent job

Add deployment version verification for staging and production:

  The CI/CD pipeline has been updated to include a new step for
verifying the deployment version in the staging and production
environments.
  This ensures that the correct version of the
Docker image is deployed to each environment before running the
tests

Add set -ux to deployment verification script:

- -u will treat any unitialized variable as an error
- -x will print the command that is being executed

  This will make sure that cases where the EXPECTED_VERSION
not being passed won't cause any problem.
  One example where the variable was not set and the job succeeded:
https://github.com/NethermindEth/juno/actions/runs/9800486115/job/27062611554#step:3:15

  By using -x, it will be useful to understand exactly what's
the expected version, so no confusion will be made

Add Manual gate to run tests in production

  Since the deployment to production is a manual process, creating
a artificial environment makes it possible for the tests to run
only after a deployment is actually done.
  This avoids the issue where the tests will start to run without
the environment be ready.
@derrix060 derrix060 force-pushed the mario/fix_staging_promotion branch from e02aadb to cb2fe9c Compare July 5, 2024 16:11
@wojciechos wojciechos disabled auto-merge July 6, 2024 14:08
@wojciechos wojciechos merged commit 7fd3305 into main Jul 6, 2024
10 checks passed
@wojciechos wojciechos deleted the mario/fix_staging_promotion branch July 6, 2024 14:08
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.

None yet

2 participants