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

chore: create GitHub action to update the canary branch #171

Merged
merged 6 commits into from
Apr 11, 2021

Conversation

targos
Copy link
Member

@targos targos commented Sep 13, 2020

No description provided.

@targos
Copy link
Member Author

targos commented Sep 13, 2020

I created an empty main branch.
Here's a run on my fork: https://github.com/targos/node-v8/runs/1107906165?check_suite_focus=true

Things to note:

  • We need to find a way to notify interested individuals when there's a failure, because I think errors in scheduled actions do not generate GitHub notifications
  • Fetching V8 in node-core-utils takes a lot of time. Since I already clone the lkgr branch in the action, that step shouldn't be necessary and we can probably enhance ncu for that

@targos targos linked an issue Sep 13, 2020 that may be closed by this pull request
@targos
Copy link
Member Author

targos commented Sep 13, 2020

/cc @mmarchini

@mmarchini
Copy link

mmarchini commented Sep 13, 2020

We need to find a way to notify interested individuals when there's a failure, because I think errors in scheduled actions do not generate GitHub notifications

It generates for the committer and for the author (maybe also for the pusher). Are you on the OpenJS Foundation slack? We could have a nodejs-v8-canary channel and then send the notifications there. Otherwise there's probably a SMTP email notifier Action we could use (edit: https://github.com/marketplace/actions/send-email).

@mmarchini
Copy link

Fetching V8 in node-core-utils takes a lot of time. Since I already clone the lkgr branch in the action, that step shouldn't be necessary and we can probably enhance ncu for that

It doesn't respect the --base-dir option? Another option is to use a cache instead of checking out the repository (and let ncu check out like it does today, only the first run will take time to fetch V8).

@targos
Copy link
Member Author

targos commented Sep 13, 2020

It doesn't respect the --base-dir option?

It does respect that option. The issue is that it fetches all branches with git fetch origin. That's not a problem with Jenkins because the workspaces are kept between runs so only the first run on a new machine would be slow.

@targos
Copy link
Member Author

targos commented Sep 13, 2020

Using a Slack channel SGTM.

@mmarchini
Copy link

It does respect that option. The issue is that it fetches all branches with git fetch origin. That's not a problem with Jenkins because the workspaces are kept between runs so only the first run on a new machine would be slow.

Ah, that sounds like a good use for cache then

@mmarchini
Copy link

For Slack there are many actions out there: https://github.com/marketplace?type=actions&query=slack. I have tested https://github.com/marketplace/actions/slack-notify but haven't tested it to "notify on failure". Other Actions look easier to use to notify on failure (or after every run, if that's what we want).

@targos
Copy link
Member Author

targos commented Sep 14, 2020

I created the #nodejs-v8-canary channel on Slack

@cclauss cclauss marked this pull request as ready for review September 14, 2020 12:37
@cclauss cclauss marked this pull request as draft September 14, 2020 12:37
@cclauss
Copy link

cclauss commented Sep 14, 2020

Sorry @targos I did not mean to undraft this!

@cclauss cclauss closed this Sep 27, 2020
@cclauss cclauss reopened this Sep 27, 2020
@mmarchini
Copy link

@targos fyi I added SLACK_WEBHOOK Secret to the repo, so we can use it to notify the channel when sync fails

run: |
ACTIONS_URL="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}?check_suite_focus=true"
SLACK_PAYLOAD="{\"username\": \"canary_bot\", \"text\": \"*Canary update failed!*\n\nRun: ${ACTIONS_URL}\", \"icon_emoji\": \":bell:\"}"
curl -X POST --data-urlencode "payload=${SLACK_PAYLOAD}" ${{ secrets.SLACK_WEBHOOK }}
Copy link
Member Author

Choose a reason for hiding this comment

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

Result:

image

README.md Outdated Show resolved Hide resolved
@targos targos marked this pull request as ready for review January 31, 2021 12:36
@targos
Copy link
Member Author

targos commented Jan 31, 2021

Last try: https://github.com/targos/node-v8/runs/1800903471?check_suite_focus=true

Note that we apparently need a custom GitHub token with "workflows" permission, otherwise the push to canary fails if a workflow was updated in nodejs/node.
Apart from that, I think it's ready. The build took around 1hour. I don't know if we can optimize that somehow but the good news is that it's much faster than the Jenkins job!

@targos
Copy link
Member Author

targos commented Feb 12, 2021

@mmarchini @gengjiawen would you like to have a new look?

Copy link
Member

@gengjiawen gengjiawen left a comment

Choose a reason for hiding this comment

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

LGTM

@targos targos merged commit 3e6ec77 into nodejs:main Apr 11, 2021
@targos
Copy link
Member Author

targos commented Apr 11, 2021

Starting with a manual run: https://github.com/nodejs/node-v8/actions/runs/737865140

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.

Move node-update-v8-canary to GitHub Actions
5 participants