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]: Issue creation fails if the label is not present #530

Closed
gaiksaya opened this issue Oct 11, 2024 · 4 comments · Fixed by #551
Closed

[Bug]: Issue creation fails if the label is not present #530

gaiksaya opened this issue Oct 11, 2024 · 4 comments · Fixed by #551
Assignees
Labels
bug Something isn't working

Comments

@gaiksaya
Copy link
Member

Describe the bug

The createGithubIssue library fails if the a label is missing from the repo

To reproduce

See https://build.ci.opensearch.org/view/Build/job/distribution-build-opensearch/10382/console

+ gh issue create --title '[AUTOCUT] Distribution Build Failed for user-behavior-insights-3.0.0' --body '***Build Failed Error***: **user-behavior-insights failed during the distribution build for version: 3.0.0.**
                    Please see build log at https://build.ci.opensearch.org/job/distribution-build-opensearch/10382/display/redirect.
                    The failed build stage will be marked as unstable :warning: . Please see ./build.sh step for more details.
                    Checkout the [wiki](https://github.com/opensearch-project/opensearch-build/wiki/Building-an-OpenSearch-and-OpenSearch-Dashboards-Distribution) to reproduce the failure locally.' --label autocut,v3.0.0 --label untriaged --repo https://github.com/opensearch-project/user-behavior-insights.git
could not add label: 'autocut' not found

Expected behavior

Either ignore the label if not present or create a new one.

Screenshots

If applicable, add screenshots to help explain your problem.

Host / Environment

No response

Additional context

No response

Relevant log output

No response

@gaiksaya
Copy link
Member Author

Adding @prudhvigodithi @peterzhuamazon to add thoughts. I think we should create the missing labels instead of ignoring. WDYT?

@prudhvigodithi
Copy link
Member

prudhvigodithi commented Oct 11, 2024

The autocut is basic label the repo should have and the jenkins workflow expects the same, the release labels are auto created with the workflows part of our repo (https://github.com/opensearch-project/opensearch-build/blob/main/.github/workflows/os-increment-plugin-versions.yml#L103), we can even add a logic if autocut does not exist to create one in the same jenkins workflow, but with this we will have label creation logic now at multiple places :).

@gaiksaya
Copy link
Member Author

The autocut is basic label the repo should have and the jenkins workflow expects the same, the release labels are auto created with the workflows part of our repo (https://github.com/opensearch-project/opensearch-build/blob/main/.github/workflows/os-increment-plugin-versions.yml#L103), we can even add a logic if autocut does not exist to create one in the same jenkins workflow, but with this we will have label creation logic now at multiple places :).

That is fine right? If the label exists all the workflows will use the same but for missing ones, not sure if we have any GH command to ignore the label if not present.

@Divyaasm
Copy link
Collaborator

We can add a check for the label and create a new label if doesn't exist and proceed with the issue creation after label creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

3 participants