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

Malformed label error for labels including a colon #65

Closed
pmeier opened this issue Sep 24, 2020 · 2 comments
Closed

Malformed label error for labels including a colon #65

pmeier opened this issue Sep 24, 2020 · 2 comments

Comments

@pmeier
Copy link

pmeier commented Sep 24, 2020

We use labels might include a colon such as module: datasets. The label section of the issue template looks like this:

labels: 
    - bug
    - "module: datasets"

Trying to open an issue with this template fails (see https://github.com/pytorch/vision/actions/runs/271212579 for an example):

⬤  debug     Reading from file .github/failed_schedule_issue_template.md
ℹ  info      Front matter for .github/failed_schedule_issue_template.md is { title: 'Scheduled workflow {{ env.WORKFLOW }}/{{ env.JOB }} failed',
  labels: [ 'bug', 'module: datasets' ] }
⬤  debug     Templates compiled { body:
   'Oh no, something went wrong in the scheduled workflow tests/download. \nPlease look into it:\n\nhttps://github.com/pytorch/vision/actions/runs/271212579\n\nFeel free to close this if this was just a one-off error.\n',
  title: 'Scheduled workflow tests/download failed' }
ℹ  info      Creating new issue Scheduled workflow tests/download failed
✖  error     An error occurred while creating the issue. This might be caused by a malformed issue title, or a typo in the labels or assignees. Check .github/failed_schedule_issue_template.md!
✖  error     HttpError: Resource not accessible by integration 
    at response.text.then.message (/node_modules/@octokit/request/dist-node/index.js:66:23)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Error: An error occurred while creating the issue. This might be caused by a malformed issue title, or a typo in the labels or assignees. Check .github/failed_schedule_issue_template.md!

It seems that label is correctly recognized as string. Thus, I assume some internal parsing is causing this.

@pmeier
Copy link
Author

pmeier commented Sep 25, 2020

@JasonEtco I've debugged this locally and it seems the issue lies with tools.github.issues.create:

create-an-issue/index.js

Lines 42 to 48 in e6b4b19

const issue = await tools.github.issues.create({
...tools.context.repo,
...templated,
assignees: assignees ? listToArray(assignees) : listToArray(attributes.assignees),
labels: listToArray(attributes.labels),
milestone: tools.inputs.milestone || attributes.milestone
})

I've created a local test with the same labels as above and it runs fine. Given that the GitHub API call is mocked out, I suspect the problem there. Since you are also the owner of JasonEtco/actions-toolkit could you transfer this issue if my hunch is right?

@pmeier
Copy link
Author

pmeier commented Sep 25, 2020

Ignore this. I was able to create an issue with the exact same template in a clean repository. Thus, I now suspect our repo configuration is somehow messed up.

The only thing you could take from here is probably a better error message. I was hung up on the "unusual label" and it took me quite some time to figure out that it has nothing to do with it.

@pmeier pmeier closed this as completed Sep 25, 2020
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

1 participant