-
Notifications
You must be signed in to change notification settings - Fork 20
Artifact Passing from Automate-Metrics to Build-Book #415
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
Conversation
👋 Thanks for opening this PR! The Cookbook will be automatically built with GitHub Actions. To see the status of your deployment, click below. |
While I was checking this PR's files, I started to think that as a result of the recent automate metrics PRs, we made
|
…chedule publish weekly
Thanks for the idea Orhan. It's good to know that there were use-cases for wanting to run the nightly build without deployment. I think the need for a nightly build is solved by running the publish-site weekly (and with fresh metrics). This PR now represents that. |
find-pull-request: | ||
needs: automate-metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am hesitant about this removal, i.e. I think keeping the "automate-metrics" job in the "trigger-preview.yaml" workflow would still be valuable to see how the Metrics page would render in the preview of any PR. This is because right after any PR is merged into main, there will be a publish-site workflow run, which will update the metrics on the website.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I was confused about each action a bit. I agree and will re-introduce this - but my attempts at introducing an artifact have broken the actions on my branch.
I think it might be better for me to focus on getting one action working (the publish-site), and then the knowledge I gain should transfer to setting up the trigger-preview to use automate-metrics again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I added this back for now, but I know it won't work yet and I'm not sure if it can work.
I think this because the trigger-preview is grabbing a book-build artifact.
artifact_name: book-zip-${{ needs.find-pull-request.outputs.number }}
that is zipped from the trigger-site-build action (which is triggered by a PR and thus does not have access to the secrets necessary to run the metrics collection). And in turn the trigger-preview is triggered by the trigger-site-build.
There seems to be a possible work around with trigger-preview being allowed to access secrets, so we could rebuild the book in that step, but that seems computationally expensive. I have to think about this more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed again per our discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if there is a benefit to moving the automate-metrics step to Cookbook-Actions even though we don't intend for it to be re-usable across repositories. It seems that if it existed as a re-usable workflow there are different permissions. For example, it could access secrets that live in the Cookbook-Actions repo and be triggered by a PR in the portal, zip up it's artifact and pass that back to the trigger-preview workflow. It would be a bit of an overall, and would be the next step after the artifact passing is functioning and well understood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can revisit this in the future?
YAML file is no longer malformed, and actions are running but failing at the build step during the downloading of the artifact.
There is a successful uploading of the artifact, but I'm not sure if I'm missing a critical zip step like this from the build-book action
|
One thing I'm noticing is that within the Cookbook-Actions
I think the action is failing on my fork because of In the Foundations repo and all of the Cookbooks it looks like so:
This seems to work for Foundations and the Cookbooks, so editing It seems to me like this workflow would start the |
Recovery branch
Thanks @brian-rose for explaining that it the I opened up a PR ProjectPythia/cookbook-actions#104 that changes the trigger workflow to be an input with the previous default, that way we should be able to set it to |
Caught a typo in my Cookbook-actions update. I'm pretty sure that the trigger_workflow input should just be If I don't have success with either of those two - there seems to be way I could set the workflow to blank, and |
Artifact passing is working on my branch! https://github.com/jukent/projectpythia.github.io/actions/runs/8425450722 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll approve this after a quick type is fixed
find-pull-request: | ||
needs: automate-metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can revisit this in the future?
Co-authored-by: Orhan Eroglu <[email protected]>
Editing this for conciseness for new readers:
This PR removes automatic metrics from trigger-preview and nightly-build. The metrics are only calculated in
publish-book.yaml
, which now happens weekly. We can have a wider conversation about the ideal relationship of each action.Some changes were made to Cookbooks-action
build-book.yaml
(merged in other PRs) to update the infrastructure to handle the artifact passing in this case.This PR attempts to check out the results of the directory after the automate-metrics step to be passed into the book-build action. Currently the repo is re-checked out and all liminal files are lost, resulting in no metrics on the website.
It looks like the book-build in Cookbook-actions already handles the logic for when an artifact is passed in:
So this simply uploads the artifact and then grabs it later.
Related to #319