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

Automatically update more GitHub projects. #94921

Merged
merged 3 commits into from
Aug 30, 2022
Merged

Conversation

ezio-melotti
Copy link
Member

@ezio-melotti ezio-melotti commented Jul 17, 2022

This PR updates the workflows so that issues labeled expert-asyncio are automatically added to the corresponding project.

I also updated the project itself:

  • add views for bugs, features, docs
  • reorganized/added a few columns
  • set the status to Todo on all the issues with No status
  • enabled a few project workflows to automatically updated the status
  • added all the remaining open issues with the expert-asyncio label

Edit: the workflow was updated to use a matrix to update more projects.

@arhadthedev
Copy link
Member

arhadthedev commented Jul 17, 2022

Can it be generalized with a matrix? It will make future additions easier.

  add-to-projects:
    name: Add to projects
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - project: 29
            label: expert-asyncio
    steps:
      - uses: actions/[email protected]
        with:
          project-url: https://github.com/orgs/python/projects/${{ matrix.project }}
          github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
          labeled: ${{ matrix.label }}

Or, if we need a compact, single-row-per-element representation:

  add-to-projects:
    name: Add to projects
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - { project: 29, label: expert-asyncio }
    steps:
      - uses: actions/[email protected]
        with:
          project-url: https://github.com/orgs/python/projects/${{ matrix.project }}
          github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
          labeled: ${{ matrix.label }}

BTW, I've checked the actions with https://rhysd.github.io/actionlint/, they seem to have no error.

@ezio-melotti
Copy link
Member Author

Can it be generalized with a matrix? It will make future additions easier.

Interesting idea! I'm doing this incrementally to make sure that everything works before adding a bunch of projects, but we could try with a couple and see if it works well, and if it does add the others.

This solution will work well if there is only a single label (e.g. the expert-* ones), but in theory something like this might work too:

      matrix:
        include:
          - { project: 2, label: release-blocker, deferred-blocker }
          - { project: 29, label: expert-asyncio }

The action's label-operator defaults to OR, so there's no need to specify it, but label: release-blocker, deferred-blocker might need to be quoted.

@ezio-melotti ezio-melotti changed the title Automatically update the asyncio GitHub project. Automatically update more GitHub projects. Jul 17, 2022
.github/workflows/project-updater.yml Outdated Show resolved Hide resolved
Co-authored-by: Hugo van Kemenade <[email protected]>
@ezio-melotti ezio-melotti merged commit 45fd368 into main Aug 30, 2022
@ezio-melotti ezio-melotti deleted the add-to-asyncio-proj branch August 30, 2022 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants