|
Ran
|
Jobs
1
|
Files
1186
|
Run time
2min
|
Badge
README BADGES
|
push
github
fix: remove SDK registration and metrics `environment` field (#12224) ## About the changes We still hold environment field on SDK registration and metrics payloads despite being deprecated in v5. Here, we enforce the `environment` to be inferred from the API token rather than client-provided payload metadata. Before: ``` resolveMetricsEnvironment(user, data) { if (user instanceof ApiUser) { if (user.environment !== ALL) { return user.environment; } else if (user.environment === ALL && data.environment) { return data.environment; // <-- the change - this is GONE! } } return 'default'; } ``` Meaning that, when a wildcard-scoped token POSTs metrics with `environment` in the body, the server uses the body's value. But, now, the `environment` is not part of the schema, so, we remove the body field and metric attribution, thus, path changes to 'default' for those callers. **Who's not affected**: everyone using narrow-scoped tokens (the already documented + recommended path, most customers do already). **Who's affected**: users with instance-wide API tokens (environment='*'). The token-issuer doesn't fail, the metric just gets attributed to the wrong bucket. We already track these users and they are notified for the deprecation change. Thus, we assume no risk at the moment. #### SDK situation The `unleash-node-sdk` already doesn't send `environment` in its [registration payload](https://github.com/Unleash/unleash-node-sdk/blob/747d20550/src/metrics.ts#L414-#L426). ✔️ Node SDK users But, even if any other SDK sends the `environment` field, the server silently drops it via Joi `stripUnknown: true`. ✔️ No SDK breakage ### In a nutshell, here, we: - update OSS schemas (no environment params) - remove the wildcard fallback on server logic part - preserve-from-seenClients semantics (as broken test unveiled) - adapt tests on new logic Closes #EG-4386 ##... (continued)
1865 of 2056 branches covered (90.71%)
8 of 8 new or added lines in 3 files covered. (100.0%)
1 existing line in 1 file now uncovered.15176 of 17375 relevant lines covered (87.34%)
810.98 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 1 |
89.58 |
-2.08% | src/lib/features/frontend-api/client-feature-toggle-read-model.ts |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 27192288066.1 | 1186 |
87.34 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|