Skip to content

Add feature flags for Pinecone, Cloudinary, and GitLab OAuth detectors#4961

Open
camgunz wants to merge 10 commits into
mainfrom
feature-flag-new-detectors
Open

Add feature flags for Pinecone, Cloudinary, and GitLab OAuth detectors#4961
camgunz wants to merge 10 commits into
mainfrom
feature-flag-new-detectors

Conversation

@camgunz
Copy link
Copy Markdown
Contributor

@camgunz camgunz commented May 13, 2026

Description:

Puts the Pinecone, Cloudinary, and GitLab OAuth detectors behind feature flags.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

@camgunz camgunz requested a review from a team May 13, 2026 13:23
@camgunz camgunz requested a review from a team as a code owner May 13, 2026 13:23
Comment thread pkg/feature/feature.go Outdated
Comment on lines +19 to +21
PineconeDetector atomic.Bool
CloudinaryDetector atomic.Bool
GitLabOAuthDetector atomic.Bool
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just wondering if it would be better to add Enabled suffix since this is a bool

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure!

Copy link
Copy Markdown
Contributor

@amanfcp amanfcp left a comment

Choose a reason for hiding this comment

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

Just trying to understand the motivation: what prompted flagging these three specifically?

Another thing from OSS perspective is that since atomic.Bool defaults to false and main.go does not .Store(true) these (the way it does for EnableAPKHandler, UseGitMirror, etc.), OSS users on main will silently lose these three detectors with no CLI way to turn them back on. Might be worth a release-note callout, or wiring a flag.

@camgunz
Copy link
Copy Markdown
Contributor Author

camgunz commented May 13, 2026

Another thing from OSS perspective is that since atomic.Bool defaults to false and main.go does not .Store(true) these
Ooh I did forget that; will work it up, thanks

Comment thread main.go Outdated
Comment thread pkg/engine/defaults/defaults.go Outdated
Comment thread pkg/engine/defaults/defaults.go
Copy link
Copy Markdown
Contributor

@amanfcp amanfcp left a comment

Choose a reason for hiding this comment

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

LGTM. We just need to find a way to exclude them from the test that is failing

Copy link
Copy Markdown
Contributor

@mustansir14 mustansir14 left a comment

Choose a reason for hiding this comment

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

LGTM. For the failing test, you will need to add these detectors to excludedFromDefaultList in the test, ideally in a separate section with a comment explaining why it was added.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e59c77d. Configure here.

Comment thread pkg/engine/defaults/defaults_test.go
@camgunz
Copy link
Copy Markdown
Contributor Author

camgunz commented May 20, 2026

Yeah I wanted to try and minimize the number of changes needed to feature flag a detector, but I think this is what we have to do for now.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants