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

Issue labeling logic needs tweak to be compatible with project workflow #5220

Open
jithunnair-amd opened this issue May 20, 2024 · 3 comments

Comments

@jithunnair-amd
Copy link
Contributor

We use the following project workflow to track and organize ROCm-related PyTorch issues:
https://github.com/orgs/pytorch/projects/38/workflows/12300629
image

As you can see, we try to exclude issues with the skipped label since those are a different category of unit-test skips which we don't want to include in the project.

However, for any such issues, it looks like the bot labeling logic works in the following order today:

  1. Add skipped label (based on DISABLED in the title)
  2. Add module: rocm label (based on platforms: rocm in the description) and remove skipped label
  3. Add skipped label again (based on DISABLED in the title)

Unfortunately, due to the order in which the labels are added, the project workflow kicks in between step 2 and 3, and ends up adding these issues to the project before the skipped label is re-added. It's a race condition, but I think a simple fix to this could be to reverse the order of labels in the list to be added: First add the already-existing labels, followed by the (new) platform labels.

An example of this race condition in action: pytorch/pytorch#125991
image

IIUC, the relevant code is here:

await context.octokit.issues.setLabels({

Can we please reorder the labels so that this race condition doesn't occur?

@hongxiayang
Copy link

Thanks @jithunnair-amd for filing this issue. This will help to reduce the noises in the "Pytorch for ROCm" project.

@ZainRizvi
Copy link
Contributor

Sounds like the core problem is a race condition, where:

  • Process A reads the labels
  • Process B adds a label
  • Process A writes back the original set of labels, adding a new. one, and overwrites the label that project B added

Fix could be to use a different github API to only append a new label instead of setting the full list of labels

@jithunnair-amd
Copy link
Contributor Author

@ZainRizvi I agree that if there's a way/api for appending instead of setting labels, that'd be ideal in this scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Cold Storage
Development

No branches or pull requests

3 participants