improvement(FF): CI check to prevent hardcoding of FFs#2790
Merged
icecrasher321 merged 3 commits intostagingfrom Jan 13, 2026
Merged
improvement(FF): CI check to prevent hardcoding of FFs#2790icecrasher321 merged 3 commits intostagingfrom
icecrasher321 merged 3 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile SummaryThis PR enhances the CI workflow to prevent hardcoded feature flags by adding two validation checks: (1) detecting hardcoded boolean literals like Key improvements:
Issues found:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant CI as GitHub Actions CI
participant Checkout as Checkout Code
participant Validation as Feature Flag Validation
participant File as feature-flags.ts
participant Perl as Perl Pattern Matcher
participant Grep as Grep Pattern Matcher
participant Lint as Lint Check
CI->>Checkout: Start workflow
Checkout->>CI: Code checked out
CI->>Validation: Run validation step
Validation->>File: Read feature-flags.ts
Note over Validation,Perl: Check 1: Hardcoded Booleans
Validation->>Perl: perl -0777 multiline regex
Perl->>Perl: Search for "export const is* = true/false"
Perl-->>Validation: Return matches (if any)
alt Hardcoded booleans found
Validation->>CI: ❌ Exit 1 - Hardcoded flags detected
else No hardcoded booleans
Note over Validation,Grep: Check 2: Naming Conventions
Validation->>Grep: grep -E lowercase exports
Grep->>Grep: Filter out "is" and "get" prefixes
Grep-->>Validation: Return non-compliant names
alt Bad naming found
Validation->>CI: ❌ Exit 1 - Invalid naming
else All checks pass
Validation->>CI: ✅ Validation passed
CI->>Lint: Continue to lint
end
end
|
Contributor
Additional Comments (2)
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/sim/lib/core/config/feature-flags.ts
Line: 24:24
Comment:
This hardcoded `true` value violates the CI check you just added. The new CI workflow will fail on this exact line.
```suggestion
export const isHosted =
getEnv('NEXT_PUBLIC_APP_URL') === 'https://www.sim.ai' ||
getEnv('NEXT_PUBLIC_APP_URL') === 'https://www.staging.sim.ai'
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: apps/sim/lib/core/config/feature-flags.ts
Line: 4:4
Comment:
`getEnv` is still needed for `isHosted`
```suggestion
import { env, getEnv, isFalsy, isTruthy } from './env'
```
How can I resolve this? If you propose a fix, please make it concise. |
Collaborator
Author
|
@greptile |
Collaborator
Author
|
@greptile |
waleedlatif1
pushed a commit
that referenced
this pull request
Jan 13, 2026
* improvement(FF): CI check to prevent hardcoding of FFs * revert test change * add FF lint checks
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
Prevent hardcoding of feature flags.
Type of Change
Testing
Testing via CI
Checklist