feat: unify base URL config and add region dropdown with manual override#7842
feat: unify base URL config and add region dropdown with manual override#7842afsuyadi wants to merge 8 commits into
Conversation
|
@afsuyadi is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
This comment was marked as spam.
This comment was marked as spam.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Extract the Select value into an if/else chain to satisfy the no-nested-ternary rule failing CI. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughIntegration defaults now expose regional and custom URL options for several integrations. The integration modal tracks custom URL selections, renders text inputs for custom values, resets custom state during data changes, and normalises New Relic Estimated code review effort: 3 (Moderate) | ~20 minutes Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: fc781497-b42b-4815-bdbe-67981828a9c5
📒 Files selected for processing (2)
frontend/common/stores/default-flags.tsfrontend/web/components/modals/CreateEditIntegrationModal.tsx
- Point Datadog presets at the per-site API hosts (base_url feeds the Events API, so app hosts and the datadoghw typo would fail) - Point New Relic presets at the REST v2 API hosts with the trailing slash NewRelicWrapper requires - Clear customUrlFields whenever the form resets so a stale Custom URL selection can't leak into another project's form - Only apply custom-URL handling to fields offering the 'custom' sentinel, restoring 'Please select' for unmatched Slack channels Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/web/components/modals/CreateEditIntegrationModal.tsx (1)
360-396: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPrevent submission with an empty custom URL.
Selecting
customimmediately writes''toformData, but the Save button andhandleSubmitdo not enforceInput.isValid. Users can therefore submit an emptybase_url, resulting in an unusable integration or a guaranteed backend failure. Disable Save or validate every entry incustomUrlFieldsbefore sending the mutation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 82050c66-a826-4ec6-a6c3-9cbb6e0e373e
📒 Files selected for processing (2)
frontend/common/stores/default-flags.tsfrontend/web/components/modals/CreateEditIntegrationModal.tsx
NewRelicWrapper appends v2/applications/... directly to base_url, so a custom URL without a trailing slash produced a malformed request URL. Append the slash before create/update submissions and cover the helper with unit tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the integration-specific normaliseIntegrationBaseUrl helper with a generic string util; the New Relic condition now lives at the submit call site where the constraint is documented. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 27b81650-1717-4056-9148-cbf8336197cf
📒 Files selected for processing (3)
frontend/common/utils/__tests__/normaliseIntegrationBaseUrl.test.tsfrontend/common/utils/normaliseIntegrationBaseUrl.tsfrontend/web/components/modals/CreateEditIntegrationModal.tsx
Heap's EU Track API endpoint is https://c.eu.heap-api.com/api/track; heapanalytics.eu is not a Heap ingest host. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
frontend/web/components/modals/CreateEditIntegrationModal.tsx (1)
388-391: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winPrevent saving an empty Custom URL.
Selecting Custom URL clears the field, but submission does not validate
customUrlFields, and the Save button remains enabled. This allowsbase_url: ''to be submitted; New Relic normalisation intentionally leaves empty strings unchanged. Block submission, or disable Save, until every selected custom URL contains a non-whitespace value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 5700d5da-da0f-4879-8b0f-f8d91a66758f
📒 Files selected for processing (3)
frontend/common/utils/__tests__/ensureTrailingSlash.test.tsfrontend/common/utils/ensureTrailingSlash.tsfrontend/web/components/modals/CreateEditIntegrationModal.tsx
Reconciles the Heap and Mixpanel base_url presets added on main by Flagsmith#7732/Flagsmith#7802 with the ones added here (duplicate field definitions after an otherwise clean auto-merge). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Thank you for this, adding a custom option to selects makes a lot of sense and the new options are very sensible. @talissoncosta I can't approve and push this since I pushed a couple fixes to the branch, are you able to review? |
Yes, assuming they might establish new regions, so we just need to add the new label and value. |
Thanks for submitting a PR! Please check the boxes below:
docs/if required so people know about the feature.Changes
Contributes to #7795
optionsarray with label and value (URL) key for Amplitude, Datadog, Heap, Mixpanel, and New Relic integrationCreateEditIntegrationcomponent to enable Custom URL as manual overrideHow did you test this code?
For every platform, I try to manually test them by choosing the options in
Selectcomponent, either selecting the existing options or manually inserting the URLDatadog testing:
datadog-testing.webm
Amplitude testing:
amplitude-testing.webm
Heap testing:
heap-testing.webm
New Relic testing:
new-relic_testing.webm
Mixpanel testing:
mixpanel-testing.webm
Additional Note