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

Update release flow for BCK prerelease and final release #12453

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

rtibbles
Copy link
Member

Summary

  • Updates the release flow to always release to a BCK prerelease bucket
  • Also always adds assets to the global content static folder for use by BCK instances
  • Updates the latest/final release workflow to properly check if this is the latest release, and then updates the production BCK bucket if so

References

Fixes #12240

Reviewer guidance

The only part of this I was really able to test was the unzipping and ungzipping of the assets into a folder, everything else I have had to do by thinking I got it right.

Particular things to pay attention to:

  • Have I done the upload of the static folder to GCS correctly?
  • Am I properly evaluating whether the current release tag that we are running the action for matches the tag of the latest release?
  • Am I allowed to use an output from a needs job in an if conditional for the whole job? (I don't know, and Github Actions wouldn't tell me)

Testing checklist

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@rtibbles rtibbles changed the base branch from develop to release-v0.17.x July 16, 2024 23:10
@github-actions github-actions bot added the DEV: dev-ops Continuous integration & deployment label Jul 16, 2024
@rtibbles rtibbles added the TODO: needs review Waiting for review label Jul 16, 2024
Copy link
Member

@DXCanas DXCanas left a comment

Choose a reason for hiding this comment

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

Things look right! I guess we'll see 💀

name: ${{ needs.whl.outputs.whl-file-name }}
path: dist
- name: Zip whl file
run: zip -j dist/kolibri.zip dist/${{ needs.whl.outputs.whl-file-name }}
Copy link
Member

Choose a reason for hiding this comment

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

Assuming that the filename looks like it does in the PR comment (kolibri-0.17.0b3.dev0+git.3.gb6d89f4b-py2.py3-none-any.whl), this looks like it'd install just fine, yep. Link to relevant lines in the CD dockerfile

Comment on lines +202 to +203
path: 'dist/kolibri.zip'
destination: '${{ secrets.BCK_PRERELEASE_BUILD_ARTIFACT_GCS_BUCKET }}'
Copy link
Member

Choose a reason for hiding this comment

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

Was initially concerned by this, but if the docs are telling the truth, should be uploaded flat. And so this may be alright.

Comment on lines +207 to +210
unzip -j dist/${{ needs.whl.outputs.whl-file-name }} 'kolibri/core/content/static/*' -d static
rm static/*.file_size
# Ungzip all .gz files in the static folder
for f in static/*.gz; do gunzip -f $f; done
Copy link
Member

Choose a reason for hiding this comment

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

yeesh you fancy with your bash functions

Copy link
Member

Choose a reason for hiding this comment

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

This all looks fine to me, though you're doing more than the old buildkite step was doing; makes sense, given you're pulling from a WHL rather than the source code — do you not have access to the source code, or is it just safer to use the artifact we know successfully built?

Copy link
Member Author

Choose a reason for hiding this comment

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

By this point in the step, the built source has been gzipped and truncated to keep the overall whl file smaller, so we have to do this to reinflate it back to uncompressed sources.

And yes, definitely safer to use the files we know have built successfully into the whl file.

uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: 'static'
destination: '${{ secrets.STUDIO_BCK_CONTENT_STATIC_BUCKET }}'
Copy link
Member

Choose a reason for hiding this comment

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

The the bajillion examples of the not-immediately-intuitive behaviour on upload described in the docs has be squinting suspiciously at this. But if my understanding is right, all the extracted folders should start at the root of the bucket. Which is what I believe Kolibri-modified-to-point-at-a-bucket-for-content is expecting

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes - the docs are highly confusing, but this is also why I unzipped all the static files into the root of the current directory, so that I could just say "upload this folder". I am fully ready for my having misunderstood the docs again, again, again.

@rtibbles rtibbles merged commit 26a55e3 into learningequality:release-v0.17.x Jul 18, 2024
33 checks passed
@rtibbles rtibbles deleted the pre_release_bck branch July 18, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: dev-ops Continuous integration & deployment TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update BCK bucket upload to properly check for latest release and do prerelease upload
2 participants