Skip to content

Conversation

@CheyuWu
Copy link
Collaborator

@CheyuWu CheyuWu commented Apr 29, 2025

Why are these changes needed?

Currently, failed upgrades require manual checking by maintainers. This change aims to improve the process by:

  • Automatically assigning the repo maintainer if the upgrade succeeds

  • Automatically creates an issue if the upgrade fails

Manual Testing

I have removed the condition specific to Dependabot, because I cannot trigger Dependabot manually

Verified the pipeline with a successful case → auto-assigns all maintainers

image

Verified the pipeline with a failure case → auto-creates an issue

  • If Dependabot fails in the pipeline
image
  • The new issue will look like
image

Verified the pipeline with a failure case that includes reCommit → does not auto-create an issue

After the dependabot reopened the issue or re-committed the issue and the pipeline failure, it won't reCreate an issue
image

Related issue number

Closes #3484

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(


jobs:
monitor-dependabot:
if: github.actor == 'dependabot[bot]'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure how to trigger Dependabot. During manual testing, this condition was not set.

if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Wait for checks to complete
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will make sure all of the pipeline is finished before running this script

console.log("All checks passed.");
}
- name: Create issue on failure
if: failure() && github.event.action == 'opened'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is to ensure the bot won't spam the issue.

Comment on lines 80 to 99
const maintainers = collaborators
.filter(user => user.permissions.admin)
.map(user => user.login);

// Step 3: Assign to the PR
if (maintainers.length > 0) {
await github.rest.issues.addAssignees({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
assignees: maintainers,
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will assign all of the maintainers

Copy link
Contributor

Choose a reason for hiding this comment

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

curious as of now, who will be assigned?

Copy link
Collaborator Author

@CheyuWu CheyuWu May 5, 2025

Choose a reason for hiding this comment

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

user.permissions.admin =>["ericl","pcmoritz","richardliaw","Jeffwan","zhe-thoughts"]`

Well, I should assign the reviewer directly, not via the API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I also try user.permissions.pusher and user.permission.maintainer.
The result is

Pusher:  [
  'ericl',
  'pcmoritz',
  'caitengwei',
  'wilsonwang371',
  'richardliaw',
  'Jeffwan',
  'zhe-thoughts',
  'andrewsykim',
  'akanso',
  'simon-mo',
  'DmitriGekhtman',
  'sriram-anyscale'
]
Maintainers:  [
  'ericl',
  'pcmoritz',
  'caitengwei',
  'richardliaw',
  'Jeffwan',
  'zhe-thoughts',
  'akanso',
  'simon-mo',
  'DmitriGekhtman'
]

https://github.com/ray-project/kuberay/actions/runs/14836955695/job/41650311396?pr=3544

@CheyuWu CheyuWu changed the title [WIP][Feature] Dependabot send out issue if package upgrade failure [Feature] Dependabot send out issue if package upgrade failure Apr 29, 2025
@CheyuWu
Copy link
Collaborator Author

CheyuWu commented Apr 29, 2025

Hi @dentiny, PTAL

By the way, if testing is still being considered, Dependabot will be needed. Please let me know, and I’ll find a way to test it properly.

@dentiny
Copy link
Contributor

dentiny commented Apr 30, 2025

Sorry for the delay, I will take a look later today; feel free to ping me directly on slack if I don't get back to you. Thank you!

Copy link
Contributor

@dentiny dentiny left a comment

Choose a reason for hiding this comment

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

Could you please link the PR and pipeline in the PR description? Thank you!

await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `Dependabot upgrade failed: #${context.issue.number}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: include the PR titled in github issue? I think there're pretty well formatted.

with:
script: |
// Step 1: Get collaborators
const collaborators = await github.paginate(
Copy link
Contributor

Choose a reason for hiding this comment

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

Q: do we issue one request or multiple requests, if the overall collaborator numbers are >100?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it will automatically issue multiple requests if there are more than 100 collaborators.

assignees: maintainers,
});
} else {
console.log("No maintainers found to assign.");
Copy link
Contributor

Choose a reason for hiding this comment

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

console.warn

@CheyuWu CheyuWu force-pushed the bot/notifier branch 2 times, most recently from 0deb46a to e4ab607 Compare May 5, 2025 11:41

jobs:
monitor-dependabot:
if: github.event.pull_request.user.login == 'dependabot[bot]'
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed github.actor to github.event.pull_request.user.login
Reference

uses: actions/github-script@v7
with:
script: |
const maintainers = ["dentiny"];
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

According to #3512 (comment), we should use fixed maintainer name

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If there are any other users that I should add, please let me know

await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: `Dependabot upgrade failed: #${context.issue.number} - ${context.payload.pull_request.title}`,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have added the pr title

@CheyuWu CheyuWu force-pushed the bot/notifier branch 2 times, most recently from 0d4abd3 to 42d8419 Compare May 5, 2025 18:12
@CheyuWu
Copy link
Collaborator Author

CheyuWu commented May 5, 2025

Hi @dentiny, I have updated the code

  1. Change the issue title
  2. Use fixed maintainers instead, because [Feature] Dependabot send out issue if package upgrade failure #3512 (comment)
  3. I changed github.actor to github.event.pull_request.user.login
    Reference

And I have run the pipeline in my repo

PTAL

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.

[Feature] Dependabot send out issue if package upgrade failure

2 participants