juno icon indicating copy to clipboard operation
juno copied to clipboard

Fix how to staging promotion

Open derrix060 opened this issue 1 year ago • 1 comments

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

derrix060 avatar Jul 05 '24 13:07 derrix060

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jul 05 '24 13:07 codecov[bot]