cc-archive / cccatalog-api

[PROJECT TRANSFERRED] The Creative Commons Catalog API allows programmatic access to search for CC-licensed and public domain digital media.
https://github.com/WordPress/openverse-api
MIT License
100 stars 122 forks source link

Create GitHub workflow for adding issues and PRs to appropriate project #438

Closed kgodey closed 4 years ago

kgodey commented 4 years ago

Problem Description

Currently, we need to manually add new issues to the CC Search backlog GitHub project. We'd like to automate this.

Solution Description

Set up a GitHub workflow (using GitHub Actions) to

Bonus features (not sure if these are possible)

Additional context

Maxslide commented 4 years ago

Hey, I would like to work on this issue. The newly created issues in this repo must be moved to which column in the CC search backlog? also the same Q for teh PR's which column must they be added in?

kgodey commented 4 years ago

@Maxslide go ahead.

We already have the project configured in GitHub to send new issues to the "Pending Review" column in the backlog and PRs to the "In Progress" column on the active sprint, so you shouldn't need to send it to any particular column, just add it to the project.

Maxslide commented 4 years ago

Alright, I'll try and work on this and get it resolved

Maxslide commented 4 years ago

I found something which seems to be a very easy method to do https://help.github.com/en/github/managing-your-work-on-github/configuring-automation-for-project-boards

Maxslide commented 4 years ago

This seems to be a good solution to our probelms https://github.com/philschatz/project-bot

kgodey commented 4 years ago

@Maxslide we want to set up a GitHub Action; we do not want alternate solutions. Please see this similar PR for an example: https://github.com/creativecommons/cccatalog-frontend/pull/710

I found something which seems to be a very easy method to do https://help.github.com/en/github/managing-your-work-on-github/configuring-automation-for-project-boards

The project automation you mentioned here does not work to add issues automatically to a project or to move them between project. It only works once the issue has been added to a project.

Maxslide commented 4 years ago

I belive i cant check if it works, please check and ket me know if it is working, i have not added any column name as they have already been assigned as mentioned by you earlier

Maxslide commented 4 years ago

https://github.com/creativecommons/cccatalog-api/issues/438#issuecomment-594798627 initially i was plannign to use this for the automation, but on seeing the reference PR you mentioned, i found that to be better and hence used that

Maxslide commented 4 years ago

Hey, i have sent a pull request, kinfly reveiw it

aldenstpage commented 4 years ago

I'm reopening this because we had to revert #441.

kgodey commented 4 years ago

Removing the "in progress" label and assignee.

rutujadhanawade commented 4 years ago

Hey, I would like to work on this. Can I work on this

outloudvi commented 4 years ago

The contents here are not useful before we figured out an acceptable way to add issues/prs to project. See the next comment.


For the bonuses:

  • automatically move PRs created by people that are not in the creativecommons GitHub organization to the "In Progress (Community)" column.
    • Should be doable since we have /orgs/:org/members, but that should require a fork of the original project. Maybe the forked actions should be put in CC's organization?
  • automatically move issues with linked PRs from the backlog project to the active sprint project.
    • I don't think GitHub links it actively (See here you don't find a "438"). Might be doable if we actively parse the comments in PR and commits.
outloudvi commented 4 years ago

I think this method will work and only work for issues with a prefilled token given with "write:org": in my test organization, it failed with GITHUB_TOKEN by itself, but worked with a pre-filled token with "read:org" and "write:org" permission. And notice that I'm the owner of my org, even this doesn't change the fact that GITHUB_TOKEN cannot write the organization projects (notice that it's organization projects, not repository). This is reasonable since an repository should not be able to write the settings of the organization.

For PR, as said in the doc,

You can use and read encrypted secrets in a workflow file if you have access to edit the file.

Therefore, PRs by outside contributors cannot read your secret and is not expected to edit the organization project.


As a result, I would say it might not be the right way to do that with GitHub Actions for organization projects. Reposotiry projects might work though.

I have configured the tests and confirmed they worked for myself, so:


References:

kgodey commented 4 years ago

@outloudvi I've added a secret with the appropriate permissions to this repo. You can access it by using secrets.ORG_GITHUB_TOKEN.