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

Fix getting label by name #5414

Merged
merged 1 commit into from
Jan 14, 2025
Merged

Fix getting label by name #5414

merged 1 commit into from
Jan 14, 2025

Conversation

Ferril
Copy link
Member

@Ferril Ferril commented Jan 14, 2025

What this PR does

Handle JSONDecodeError on getting label key by name

Checklist

  • Unit, integration, and e2e (if applicable) tests updated
  • Documentation added (or pr:no public docs PR label added if not required)
  • Added the relevant release notes label (see labels prefixed w/ release:). These labels dictate how your PR will
    show up in the autogenerated release notes.

@Ferril Ferril added pr:no public docs Added to a PR that does not require public documentation updates release:ignore PR will not be added to release notes labels Jan 14, 2025
@Ferril Ferril requested a review from a team as a code owner January 14, 2025 12:44
@@ -44,7 +45,7 @@ def get_or_create_by_name(cls, organization: "Organization", key_name: str) -> t
label, _ = LabelsAPIClient(organization.grafana_url, organization.api_token).get_label_by_key_name(
label_key
)
except LabelsRepoAPIException as e:
except (LabelsRepoAPIException, JSONDecodeError) as e:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exact case it's handling?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we get empty response from label repo (not sure why it happens)

@Ferril Ferril added this pull request to the merge queue Jan 14, 2025
Merged via the queue into dev with commit dcb3741 Jan 14, 2025
30 checks passed
@Ferril Ferril deleted the julia/fix-getting-label-by-name branch January 14, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:no public docs Added to a PR that does not require public documentation updates release:ignore PR will not be added to release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants