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

[BUG]: New label is not created on creating a new github issue #479

Open
1 task done
rndquu opened this issue Jan 17, 2025 · 2 comments
Open
1 task done

[BUG]: New label is not created on creating a new github issue #479

rndquu opened this issue Jan 17, 2025 · 2 comments
Labels
Type: Support Any questions, information, or general needs around the SDK or GitHub APIs

Comments

@rndquu
Copy link

rndquu commented Jan 17, 2025

What happened?

We have this code that creates a new github issue. In particular it sets labels in the labels property.

Regarding the labels property, the create issue API says that NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise..

As far as I understand when labels property is set then octokit.rest.issues.create method tries to create those labels first, and if label creation failed then github issue is created anyway but without the failed label.

The code was working fine but suddenly, 4 days ago, it stopped creating new labels. We authorize octokit as a github app which has all the read/write repository permissions selected.

I've tried running this code with a personal github PAT and it worked as expected (i.e. necessary labels were created).

So overall I'm not really sure where to proceed, help.

Thanks in advance.

Versions

octokit: 2.0.14
@octokit/rest: 21.1.0
node: 20.10.0

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct
@rndquu rndquu added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented labels Jan 17, 2025
Copy link
Contributor

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@wolfy1339 wolfy1339 added Type: Support Any questions, information, or general needs around the SDK or GitHub APIs and removed Type: Bug Something isn't working as documented Status: Triage This is being looked at and prioritized labels Jan 17, 2025
@rndquu
Copy link
Author

rndquu commented Jan 24, 2025

Update: this seems like a bug in the octokit lib.

We authorize octokit as a github app which has read/write permissions for content, issues and PRs.

When new github issue is created and there's a new label (which is not yet present in the repository) then the issue is created but without a new label.

But when we manually create a new label before issue creation then, after issue creation, a newly created label is in place.

Expected behavior: octokit.rest.issues.create() creates a new github issue with all the labels specified in the labels property even if those labels are not yet created in the repository.

It only happens when we authorize octikit as a github app, I couldn't reproduce it using github PAT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects
Status: 🆕 Triage
Development

No branches or pull requests

2 participants