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

Project not found - Classic project #81

Open
BennyDeBock opened this issue Jul 31, 2022 · 17 comments
Open

Project not found - Classic project #81

BennyDeBock opened this issue Jul 31, 2022 · 17 comments

Comments

@BennyDeBock
Copy link

So I have been working on creating a workflow to put issues with the good first issue label onto a project board.

I've managed to make this work in an organisation, but it doesn't seem to work when using a public repository with a user project not belonging to an organisation.

https://github.com/BennyDeBock/test-gh-actions/runs/7598890181?check_suite_focus=true

https://github.com/users/BennyDeBock/projects/1/views/1

Here is the workflow I'm using.
https://github.com/BennyDeBock/test-gh-actions/blob/main/.github/workflows/project-board.yml

Is there something I'm doing wrong? or somewhere that i'm able to specify the url to the project?
@alex-page

@wnqueiroz
Copy link

I have a similar problem here, only in a private context... I'm trying to automate moving issues for a project within an organization. The repository and project are private. What am I doing wrong?

I configured the personal access token scopes in the link:

https://github.com/settings/tokens/new?scopes=repo,write:org&description=PERSONAL_ACCESS_TOKEN

My workflow is set up in an even simpler way:

name: "Foo"

on:
  issues:
    types: [opened]

jobs:
  automate-project-columns:
    runs-on: ubuntu-latest
    steps:
      - uses: alex-page/github-project-automation-plus@v0.8.1
        with:
          project: Foo
          column: Bar
          repo-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

I've also enabled SSO on the token...

Screenshot:

image

@SirMishaa
Copy link

SirMishaa commented Sep 22, 2022

Any up ?

We got the same issue for organization, it can't found the project, even with good permission of token.

@BennyDeBock
Copy link
Author

@SirMishaa Here you can see a working example I made in the past for the Vapor organisation https://github.com/vapor/ci/blob/main/.github/workflows/issues-to-project-board.yml

@Neehal-ATD
Copy link

Neehal-ATD commented Jan 28, 2023

I have this same problem, and I looked at the action failure logs. Looks like Node.js needs an upgrade, although I'm pretty new to all this so not sure if it's something I can do on my end or the action code's end.

image

Edit: Just saw this in another thread, I guess it's not really needed that much anymore. #76 (comment)

I'd love to see if it's possible to have our own custom actions though, would really open up quite some new workflow ideas with the custom fields that we can add in projects I believe.

@alex-page
Copy link
Owner

@Neehal-ATD this action supports NodeJS 16 as a minimum. See the latest commit into the repository.

@Neehal-ATD
Copy link

Neehal-ATD commented Jan 30, 2023

@alex-page Ah ok I think I found the issue; I'd copied the code from the examples you had on the GitHub Marketplace page which had v0.8.1 listed in the syntax, not 0.8.2. 🤦‍♂️I didn't really check if it was the latest version.
You can maybe update the version number on there. Thanks for the response, would not have realized otherwise 😆

@alex-page
Copy link
Owner

Updated the docs. Thanks Neehal!

@steph-crown
Copy link

@wnqueiroz, were you able to get the workflow to work? I get the same error as you did when I tried to use the workflow to move issues to a project in a private organization.

Run alex-page/github-project-automation-plus@v0.8.3
  with:
    project: Test Project
    column: In Progress
    repo-token: ***
    action: update
Error: Could not find the column "In Progress" or project "Test Project"

@OscarCasadoLorenzo
Copy link

Same issue as @wnqueiroz and @steph-crown .
@alex-page Do you know how to solve this problem?

@ianwesleyarmstrong
Copy link

Also ran into this with v0.8.3.

@alex-page
Copy link
Owner

I don't know how to solve this problem, I would have to dig through the API docs and replicate it myself. There might be some issues with the logic to find projects as it is meant to check your org and own repos. This might have been changed recently.

@steph-crown
Copy link

There is a possibility that this issue arises when using it with Beta projects.

@aptalca
Copy link

aptalca commented Mar 16, 2023

Is this action working with the new projects? I don't believe they're beta anymore. They are called projects or all new projects and the legacy ones are called classic projects.

Github deprecated the classic projects and it won't let you create new ones unless you already have existing classic projects.

Thanks

@alex-page
Copy link
Owner

The new projects have a lot of automation already built into them. I am unsure if this action is needed for them.

@stilnat
Copy link

stilnat commented Mar 19, 2023

same issue with 0.8.3
I tried to run the below job but that fails with Could not find the column "Triage" or project "Logs".
I have a public project called "Logs" with a "Triage" column in it.
My repo is public, here's the link, it was made just for testing this.
Let me know if someone knows what I'm doing wrong !

name: Move new issues into Triage

on:
  issues:
    types: [opened]

jobs:
  automate-project-columns:
    runs-on: ubuntu-latest
    steps:
      - uses: alex-page/github-project-automation-plus@v0.8.3
        with:
          project: Logs
          column: Triage
          repo-token: ${{ secrets.GITHUB_TOKEN }}

@jcpitre
Copy link

jcpitre commented May 18, 2023

I looked into it and the new projects will require new GraphQL queries. The query used by this action only return classic projects.
I am just beginning with GitHub so bear with me.
I ran the action in debug mode the GraphQL query sent by the action got this response:
{"projectCards":{"nodes":[]},"repository":{"projects":{"nodes":[]},"owner":{"projects":{"nodes":[]}}}}
Meaning Github sees no project in the repo and leading to the Could not find the column "Triage" or project "Logs"

I could not create a classic project, so the project I have created is V2.
I then used the GraphQL explorer (https://docs.github.com/en/graphql/overview/explorer) to issue a query that would return some info on the projectV2:

query {
  resource(url: "https://github.com/jcpitre/gtfs-validator/issues/1") {
    ... on Issue {
      repository {
        nameWithOwner
      	projectsV2( first: 10) {
      	  nodes {
            number
            title
            fields(first: 20) {
              nodes {
                ... on ProjectV2Field {
                  id
                  name
                }
                ... on ProjectV2SingleSelectField {
                  id
                  name
                  options {
                    id
                    name
                  }
              	}
              }  
            }
      	  }
      	}
      }
    }
  }
}

And the response was:

{
  "data": {
    "resource": {
      "repository": {
        "nameWithOwner": "jcpitre/gtfs-validator",
        "projectsV2": {
          "nodes": [
            {
              "number": 4,
              "title": "My Project",
              "fields": {
... skipped ...
                  {
                    "id": "PVTSSF_lAHOBlQeas4AQVirzgKbitA",
                    "name": "Status",
                    "options": [
                      {
                        "id": "f75ad846",
                        "name": "Column 1"
                      },
                      {
                        "id": "47fc9ee4",
                        "name": "Column 2"
                      }
                    ]
                  },

... etc

Meaning the column info is now in options of a Status node in the project. This seems pretty different to the way columns are obtained with classic projects. I would think it means some important changes are necessary to make this action work with project V2.
I did not investigate how to find the cards or how to mutate the projects.

@fredericsimard
Copy link

I've discovered that there is no need for an action with the new Projects, you can use Workflows to move issues and PRs in a project and put them in a specific column. More details here:

Hope this can help others!

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

No branches or pull requests