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

Update triage automation to use new project board and github projectV2 API #13962

Merged
merged 1 commit into from Apr 25, 2023

Conversation

r0qs
Copy link
Member

@r0qs r0qs commented Feb 11, 2023

Fixes #13892

It requires the PAT named PROJECT_BOARD_AUTOMATION with the following permissions:

repo
read:project

@cameel
Copy link
Member

cameel commented Feb 16, 2023

Unassigning @matheusaaguiar. Looks like I assigned him yesterday by accident instead of adding him as a reviewer :) Sorry for the confusion.

matheusaaguiar
matheusaaguiar previously approved these changes Feb 16, 2023
Copy link
Collaborator

@matheusaaguiar matheusaaguiar left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@cameel cameel left a comment

Choose a reason for hiding this comment

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

Looks good on the surface, I'm assuming you tested it though because I did not go too deep into details of the commands. At least looks like it should either work or break in an obvious way.

I mostly have some stylistic/readability comments. Also one question about behavior in case the issue is already on the board.

.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Outdated Show resolved Hide resolved
.github/workflows/triage.yml Show resolved Hide resolved
@@ -6,11 +6,10 @@ on:
- opened

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.PROJECT_BOARD_AUTOMATION }}
Copy link
Member

Choose a reason for hiding this comment

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

Commenting on it to remember that we need to change this before we merge.

Copy link
Member

Choose a reason for hiding this comment

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

Looks like we already have it there. Last updated in September though - hopefully it's up to date.

@r0qs
Copy link
Member Author

r0qs commented Feb 24, 2023

Just realized now that as we are migrating from the classic GH project API we could actually just use the actions/add-to-project. The configuration would be much simpler and we would not be required to deal directly with the graphql API. Anyway, either will work, so I can replace the action by something like below and activate the Item added to project workflow in the project settings if you think it is better to outsource the maintenance of this action:

jobs:
  add-to-project:
    name: Add issue ${{ github.event.issue.number }} to Triage column
    runs-on: ubuntu-latest
    steps:
      - uses: actions/add-to-project@v0.4.0
        with:
          project-url: https://github.com/orgs/${{ env.ORGANIZATION }}/projects/${{ env.PROJECT_NUMBER }}
          github-token: ${{ secrets.PROJECT_BOARD_AUTOMATION }}

However, using the graphql API directly give us more control over the project boards and allows us to manage everything from one place (i.e. the action config).

@github-actions
Copy link

github-actions bot commented Apr 1, 2023

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Apr 1, 2023
@r0qs r0qs removed the stale The issue/PR was marked as stale because it has been open for too long. label Apr 1, 2023
@cameel cameel requested a review from nikola-matic April 6, 2023 15:05
@github-actions
Copy link

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Apr 25, 2023
@r0qs r0qs removed the stale The issue/PR was marked as stale because it has been open for too long. label Apr 25, 2023
cameel
cameel previously approved these changes Apr 25, 2023
Copy link
Member

@cameel cameel left a comment

Choose a reason for hiding this comment

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

Just realized now that as we are migrating from the classic GH project API we could actually just use the actions/add-to-project.

Yeah, using an official action would be a better solution. The GraphQL API is really not great for our use case because even the simplest things (like this PR) look overcomplicated. And I don't think we need all of its flexibility now.

Still, we need this solved already so that we can close the old project board. I'm going to merge it anyway and you can refactor it in a follow-up PR.

.github/workflows/triage.yml Outdated Show resolved Hide resolved
@cameel cameel enabled auto-merge April 25, 2023 15:23
@cameel cameel merged commit 14c25c3 into develop Apr 25, 2023
57 checks passed
@cameel cameel deleted the triage-issues-new-board branch April 25, 2023 16:15
@cameel
Copy link
Member

cameel commented Apr 26, 2023

@r0qs It's failing: https://github.com/ethereum/solidity/actions/runs/4808604722/jobs/8558790280

Maybe the token is outdated after all?

@cameel
Copy link
Member

cameel commented Apr 26, 2023

By the way, we should switch this to non-dry run because it's not "dry" anyway. Merging this PR disabled the old mechanism and we have nothing in place.

@r0qs
Copy link
Member Author

r0qs commented Apr 26, 2023

@r0qs It's failing: https://github.com/ethereum/solidity/actions/runs/4808604722/jobs/8558790280

Maybe the token is outdated after all?

Yes, it looks liked. Can you renew it and ensure that it has the following permissions?

repo
read:project

@r0qs
Copy link
Member Author

r0qs commented Apr 26, 2023

By the way, we should switch this to non-dry run because it's not "dry" anyway. Merging this PR disabled the old mechanism and we have nothing in place.

Please see: #14161

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.

Move triage to the bug traging board
3 participants