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: Separate workflow to add/remove 'stale' label #7959

Merged
merged 2 commits into from
Sep 25, 2023

Conversation

totoprayogo1916
Copy link
Contributor

Description
Follow-up #7957

Checklist:

  • Securely signed commits

@totoprayogo1916 totoprayogo1916 marked this pull request as draft September 21, 2023 03:49
@kenjis kenjis added the github_actions Pull requests that update Github_actions code label Sep 21, 2023
@kenjis kenjis changed the title Separate workflow chore: Separate workflow to add/remove 'stale' label Sep 21, 2023
Copy link
Member

@kenjis kenjis left a comment

Choose a reason for hiding this comment

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

Not sure if it would work without the cronjob.
But let's merge and see.

@kenjis kenjis merged commit 79ae14f into codeigniter4:develop Sep 25, 2023
4 checks passed
@totoprayogo1916 totoprayogo1916 deleted the conflicting branch September 25, 2023 00:30
@kenjis
Copy link
Member

kenjis commented Sep 28, 2023

#7986 has conflict, but not labeled.

Screenshot 2023-09-28 15 34 50

@totoprayogo1916
Copy link
Contributor Author

#7986 has conflict, but not labeled.

When #7986 conflicts, is there a push on the develop or 4.x branch?

@totoprayogo1916
Copy link
Contributor Author

Or maybe a commit on the PR shows it's still a conflict.

I want to see where the job action has been going.

@kenjis
Copy link
Member

kenjis commented Sep 28, 2023

When #7986 conflicts, is there a push on the develop or 4.x branch?

Yes. #7967 was merged.
And the action is: https://github.com/codeigniter4/CodeIgniter4/actions/runs/6332904494/job/17200180659

@totoprayogo1916
Copy link
Contributor Author

The "mergeable" value is UNKNOWN
image

@kenjis
Copy link
Member

kenjis commented Sep 28, 2023

Yes.

And now I got my PRs (#7955, #7981) to be labeled after merging #7990

@kenjis
Copy link
Member

kenjis commented Sep 28, 2023

The value of the mergeable attribute can be true, false, or null. If the value is null, then GitHub has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-null value for the mergeable attribute in the response. If mergeable is true, then merge_commit_sha will be the SHA of the test merge commit.
https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request

The first merge returns UNKNOWN and then the value is determined.
So the next merge will return CONFLICTING and put the label.

@totoprayogo1916
Copy link
Contributor Author

The first merge returns UNKNOWN and then the value is determined.
So the next merge will return CONFLICT and put the label.

It's not always going to be of real value,
#6845 conflict has the value UNKNOWN, but in some jobs it is appropriate.

@ddevsr
Copy link
Collaborator

ddevsr commented Sep 29, 2023

I testing with schedule as already suggested by @totoprayogo1916, always revalidate limitable latest PR by get latest status mergeable when schedule running.

https://github.com/PHPDevsr/check-conflict-action/actions
https://github.com/PHPDevsr/playground/actions

@kenjis
Copy link
Member

kenjis commented Sep 29, 2023

I think "Run at every 6 minutes" is running too often.

In the case of UNKNOWN, I think if we wait some seconds before retrieving again, we can get the result.

@kenjis
Copy link
Member

kenjis commented Sep 29, 2023

Check Conflicts Remove label failed.
See #7992

@ddevsr
Copy link
Collaborator

ddevsr commented Sep 29, 2023

Before conflict https://github.com/codeigniter4/CodeIgniter4/actions/runs/6309422686/job/17129306013 success running with read permission because no have label stale to remove using write permission. And after conflict bot trigger added label and comment using. Many action running using permission read, I think this section of permission job.

https://github.com/PHPDevsr/check-conflict-action/actions
https://github.com/PHPDevsr/playground/actions

You can see 2 action running well with write permission

@kenjis
Copy link
Member

kenjis commented Sep 29, 2023

@ddevsr Sorry, I don't get what you say.
If you can fix the issue, please send a PR.

@totoprayogo1916
Copy link
Contributor Author

I think "Run at every 6 minutes" is running too often.

In the case of UNKNOWN, I think if we wait some seconds before retrieving again, we can get the result.

If only we could execute this action at the end instead of others.

@kenjis
Copy link
Member

kenjis commented Oct 3, 2023

Removed label-add-remove-conflict-single-pr.yml, because it does not work at all.
See #7999

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github_actions Pull requests that update Github_actions code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants