enBloc-org / kindly

GNU General Public License v3.0
11 stars 16 forks source link

🐞 automation workflow error #240

Closed camelPhonso closed 1 day ago

camelPhonso commented 3 weeks ago

Expected Behaviour

There are a few workflow files in the codebase intended to help the core team manage the progress of Issues in the project.

Two of these workflows should move Issues between the Backlog and the In Progress states as collaborators get assigned/unassigned.

Current Behaviour

The workflows move-issue-to-backlog.yml and move-issue-to-in-progress.yml both fail with the following error:

`issue` is not a valid event name

Steps to Reproduce

  1. Visit the Actions tab in the Repo
  2. Select the relevant workflow on the left-side panel
  3. View the logs on previous runs
mnixo commented 2 weeks ago

Can I take this one?

camelPhonso commented 2 weeks ago

All yours Bubba!

mnixo commented 2 weeks ago

This one ended up being a bit of a rabbit hole. Unfortunately I couldn't find a good solution for it, but at least I'll leave here all the steps that I took.

Can we just fix the event name?

The (starting) error message is pretty clear. issue is not a valid GitHub Actions event type. This probably came from the example provided for the action being used. Using issues should fix the issue. It doesn't:

Error: Target column does not exist on project. Please use a different column name

My fork environment seems to replicate the original one just fine: public repository and private project. So no, we can't just fix the event name.

Can we just use a different action?

This action seems outdated and doesn't seem to be widely adopted, we could try to use a different one. I found an official GitHub article: Moving assigned issues on projects (classic). It uses a different action: alex-page/github-project-automation-plus. Let's try it. Another issue:

Error: Could not find the column "In Progress" or project "Kindly (enBloc)"

I've set up a dedicated PAT for this (as described in the doc), so this shouldn't be happening. I found a fairly new issue of the action that describes this same problem. It seems that the action is no longer compatible with the GitHub API. The owner is considering archiving the action, stating:

A lot of the functionality is already built into GitHubs UI with projects.

I also found that GitHub just announced the sunsetting of the Projects (classic) feature. This might explain why actions like these have stopped working. So no, we can't just use a different action.

Can we just use the GitHub UI Project automations instead?

There are a few built-in automations that can be used, with most of them being fairly customizable. Unfortunately I couldn't find one that would fit this use case. So no, we can't just use the GitHub UI Project automations instead?

Is there some API we can use directly to make this happen?

The only Projects API described in GitHub's REST API documentation seems to be Projects (classic), which has been sunset. On the other hand, the GraphQL API shows ProjectV2 objects. After playing a bit with GitHub's GraphQL Explorer, I still couldn't get the column information for an issue in a view of a project.

My Sample Query ``` query { repository(owner:"mnixo", name:"kindly") { projectsV2(first: 10) { nodes { title items(first: 10) { nodes { id type createdAt creator { login } project { id } type updatedAt } } views(first: 10) { nodes { name } } } } } ```
My Sample Query Results ``` { "data": { "repository": { "projectsV2": { "nodes": [ { "title": "Kindly (enBloc)", "items": { "nodes": [ { "id": "PVTI_lAHOAEBxCM4Ai8yKzgP4aHM", "type": "ISSUE", "createdAt": "2024-06-07T20:14:22Z", "creator": { "login": "mnixo" }, "project": { "id": "PVT_kwHOAEBxCM4Ai8yK" }, "updatedAt": "2024-06-07T21:33:36Z" } ] }, "views": { "nodes": [ { "name": "View 1" } ] } } ] } } } } ```

I couldn't get there myself, but I also found this other issue describing that the ProjectsV2 GraphQL API can't be used to move an issue to a different column anyway. So no, I couldn't find some API that we can use directly to make this happen.

TL;DR

I tried a few different options but nothing worked out. GitHub is moving from classic to V2 Project APIs and the parity (for what we need) doesn't seem to be there yet. Maybe we'll get more APIs and actions at some point. Any suggestions are welcome. If nothing pops up, it'll be probably wise to drop this project management shortcut for now.

camelPhonso commented 2 weeks ago

Thanks for sharing the notes from your spike @mnixo

Is it worth adding the help wanted label or marking this as blocked for a few days and see if anyone spots it and can point us to a different option?

This one is not strictly necessary to the product, it's just to give the core team a better experience of moving issues along the board as people pick them up, so if we really come up with nothing we can remove the workflow entirely and worry later about any other options if needed

mnixo commented 2 weeks ago

I believe it's worth keeping this one open for now, hopefully someone else can make use of my investigation and come up with an alternative approach.

For the time being both workflows are definitely broken. Perhaps we can just disable them in the GitHub UI to prevent additional failed runs.

camelPhonso commented 2 weeks ago

I believe it's worth keeping this one open for now, hopefully someone else can make use of my investigation and come up with an alternative approach.

For the time being both workflows are definitely broken. Perhaps we can just disable them in the GitHub UI to prevent additional failed runs.

Agreed. I've disabled them now and am marking this issue as needing help to see if we can prop other ideas 👍