1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-31 01:16:01 +02:00
unleash.unleash/frontend/src/utils
Thomas Heartman 5417662f5a
chore: add metrics for conflict creation detection (#6022)
This PR adds a 'change-request-conflict-created' event whenever someone
save a strategy update for a strategy that's used in either pending or
scheduled change requests.

Data for pending change requests will only be sent if change requests
are enabled. Data for scheduled change requests will be sent regardless.

Getting this data is somewhat involved, so I've extracted as much of the
logic into a separate file as possible.

The event re-uses the existing `change_request` metric and sends the
following data for each change request that we discover conflicts on:

```ts 
{
  state: ChangeRequestState,
  changeRequest: string, // <unleash identifier>#<change request id>
  action: 'edit-strategy',
  eventType: 'conflict-created'
}
```

There's only one action for this for now, but we could expand this event
to things such as strategy deletion, feature archival, in the future.
That said, I'd be happy to take it out.

## Discussion points

### Has the strategy actually been updated?

This does not check whether a strategy has actually changed before
emitting the event, only that you save your strategy changes.

This assumes that most people will simply close the modal by
clicking/tapping outside it or using the escape key instead of pressing
save.

However, it will likely lead to some false positives. If we think that
is an issue, I would suggest adding a check that something in the
strategy has actually changed in a follow-up PR.
2024-01-31 18:56:56 +09:00
..
apiUtils.ts feat: make maintenance-related 503s more intuitive (#5018) 2023-10-16 09:27:29 +01:00
arraysHaveSameItems.test.ts
arraysHaveSameItems.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
calculatePercentage.ts
capitalizeFirst.ts feat: Advanced playground table (#3978) 2023-06-15 09:29:31 +00:00
cleanConstraint.test.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
cleanConstraint.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
createFeatureStrategy.test.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
createFeatureStrategy.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
createLocalStorage.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
cyclicIterator.test.ts feat: first draft of chart for instance traffic in frontend (#2670) 2022-12-15 08:47:07 +00:00
cyclicIterator.ts feat: first draft of chart for instance traffic in frontend (#2670) 2022-12-15 08:47:07 +00:00
deepOmit.test.ts fix: Remove lastSeenAt from useCollaborateData.tsx staleness check (#4461) 2023-08-10 16:13:24 +03:00
deepOmit.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
env.test.ts
env.ts
formatAccessText.test.ts
formatAccessText.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
formatConstraintValue.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
formatDate.ts feat: daily metrics display (#5836) 2024-01-11 10:39:58 +01:00
formatPath.test.ts Revert "formatApiPath / formatAssetPath - Implement smart functionality to detect double subpath" (#3001) 2023-01-26 15:34:42 +01:00
formatPath.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
formatUnknownError.test.ts
formatUnknownError.ts
getFeatureMetrics.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
getFeatureTypeIcons.ts
instanceTrial.test.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
instanceTrial.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
nonEmptyArray.ts
objectId.test.ts
objectId.ts
oneOf.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
operatorsForContext.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
paginate.test.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
paginate.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
parseParameter.test.ts
parseParameter.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
permissions.ts refactor: favor permission name over id (#5409) 2023-11-27 11:12:09 +00:00
projectFilterGenerator.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
removeEmptyStringFields.test.ts
removeEmptyStringFields.ts
reorderObject.test.ts feat: keep filter order (#5688) 2023-12-19 15:35:39 +01:00
reorderObject.ts feat: keep filter order (#5688) 2023-12-19 15:35:39 +01:00
routePathHelpers.ts Biome1.5.1 (#5867) 2024-01-12 09:25:59 +00:00
search.ts
serializeQueryParams.ts feat: add tags filter (#5584) 2023-12-11 14:10:03 +02:00
sortStrategyParameters.test.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
sortStrategyParameters.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
sortTypes.test.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
sortTypes.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
storage.test.ts refactor: cleanup fix for persistent set (#6060) 2024-01-29 12:33:01 +01:00
storage.ts refactor: cleanup fix for persistent set (#6060) 2024-01-29 12:33:01 +01:00
strategyNames.tsx feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
testIds.ts feat: keep filters ordered based on user selection (#5609) 2023-12-12 13:01:23 +02:00
testRenderer.tsx chore: add no unused imports biome rule (#5855) 2024-01-11 12:44:05 +00:00
testServer.ts feat: show dependencies only when using pro/enterprise or at least on… (#5052) 2023-10-16 20:56:06 +02:00
unique-change-request-id.ts chore: add metrics for conflict creation detection (#6022) 2024-01-31 18:56:56 +09:00
unknownify.ts perf: Simplify queries to prometheus (#2706) 2022-12-19 17:06:59 +01:00
validateParameterValue.test.ts
validateParameterValue.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
variants.ts feat: biome lint frontend (#4903) 2023-10-02 13:25:46 +01:00
withTableState.test.tsx Feat: row actions (#5635) 2023-12-14 09:04:56 +01:00
withTableState.ts Feat: row actions (#5635) 2023-12-14 09:04:56 +01:00