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

feat: added a shared workflow to auto update browserslist in the MFEs #29

Conversation

abdullahwaheed
Copy link
Contributor

Added a shared Workflow to auto update browserslist

Copy link
Member

@UsamaSadiq UsamaSadiq left a comment

Choose a reason for hiding this comment

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

Some minor suggestions. Otherwise, looks good to be merged.

.github/workflows/update-browserslist.yml Outdated Show resolved Hide resolved
.github/workflows/update-browserslist.yml Outdated Show resolved Hide resolved
Copy link

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

Approved, but I'd like more eyes on this first, since it's an org-wide change.

.github/workflows/update-browserslist.yml Outdated Show resolved Hide resolved
.github/workflows/update-browserslist.yml Outdated Show resolved Hide resolved
.github/workflows/update-browserslist.yml Outdated Show resolved Hide resolved
commit-message: 'chore: update browserslist'
title: Update browserslist DB
body: |
Updated browserslist DB
Copy link
Contributor

Choose a reason for hiding this comment

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

I would provide a much more verbose body. Is there a SLA to merging that teams should have? What is the importance of the change? Could we do a short summary of the change? (you can echo things to the Actions environment then use them later in the file, for example this line:

https://github.com/openedx/.github/blob/master/.github/workflows/add-depr-ticket-to-depr-board.yml#L69

echos variable $PROJECT_ID to the local $GITHUB_ENV, and then it's used in the next step:

https://github.com/openedx/.github/blob/master/.github/workflows/add-depr-ticket-to-depr-board.yml#L83

Copy link
Member

Choose a reason for hiding this comment

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

Is there a SLA to merging that teams should have?

I believe we could auto-merge the resulting PR from this workflow. The resulting changes from browserslist --update-db command update a tiny portion of the package-lock.json file, and is pretty low risk to auto-merge, assuming CI and other status checks pass.

That way, consuming teams won't need to triage/prioritize merging the resulting PR.

commit-message: 'chore: update browserslist'
title: Update browserslist DB
body: |
Updated browserslist DB
Copy link
Member

Choose a reason for hiding this comment

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

Is there a SLA to merging that teams should have?

I believe we could auto-merge the resulting PR from this workflow. The resulting changes from browserslist --update-db command update a tiny portion of the package-lock.json file, and is pretty low risk to auto-merge, assuming CI and other status checks pass.

That way, consuming teams won't need to triage/prioritize merging the resulting PR.

@@ -0,0 +1,7 @@
{
"name": "Auto Update Browserslist Workflow",
Copy link
Member

Choose a reason for hiding this comment

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

nit: "Auto Update Browserslist DB Workflow" maybe?

Copy link
Member

Choose a reason for hiding this comment

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

Similarly, should the file name also include DB, e.g. update-browserslist-db.properties.json?

run: npm ci

- name: Update dependencies
run: npx browserslist@latest --update-db
Copy link
Member

Choose a reason for hiding this comment

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

Note: I just stumbled on https://github.com/c2corg/browserslist-update-action, which is a Github Action we might be able to use here instead. Worth noting that the README for that action mentions:

v1 uses command npx browserslist@latest --update-db which is now deprecated and to be removed in a future major browserslist release.

It is being replaced with a standalone NPM package update-browserslist-db instead.

workflow-templates/update-browserslist.yml Outdated Show resolved Hide resolved
.github/workflows/update-browserslist.yml Outdated Show resolved Hide resolved
.github/workflows/update-browserslist.yml Outdated Show resolved Hide resolved
.github/workflows/update-browserslist.yml Outdated Show resolved Hide resolved
@arbrandes
Copy link

@abdullahwaheed, sprint check: will you have time to address the reviews in the next couple of weeks?

@jmbowman
Copy link

jmbowman commented Dec 9, 2022

label: waiting on author

@arbrandes arbrandes added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Dec 9, 2022
@abdullahwaheed abdullahwaheed marked this pull request as draft December 12, 2022 13:37
@abdullahwaheed
Copy link
Contributor Author

@adamstankiewicz I have used this action to enable Auto Merge functionality and made suggested changes. Please note that these conditions must met to get PR auto merge.

@abdullahwaheed abdullahwaheed marked this pull request as ready for review December 14, 2022 13:08
@abdullahwaheed
Copy link
Contributor Author

remove label: waiting on author

@abdullahwaheed abdullahwaheed requested review from adamstankiewicz and sarina and removed request for adamstankiewicz and sarina December 15, 2022 06:45
@abdullahwaheed abdullahwaheed requested review from arbrandes and adamstankiewicz and removed request for arbrandes December 15, 2022 06:45
@sarina
Copy link
Contributor

sarina commented Dec 15, 2022

I see you've requested me for a review. From an Actions perspective this seems fine but I don't know anything about what it's actually doing and am not going to test, so I will not be a reviewer.

Copy link

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

This looks good to me! +1

@arbrandes
Copy link

I approve, but I'm not sure I should be able to merge this. I'll ask around and circle back.

@adamstankiewicz
Copy link
Member

This also looks good to me! ✅

@arbrandes arbrandes changed the title feat: added a shared workflow to auto update broswerslist in the MFEs feat: added a shared workflow to auto update browserslist in the MFEs Dec 16, 2022
@arbrandes arbrandes merged commit 8f3182d into openedx:master Dec 16, 2022
@abdullahwaheed
Copy link
Contributor Author

@adamstankiewicz @arbrandes to enable auto merge functionality, auto merge option should be enabled in the repository as listed here. Should we ask owning teams to enable this option or should we make auto merge functionality optional?

@arbrandes
Copy link

@abdullahwaheed, I think we should allow repo owners/maintainers to decide. Maybe as part of a checklist on the PR description, checking with the reviewer to agree auto-merging should be enabled for that repo.

@abdullahwaheed
Copy link
Contributor Author

sure, i'll add appropriate comments in the PR description, and i'll also update this shared workflow to make auto merging optional so if some owners don't allow auto-merge, we won't run auto merge workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants