Skip to content

feat: Added gitlab as vcsprovider in codereference#7201

Open
SahilJat wants to merge 1 commit intoFlagsmith:mainfrom
SahilJat:feat/gitlab-as-vcsprovider
Open

feat: Added gitlab as vcsprovider in codereference#7201
SahilJat wants to merge 1 commit intoFlagsmith:mainfrom
SahilJat:feat/gitlab-as-vcsprovider

Conversation

@SahilJat
Copy link
Copy Markdown
Contributor

Thanks for submitting a PR! Please check the boxes below:

  • [ x ] I have read the Contributing Guide.
  • [ x ] I have added information to docs/ if required so people know about the feature.
  • [ x ] I have filled in the "Changes" section below.
  • [ x ] I have filled in the "How did you test this code" section below.

Changes

Closes #7134

Please describe.
Types: Added GITLAB to VCSProvider and included vcs_provider in CodeReferencesRepositoryCount.

Models: Added vcs_provider to FeatureFlagCodeReferencesScan with a default of "github". Generated the corresponding migration.

Services: Updated _get_permalink() to handle GitLab's specific file permalink format (/-/blob/{revision}/{file_path}#L{line_number}).

Serializers: Exposed vcs_provider in the upload serializer and the count serializer.

Views: Updated the Feature list API (code_references_counts) to expose the vcs_provider.

How did you test this code?

Please describe.
Added unit tests for _get_permalink() covering both public and self-hosted GitLab URLs (with and without trailing slashes).

Added view tests for the POST .../code-references/ endpoint to verify it accepts "gitlab", rejects invalid providers, and defaults to "github".

Added view tests for the Detail view to verify GitLab scans return the correct /-/blob/ permalinks.

Updated feature list API tests to assert vcs_provider is present in code_references_counts.

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@SahilJat SahilJat requested a review from a team as a code owner April 10, 2026 09:47
@SahilJat SahilJat requested review from gagantrivedi and removed request for a team April 10, 2026 09:47
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

@SahilJat is attempting to deploy a commit to the Flagsmith Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the api Issue related to the REST API label Apr 10, 2026
@SahilJat SahilJat force-pushed the feat/gitlab-as-vcsprovider branch 2 times, most recently from a2ebc9d to a97f79b Compare April 10, 2026 09:58
@SahilJat SahilJat changed the title Added gitlab as vcsprovider in codereference feat: Added gitlab as vcsprovider in codereference Apr 10, 2026
LiveReview Pre-Commit Check: skipped

LiveReview Pre-Commit Check: skipped
@SahilJat SahilJat force-pushed the feat/gitlab-as-vcsprovider branch from 20b6998 to 90133a2 Compare April 10, 2026 10:20
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.28%. Comparing base (9e3edac) to head (90133a2).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7201      +/-   ##
==========================================
- Coverage   98.35%   98.28%   -0.08%     
==========================================
  Files        1348     1349       +1     
  Lines       50691    50603      -88     
==========================================
- Hits        49859    49736     -123     
- Misses        832      867      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Issue related to the REST API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Code References: Add GitLab as a VCS provider (backend)

1 participant