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: update how we fetch workflow_id and legacy_rule_id from ru… #88748

Merged
merged 4 commits into from
Apr 4, 2025

Conversation

iamrajjoshi
Copy link
Member

i realized i made a mistake for how i fetch the workflow_id and legacy_rule_id.

the format that the noa passes down is:

data: RuleData = {
"actions": [cls.build_rule_action_blob(action, detector.project.organization.id)],
}

essentially

{
	"action" : [
			{
				...
			}
	]
}

@iamrajjoshi iamrajjoshi self-assigned this Apr 3, 2025
@iamrajjoshi iamrajjoshi requested review from a team as code owners April 3, 2025 21:37
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 3, 2025
@@ -44,7 +44,7 @@ def _get_workflow_urls(self, group, rules):
workflow_urls = []
for rule in rules:
# fetch the workflow_id from the rule.data
workflow_id = rule.data.get("workflow_id")
workflow_id = rule.data.get("actions", [{}])[0].get("workflow_id")
Copy link
Member

Choose a reason for hiding this comment

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

Extracting this logic into a helper function that pulls the workflow ID might make it a bit cleaner to modify in the future.

@iamrajjoshi iamrajjoshi requested a review from a team as a code owner April 4, 2025 14:41
@iamrajjoshi iamrajjoshi merged commit 1e2517b into master Apr 4, 2025
49 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/aci/fix-fetching-from-data-blob branch April 4, 2025 15:10
andrewshie-sentry pushed a commit that referenced this pull request Apr 8, 2025
…88748)

i realized i made a mistake for how i fetch the `workflow_id` and
`legacy_rule_id`.

the format that the noa passes down is:


https://github.com/getsentry/sentry/blob/fb887ee11cea9e130db2fea435c3f67a21313dab/src/sentry/notifications/notification_action/types.py#L130-L132

essentially
```
{
	"action" : [
			{
				...
			}
	]
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants