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

GitHub Actions: Bot adding and removing the same label #2650

Closed
7 tasks done
SAUMILDHANKAR opened this issue Jan 2, 2022 · 15 comments
Closed
7 tasks done

GitHub Actions: Bot adding and removing the same label #2650

SAUMILDHANKAR opened this issue Jan 2, 2022 · 15 comments
Assignees
Labels
automation for manulal github board maintenance actions that are going to be automated Complexity: Large Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours

Comments

@SAUMILDHANKAR
Copy link
Member

SAUMILDHANKAR commented Jan 2, 2022

Overview

As a developer, we have to ensure that our kanban board is organized for all teams so that productivity is high. For this issue, we want to know why the GitHub action bot is adding and removing the same label and change the code logic so it doesn't do that.

Action Items

Checks

  • Test in your local environment that it works
  • Only correct labels should be mentioned in the GitHub bot comment

Resources/Instructions

Screenshot of pr #2621 showing github-actions adding and removing labels "role: back end/devOps" and "Size: Large" pr-2621-GHA-adding-removing-backend-large-labels

Never done GitHub actions? Start here!
GitHub Complex Workflows doc
GitHub Actions Workflow Directory
Events that trigger workflows
Workflow syntax for GitHub Actions
actions/github-script
GitHub RESTAPI

Architecture Notes

The idea behind the refactor is to organize our GitHub Actions so that developers can easily maintain and understand them. Currently, we want our GitHub Actions to be structured like so based on this proposal:

  • Schedules (military time)
    - Schedule Friday 0700
    - Schedule Thursday 1100
    - Schedule Daily 1100
  • Linters
    - Lint SCSS
  • PR Trigger
    - Add Linked Issue Labels to Pull Request
    - Add Pull Request Instructions
  • Issue Trigger
    - Add Missing Labels To Issues
  • WR - PR Trigger
    - WR Add Linked Issue Labels to Pull Request
    - WR Add Pull Request Instructions
  • WR - Issue Trigger

Actions with the same triggers (excluding linters, which will be their own category) will live in the same github action file. Scheduled actions will live in the same file if they trigger on the same schedule (i.e. all files that trigger everyday at 11am will live in one file, while files that trigger on Friday at 7am will be on a separate file).

That said, this structure is not set in stone. If any part of it feels strange, or you have questions, feel free to bring it up with the team so we can evolve this format!

@github-actions github-actions bot added Feature Missing This label means that the issue needs to be linked to a precise feature label. role missing size: missing labels Jan 2, 2022
@github-actions
Copy link

github-actions bot commented Jan 2, 2022

Hi @SAUMILDHANKAR.

Please don't forget to add the proper labels to this issue. Currently, the labels for the following are missing:
Size, Role, Feature

To add a label, take a look at Github's documentation here.

Also, don't forget to remove the "missing labels" afterwards.
To remove a label, the process is similar to adding a label, but you select a currently added label to remove it.

After the proper labels are added, the merge team will review the issue and add a "Ready for Milestone" label once it is ready for prioritization.

Additional Resources:

@SAUMILDHANKAR SAUMILDHANKAR added role: back end/devOps Tasks for back-end developers Complexity: Medium Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly and removed Feature Missing This label means that the issue needs to be linked to a precise feature label. role missing size: missing labels Jan 2, 2022
@SAUMILDHANKAR SAUMILDHANKAR changed the title DRAFT: Review code logic for bot adding and removing same label GitHub Actions: Review code logic for bot adding and removing same label Feb 4, 2022
@SAUMILDHANKAR SAUMILDHANKAR changed the title GitHub Actions: Review code logic for bot adding and removing same label GitHub Actions: Review and fix code logic for bot adding and removing the same label Feb 5, 2022
@SAUMILDHANKAR SAUMILDHANKAR added automation for manulal github board maintenance actions that are going to be automated size: 1pt Can be done in 4-6 hours Ready for Prioritization labels Feb 5, 2022
@JessicaLucindaCheng JessicaLucindaCheng added this to the y. Technical debt milestone Feb 5, 2022
@SAUMILDHANKAR SAUMILDHANKAR changed the title GitHub Actions: Review and fix code logic for bot adding and removing the same label GitHub Actions: Bot adding and removing the same label Feb 10, 2022
@Zak234 Zak234 self-assigned this Jun 21, 2022
@Zak234
Copy link
Contributor

Zak234 commented Jun 22, 2022

I checked the pull request and I don't think this is a code issue. The person accidentally wrote the wrong issue number whose labels were pulled for the pull request and then changed it to the correct one which led to the GitHub action removing some of the previous labels while keeping the others as the two issues shared some labels in common.

@Zak234 Zak234 closed this as completed Jun 23, 2022
@SAUMILDHANKAR
Copy link
Member Author

@Zak234 Thanks for adding your analysis for this issue. Looks like your observation is correct for the case mentioned in the issue description above however, there are a few more cases where the labels are getting added unexpectedly and sorry, I did not add them to the issue earlier. Please notice that the GitHub action bot adds and removes the same label in:

It would be really helpful if these can be analyzed as part of this issue as well by reopening this issue, but if you think a separate issue would be better to resolve it, let me know.

Additionally, GitHub actions bot sometimes removes a label unexpectedly. See the cases below:

These might not be related but just wanted to add it here in case it is useful. I will reach out to you on slack as well for better reach. Thanks.

@Zak234
Copy link
Contributor

Zak234 commented Jun 25, 2022 via email

@SAUMILDHANKAR
Copy link
Member Author

@Zak234 Thanks for getting back. There have been a few updates to the actions that you mentioned above but none of them seems to be directly about fixing this issue. It is possible that any other code change might have fixed this issue, but it would need more analysis. I will check my notes for a more recent example where this has occurred and let you know. Thank you.

@Zak234
Copy link
Contributor

Zak234 commented Jun 27, 2022 via email

@SAUMILDHANKAR
Copy link
Member Author

@Zak234 I was definitely part of the merge team when the label was removed and as far as I can remember Adam was part of the merge team as well though not 100% sure.

@Zak234
Copy link
Contributor

Zak234 commented Jul 3, 2022 via email

@Zak234
Copy link
Contributor

Zak234 commented Jul 5, 2022 via email

@SAUMILDHANKAR
Copy link
Member Author

@Zak234 Thanks for looking into it. I will let you and the current leads decide on if a new issue should be written for it or if it should be fixed as part of this issue.

Also, were you able to look into the other issues as well where the GitHub actions bot was adding and removing the status updated label? If these are 2 separate problems, then making a new issue would definitely be a good idea.

@Zak234
Copy link
Contributor

Zak234 commented Jul 6, 2022 via email

@Zak234
Copy link
Contributor

Zak234 commented Jul 9, 2022 via email

@SAUMILDHANKAR
Copy link
Member Author

@Zak234 Thanks for looking into this. Sure, feel free to create an issue for that. Unless something came up regarding the To update! label recently, my understanding is that it is still being used. The reason there aren't too many of those labels currently might be because of a bug which would be addressed in the issue: #2634

@Zak234
Copy link
Contributor

Zak234 commented Jul 10, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation for manulal github board maintenance actions that are going to be automated Complexity: Large Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly role: back end/devOps Tasks for back-end developers size: 1pt Can be done in 4-6 hours
Projects
Development

No branches or pull requests

5 participants