fix(ACI): Require 'repo' to be passed when creating GitHub ticket action#114095
Merged
fix(ACI): Require 'repo' to be passed when creating GitHub ticket action#114095
Conversation
saponifi3d
reviewed
Apr 27, 2026
Comment on lines
+128
to
+129
| if not self.validated_data.get("data", {}).get("additional_fields", {}).get("repo"): | ||
| raise ValidationError("'repo' is required") |
Contributor
There was a problem hiding this comment.
since this is on the data field, could we just use the data_schema to enforce it on handler to enforce the json schema?
Contributor
|
PR reverted: a630f3f |
ceorourke
pushed a commit
that referenced
this pull request
May 1, 2026
…ma and selective test fix (#114500) ## Summary Re-applies #114095 (reverted in a630f3f due to a CI failure that selective testing had missed) **Original change (re-landed):** - Adds a `data_schema` to `GithubActionHandler` requiring `repo` in `additional_fields`, so the API rejects GitHub ticketing actions created without a repo. - Makes `GithubEnterpriseActionHandler` inherit from `GithubActionHandler` to pick up the same validation. **Schema fix:** - Removes `integration` from `required` in `additional_fields`. The `IssueAlertMigrator` translator moves `integration` into `Action.integration_id` (a dedicated model field), so it never lands in `additional_fields`. Requiring it in the schema caused `action.save()` to raise a `ValidationError` when serializing existing GitHub/GithubEnterprise rules via `WorkflowEngineRuleSerializer`. --- edit: this doesn't really work so i'm prioritizing getting this PR back in and overriding selective testing for now **Selective testing fix:** - Adds explicit `import sentry.integrations.github.handlers` and `import sentry.integrations.github_enterprise.handlers` at the top of `test_rule.py`. Both handlers self-register via `@action_handler_registry.register` at import time (a Django startup side-effect), which means the static import scanner had no edge from the handler files to `test_rule.py`. The explicit imports make the dependency traceable, so future handler changes will select this test. --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
cleptric
pushed a commit
that referenced
this pull request
May 5, 2026
…ion (#114095) We have some front end validation here but if using the API directly it's possible to create a GitHub ticketing workflow that can't function if you fail to pass in the repo name. This PR adds validation on the GitHub ticketing action to make sure it's passed.
cleptric
pushed a commit
that referenced
this pull request
May 5, 2026
…ma and selective test fix (#114500) ## Summary Re-applies #114095 (reverted in a630f3f due to a CI failure that selective testing had missed) **Original change (re-landed):** - Adds a `data_schema` to `GithubActionHandler` requiring `repo` in `additional_fields`, so the API rejects GitHub ticketing actions created without a repo. - Makes `GithubEnterpriseActionHandler` inherit from `GithubActionHandler` to pick up the same validation. **Schema fix:** - Removes `integration` from `required` in `additional_fields`. The `IssueAlertMigrator` translator moves `integration` into `Action.integration_id` (a dedicated model field), so it never lands in `additional_fields`. Requiring it in the schema caused `action.save()` to raise a `ValidationError` when serializing existing GitHub/GithubEnterprise rules via `WorkflowEngineRuleSerializer`. --- edit: this doesn't really work so i'm prioritizing getting this PR back in and overriding selective testing for now **Selective testing fix:** - Adds explicit `import sentry.integrations.github.handlers` and `import sentry.integrations.github_enterprise.handlers` at the top of `test_rule.py`. Both handlers self-register via `@action_handler_registry.register` at import time (a Django startup side-effect), which means the static import scanner had no edge from the handler files to `test_rule.py`. The explicit imports make the dependency traceable, so future handler changes will select this test. --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have some front end validation here but if using the API directly it's possible to create a GitHub ticketing workflow that can't function if you fail to pass in the repo name. This PR adds validation on the GitHub ticketing action to make sure it's passed.