Repository navigation
Conversation
|
|
Hi @ghazy2001, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
|
Caution Review failedThe pull request is closed. Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| const validOrgFlags = orgFeatureFlags ? parseStoredOrgFlags(orgFeatureFlags).valid : {}; | ||
| return { ...globalFlags, ...validOrgFlags }; |
There was a problem hiding this comment.
🟡 Flag fix missing server release note
When stored flags contain an invalid entry, mergeOrgFeatureFlags now restores valid overrides and changes users' navigation. The required server release note is absent.
Learn more
The server-only release-note rule requires a .server-changes/ entry for a user-visible webapp bug fix. OrganizationsPresenter passes these flags to the side menu, where valid overrides reveal or hide navigation. No release-note file was added with this change.
Example: An org has hasLogsPageAccess: true and an invalid snapshotStoreMode. Its Logs navigation returns after this fix; users notice that change.
Recommended fix: Add a .server-changes/ file with area: webapp, type: fix, and a one-line description of restored organization features.
Was this helpful? React with 👍 or 👎 to provide feedback.
| it("preserves valid org flags when an invalid flag is present in stored org flags", () => { | ||
| const result = mergeOrgFeatureFlags(globalFlags, { | ||
| [FEATURE_FLAG.hasLogsPageAccess]: true, | ||
| [FEATURE_FLAG.snapshotStoreMode]: "invalid-mode", | ||
| }); |
There was a problem hiding this comment.
🟡 New flag tests lack regression comments
The new mergeOrgFeatureFlags tests omit the required // Catches: regression comments. Their intended regressions remain undocumented for future reviewers.
Learn more
Repository testing guidance requires a one-line // Catches: <bug> comment naming the specific regression each new unit test protects against. The added merge tests contain no such comments, including the test that protects the invalid-stored-flag regression.
Example: The test with hasLogsPageAccess: true and snapshotStoreMode: "invalid-mode" protects against one invalid stored flag suppressing a valid override, but its regression is not named.
Recommended fix: Add the required // Catches: comments to retained tests and remove any added cases that cannot identify a distinct regression.
Was this helpful? React with 👍 or 👎 to provide feedback.
Fixes #5058
Background & Issue
When
mergeOrgFeatureFlagsmerged stored organization flags onto global flags, it invokedvalidatePartialFeatureFlags(orgFeatureFlags). BecausevalidatePartialFeatureFlagsvalidates the object as a whole, a single invalid or deprecated flag in an organization's stored flags caused the entire parse to fail. Consequently, all valid org flag overrides were dropped and reverted to global defaults.Solution
mergeOrgFeatureFlagsto useparseStoredOrgFlags(orgFeatureFlags).valid, which parses stored flags key-by-key and preserves all valid catalog flags even if an invalid or unknown flag is present.mergeOrgFeatureFlagsinapps/webapp/app/v3/featureFlags.tsalongsideparseStoredOrgFlags, and re-exported it fromapps/webapp/app/v3/featureFlags.server.tsfor backward compatibility.apps/webapp/test/storedOrgFlags.test.tsverifying that valid org flags are retained when invalid flags are present, unknown keys are ignored, and non-object inputs are safely handled.