feat(seer): Add GitLab support to seer preferences endpoint#115424
Draft
billyvg wants to merge 1 commit into
Draft
feat(seer): Add GitLab support to seer preferences endpoint#115424billyvg wants to merge 1 commit into
billyvg wants to merge 1 commit into
Conversation
Add conditional GitLab SCM provider support to the project seer preferences endpoint, gated behind the existing organizations:seer-gitlab-support feature flag. When the flag is enabled on an org, the POST endpoint accepts GitLab repos (both 'gitlab' and 'integrations:gitlab' provider strings) and the GET endpoint includes GitLab repos from code mappings in the response. Introduces get_supported_scm_providers() helper that returns the base GitHub provider list extended with GitLab providers when the flag is active. The static SEER_SUPPORTED_SCM_PROVIDERS list remains unchanged for other consumers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.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.
Summary
/api/0/projects/{org}/{project}/seer/preferences/), gated behind the existingorganizations:seer-gitlab-supportfeature flag"gitlab"and"integrations:gitlab"provider strings, and GET includes GitLab repos from code mappings in the responseget_supported_scm_providers(organization)helper inseer/constants.pythat conditionally extends the provider list — the staticSEER_SUPPORTED_SCM_PROVIDERSlist is unchanged for other consumersChanges
src/sentry/seer/constants.py— Addedget_supported_scm_providers(),SEER_GITLAB_SCM_PROVIDERS, and expandedSeerSCMProvidertypesrc/sentry/seer/endpoints/project_seer_preferences.py— Overrodevalidate_provideronRepositorySerializerto use org-aware provider list; passed org context to serializersrc/sentry/seer/autofix/utils.py—get_autofix_repos_from_project_code_mappings()now usesget_supported_scm_providers()instead of static listTest plan
test_post_accepts_gitlab_repo_with_feature_flag— POST withintegrations:gitlabsucceeds when flag is ontest_post_accepts_gitlab_bare_provider_with_feature_flag— POST with baregitlabprovider succeeds when flag is ontest_post_rejects_unsupported_repo_providercovers the flag-off case (sendsgitlab, expects 400)test_includes_gitlab_repos_with_feature_flag— code mapping repos include GitLab when flag is ontest_filters_out_unsupported_providerscovers flag-off case for code mappings