Skip to content

Conversation

boquan-fang
Copy link
Contributor

@boquan-fang boquan-fang commented Apr 11, 2025

Release Summary:

Resolved issues:

resolves #2302

Description of changes:

We want to update the Cloud Front distribution to use the most up to date CI artifact in S2N-QUIC's doc. Instead of just uploading objects to a folder with the commit hash, I also upload those objects into a new folder called latest. I have changed the Cloud Front Origin Path to use the /latest folder to locate all artifacts.

According to the github context page, event_name shows the event that triggers the workflow to run. So, only when github.event_name is equal to push, a PR commit is pushed into main. We add a check for that to ensure only PR merging to main can trigger artifacts uploaded to S3. Additional event details about push can be found in this doc.

Call-outs:

  • We still upload those artifacts to each commit hash, because we still want to track artifacts from each commit hash. Using latest is making the CloudFront update easier.
  • We want to keep an eye on each PR that's merged in the future to see if they actually update the latest folder.
  • A benefit of this approach is that when a report failed to generate or upload, the README.md's artifacts will just use the previous artifacts. It won't break our existing link.
  • We would only upload from local to S3 once. We should then copy from existing S3 buckets to another existing S3 buckets using S3 cp command.

Testing:

  • We will need to merge it to see if artifacts got uploaded to S3.
  • I pushed an empty commit at 04:25 11 Apr 2025 PT. We can see if the bucket got updated at the time to verify that this change will not update the bucket for each PR push.
    • I can verify that the /latest folder is not updated when this PR pushes another commit.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@boquan-fang boquan-fang changed the title doc: update book's CI artifacts doc: automatically update CI artifacts Apr 11, 2025
@boquan-fang boquan-fang marked this pull request as ready for review April 11, 2025 23:56
dougch
dougch previously approved these changes Apr 14, 2025
* move s2n-quic-ci-artifacts to the top level env
* cp from hash folder to the latest to make the process simpler
@boquan-fang boquan-fang merged commit e64af49 into main Apr 15, 2025
126 checks passed
@boquan-fang boquan-fang deleted the boquan-fang/automate-doc branch April 15, 2025 17:19
@boquan-fang
Copy link
Contributor Author

I can verify that this approach works properly after this and several other PRs got merged. This PR is merged in at April 15, 2025, 10:19:40 (UTC-07:00). It ran the CI again in the main branch with github push event. I checked the latest bucket, and found out that all artifacts in the bucket were updated around April 15, 2025, 10:19:40 (UTC-07:00). This proves that the PR changes behave exactly like what we expected.

Cloud Front stores its cache for 24 hours: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Expiration.html. The CI artifacts in the repo will be updated to the Cloud Front distribution every 24 hours.

We updated the GithubOIDCRole to include the s3:GetObjectTagging permission to allow successfully copying for some files from the folder with hash to the latest folder.

dougch pushed a commit that referenced this pull request May 19, 2025
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.

docs: automate updating latest links to CI output
3 participants