-
Notifications
You must be signed in to change notification settings - Fork 25
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
ci: Move static builds to d2l.dev bucket #3898
Conversation
Publish is working! |
.github/workflows/ci.yml
Outdated
role-duration-seconds: 3600 | ||
aws-region: ca-central-1 | ||
|
||
- name: Publish | ||
uses: BrightspaceUI/actions/publish-to-s3@main | ||
with: | ||
bucket-path: s3://brightspace-ui-core.d2l.dev/branches/pr-${{ github.event.number }} | ||
bucket-path: s3://d2l.dev/pr-previews/brightspace-ui-core/pr-${{ github.event.number }} |
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 pictured this as:
bucket-path: s3://d2l.dev/pr-previews/BrightspaceUI/core/pr-${{ github.event.number }}
But I guess it doesn't really matter, as long as there are no collisions in what people choose 🤔
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.
If we did do org/repo
, we could actually add a special thing to repo_settings
so someone could do:
pr_previews: true
and under the hood it would setup the d2ldev
piece. But that doesn't work with the "main" site piece.
Just spit-balling here - what are your thoughts on this:
- All previews go into
d2l.dev/pr-previews
pr-previews/main/<org>/<repo>/
for the main site that doesn't expirepr-previews/prs/<org>/<repo>/pr-<#>
for the PR sites
- The expiry prefix is changed to
pr-previews/prs
- For now, someone sets this in
repo-settings
(need to confirm this doesn't blow up):d2ldev: s3: - subdomain: pr-previews path: main/<org>/<repo> - subdomain: pr-previews path: prs/<org>/<repo>
- But we eventually switch this to
pr_previews: true
and set it for them
- But we eventually switch this to
- If someone wants a fancy path like
brightspace-ui-core.d2l.dev
, they can set it up ind2l.dev
. But they don't actually have to set up anything ind2l.dev
if they're fine withhttps://pr-previews.d2l.dev/prs/BrightspaceUI/core/pr-${{ github.event.number }}/
andhttps://pr-previews.d2l.dev/main/BrightspaceUI/core/
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 open to that, except that I think the phrase "PR preview" doesn't apply any more to the "main" static builds.
What about calling them all repo-demos
or code-demos
?
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.
Yeah good with either of those! Or even demos
could work, if we want to try to make the default urls as easy to remember as possible (maybe not useful with url autocomplete lol)
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 might be back to being against this, mostly because of how the URLs would work:
- Suppose the generic prefix was
demos
(I also like the prefixstatic
) - So we have PR previews at e.g. https://demos.d2l.dev/BrightspaceUI/core/prs/pr-1234/, which sounds fine
- or maybe we could remove the
prs/
piece: https://demos.d2l.dev/BrightspaceUI/core/pr-1234/
- or maybe we could remove the
- But then the main demo would either be at:
- https://demos.d2l.dev/BrightspaceUI/core/main/ (ugly), or
- https://demos.d2l.dev/BrightspaceUI/core/ (which is clean but means the repo is forced to avoid the special folder name
prs
orpr-.+
)
I don't like that folder restriction, but maybe it's fine...
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.
Wouldn't the pr
and main
need to be at the beginning to be able to set the retention properly, since we can't use wildcards in the prefix? Like https://demos.d2l.dev/main/BrightspaceUI/core/ (or I think we could get away with https://demos.d2l.dev/BrightspaceUI/core/) and https://demos.d2l.dev/prs/BrightspaceUI/core/
I guess we could map it in some way with the routes, but this way maybe alleviates your concern cause there's no folder name they need to avoid. They publish their main site to d2ldev/demos/<org>/<repo>
and their PR sites to d2ldev/demos/prs/<org>/<repo>/<whatever-they-want-really>-<pr_num>
. And the lifecycle prefix is "/demos/prs/"?
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.
Yeah the prefix would need to be there in the bucket, but like you said the routing doesn't need to match the bucket.
I like keeping the main demo link clean as https://demos.d2l.dev/BrightspaceUI/core/. You're right that sticking the prs
prefix into the URL works, though it's a bit buried there...
We could also just do a completely different route and serve the prs/
bucket up at https://pr-previews.d2l.dev/BrightspaceUI/core/. That might be an anti-pattern though, d2l.dev
is generally set up so the bucket prefix matches the subdomain.
So then - why not just two separate bucket prefixes? Keep pr-previews
as it currently is, and just add one for demos
? Is there any benefit to trying to merge them into one, apart from their content being similar? Keeping pr-previews
clearly separate might also make the expiration rule more obvious.
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.
Alright I thought on it a bit, I can get behind https://demos.d2l.dev/prs/BrightspaceUI/core/ - the URL for these aren't too important anyway, since you're only going to be visiting them as links from PRs. And for that same reason, having a whole subdomain dedicated to them isn't too useful.
Any other thoughts before I go configure that in d2l.dev?
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 good with either of your last two comments - going with https://demos.d2l.dev/prs/BrightspaceUI/core/, or just making two bucket prefixes to keep things clear, since we could still wrap that in repo-settings
behind a single command. I was trying to think of two buckets prefixes that worked nicely together lol... demo
and demo-prs
? pr-preview
and repo-preview
? preview
and pr-preview
?
Good news: I've updated this to use Bad news: It's failing... 😞
I don't know why... the role should have access to
|
You can check when the tokens last rotated here: https://tokens.d2l.dev/status |
Very cool, thanks Stacey! I think that's it, it last updated at 11:10 eastern, and the job finished 11:21. |
Thanks for the PR! 🎉 We've deployed an automatic preview for this PR - you can see your changes here:
|
Okay we're in business! 🚀 (The fix was https://github.com/Brightspace/d2l.dev/pull/4637 ) |
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.
Yay! Thanks for all the work this ended up being @eKoopmans! 😅
.github/workflows/ci.yml
Outdated
role-duration-seconds: 3600 | ||
aws-region: ca-central-1 | ||
|
||
- name: Publish | ||
uses: BrightspaceUI/actions/publish-to-s3@main | ||
with: | ||
bucket-path: s3://brightspace-ui-core.d2l.dev/branches/pr-${{ github.event.number }} | ||
bucket-path: s3://d2l.dev/live/prs/BrightspaceUI/core/pr-${{ github.event.number }} |
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.
Consider making this a little more copy-pastable
bucket-path: s3://d2l.dev/live/prs/BrightspaceUI/core/pr-${{ github.event.number }} | |
bucket-path: s3://d2l.dev/live/prs/${{ github.repository }}/pr-${{ github.event.number }} |
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.
Good call Owen, I've updated the docs to use {{ github.repository }}
too!
🎉 This PR is included in version 2.141.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This moves core's static builds to the
d2l.dev
S3 bucket, as part of standardizing the PR Preview process. This will let us delete the custombrightspace-ui-core.d2l.dev
bucket.This is step 2 of a multi-step process for UI core:
repo-settings
: Get live.d2l.dev S3 accessBrightspaceUI/core
: Switch core's CI and Release to publish to live.d2l.devBrightspaceUI/core
: In all open PRs, delete the "PR Preview" comment and mergemain
to re-enable previewsd2l.dev
: Remove allbrightspace-ui-core
definitions! 🎉repo-settings
: Remove the assumable rolebrightspace-ui-core.d2l.dev-githubactions-access
brightspace-ui-core.d2l.dev
bucket and IAM rolesUS156216