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

Workflow Run Set PR labels not adding labels to Pull Requests #2933

Closed
2 of 5 tasks
SAUMILDHANKAR opened this issue Mar 5, 2022 · 13 comments
Closed
2 of 5 tasks

Workflow Run Set PR labels not adding labels to Pull Requests #2933

SAUMILDHANKAR opened this issue Mar 5, 2022 · 13 comments
Assignees
Labels
automation for manulal github board maintenance actions that are going to be automated Bug Something isn't working Complexity: Medium 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 Status: Updated No blockers and update is ready for review Status: Urgent Needs to be worked on immediately

Comments

@SAUMILDHANKAR
Copy link
Member

SAUMILDHANKAR commented Mar 5, 2022

Overview

As a developer, I want all my workflow runs to be successful. For this issue, we will identify and fix the error which causes the Workflow Run Set PR labels to fail.

Details

Workflow Run Set PR labels is not adding labels to some of the pull requests. We need to fix this bug so that the labels from the issue can be added to their linked pull requests automatically.

Action Items

Resources/Instructions

set pr labels yml file
set pr label js file
Related prs where this issue was encountered: #2918, #2899, #2969
Sample workflow failure: https://github.com/hackforla/website/actions/runs/1904313617

@SAUMILDHANKAR SAUMILDHANKAR added Bug Something isn't working role: back end/devOps Tasks for back-end developers Complexity: Medium Feature: Board/GitHub Maintenance Project board maintenance that we have to do repeatedly automation for manulal github board maintenance actions that are going to be automated size: 1pt Can be done in 4-6 hours labels Mar 5, 2022
@github-actions

This comment was marked as resolved.

@SAUMILDHANKAR SAUMILDHANKAR changed the title Draft: WR Set pr labels not adding labels to prs Workflow Run Set PR labels not adding labels to Pull Requests Apr 22, 2022
@SAUMILDHANKAR SAUMILDHANKAR added Status: Urgent Needs to be worked on immediately Ready for Prioritization labels Apr 22, 2022
@tunglinn tunglinn self-assigned this Jun 30, 2022
@github-actions
Copy link

Hi @tunglinn, thank you for taking up this issue! Hfla appreciates you :)

Do let fellow developers know about your:-
i. Availability: (When are you available to work on the issue/answer questions other programmers might have about your issue?)
ii. ETA: (When do you expect this issue to be completed?)

You're awesome!

P.S. - You may not take up another issue until this issue gets merged (or closed). Thanks again :)

@tunglinn
Copy link
Member

tunglinn commented Jul 1, 2022

Availability: 6 hours/Friday, Sunday, Monday
ETA: 7/4/2022

@github-actions github-actions bot added the Status: Updated No blockers and update is ready for review label Jul 1, 2022
@tunglinn
Copy link
Member

tunglinn commented Jul 4, 2022

Progress: Understanding how Github actions work, duplicated repo into a private repo for testing.
Blockers: Unable to test actions in private repo.
Availability: M-Th (6 hours/each)
ETA: 7/11

@tunglinn
Copy link
Member

tunglinn commented Jul 6, 2022

I'm unable to access the action logs from the mentioned PRs (log retention is capped at 90 days for public repositories).
Overall, I found that PR label workflow fails to trigger along with the pull request instructions. I believe that the issue is not solely in the PR label workflow.

Here's a more detailed report of the mentioned issues:

For #2918, PR label and PR request instruction workflow wasn't run on the creation of the PR.
PR label was run on two other occasions:

on a commit (b4ae447) that comes from a different PR that the user reviewed

image

when someone removed a label and edited PR

image

image

Next, #2899 is not a true failure example. My understanding is the user manually added the labels during the creation of the PR

because the labels are added by the user before the Add Pull Request Instructions comment.

image

image

and the PR labels workflow did trigger.

image

Finally, for #2969, it looks like both the PR labels and PR request instructions workflow did not trigger if you check the "Checks" tab in the PR.

This is under the "Checks" tab of the issue.

image

Patterns found:

For both 2918 and 2969, there was a different user in an earlier commit. I will look into other PRs with similar commit histories.

image

and

image

None of the workflows triggered when PR was opened even though it should have according to this code.

from pr-instruction.yml

image

from set-pr-labels.yml

image

I found some recent PRs where github-actions did not add labels.

7/6/2022 - when PR was created, did not link issue
7/5/2022 - looks like the user manually added labels during PR creation, so not true failure
6/30/2022 - looks like the user manually added labels during PR creation, so not true failure

@tunglinn
Copy link
Member

tunglinn commented Jul 6, 2022

Found #3318, where a commit from a different user is added into the PR.

triggered both PR labels and PR request instructions workflow

image

PR labels are good, but the PR request instructions comment doesn't exist

image

Lint SCSS is always triggered on pull requests being synchronized. One potential solution is to add synchronize to the types of events that triggers the PR labels and request instruction workflow.

Next steps will be recreating and testing in private repository.

@tunglinn
Copy link
Member

tunglinn commented Jul 7, 2022

Found a few PR with same issue with logs still intact!
#3087 - false alarm, it seems like none of the workflow ran because there was a merge conflict of some sort merge conflict that Jessica mentioned.

Workflows don't run if there is a merge conflict

image

#3116 - false alarm, the merge branch isn't correct, workflows do not run unless they are for gh-pages, feature-homepage-launch, or feature-tech-dropdown

@tunglinn
Copy link
Member

tunglinn commented Jul 7, 2022

Hi all,
I'd like to test workflows on #2969.
I'd like to remove a label, and then edit the PR to trigger the workflow. Bonnie and I discussed this and seems harmless. Also, there is some precedent as Saumil did it in #2918.
Please let me know if this will cause problems.

@tunglinn
Copy link
Member

tunglinn commented Jul 12, 2022

Did some testing in existing PRs. I removed a label, updated the top PR comment, which should trigger the PR label workflow to re-add the label.

When testing in an already merged pull request #3291, the PR label action is able to be triggered.

image

However #2969 and #2918 did not trigger the PR label action.

image

image

I tested #2905, a PR from the same time as the two above. The workflow did trigger.

image

I thought that the workflow only triggers if the branch the PR is pulling from still exists.

But #2970 has a deleted branch, yet it triggers PR label action.

image

#2943 doesn't trigger. The from branch is greyed out, which is different from deleted branches in which you can click but brings you to a 404 error page.

image

@JessicaLucindaCheng
Copy link
Member

JessicaLucindaCheng commented Jul 13, 2022

@tunglinn I noticed this pr doesn't have labels on it and has Fixes #3316 so the automation should have put labels on it. The pr is #3340

@tunglinn
Copy link
Member

tunglinn commented Jul 13, 2022

@JessicaLucindaCheng I think it's because there's a merge conflict. I mentioned a case similar to this in this comment #2933 (comment). Do we want it to run even if there's a merge conflict?

Another piece of evidence is that Lint SCSS didn't run either.

@tunglinn
Copy link
Member

I've been unable to replicate the bug.

Is it possible that it was a bug on the server side (GHA)?
https://www.githubstatus.com/ mentions some degraded performance around the time of the PRs with this bug.

@tunglinn
Copy link
Member

tunglinn commented Jul 16, 2022

Team has decided to close this issue and write up a decision report.

Decision report has my findings and recommended steps to take if the bug does appear again.

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 Bug Something isn't working Complexity: Medium 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 Status: Updated No blockers and update is ready for review Status: Urgent Needs to be worked on immediately
Projects
Development

No branches or pull requests

4 participants