Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add new standard errors #1890

Merged
merged 6 commits into from
Aug 5, 2022
Merged

Conversation

gastonfournier
Copy link
Contributor

About the changes

Adding new standard errors that are used widely across multiple endpoints. This should help improve OpenAPI documentation

Relates to: #1391

Discussion points

409 is also being used for things like wrong status: ProjectWithoutOwnerError

@vercel
Copy link

vercel bot commented Aug 4, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
unleash-docs ⬜️ Ignored (Inspect) Aug 5, 2022 at 0:05AM (UTC)

@github-actions
Copy link

github-actions bot commented Aug 4, 2022

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements
89.67% (-1.71% 🔻)
6326/7055
🟡 Branches 78.63% 1023/1301
🟢 Functions
82.77% (-3.46% 🔻)
1393/1683
🟢 Lines
89.7% (-1.61% 🔻)
6174/6883
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / ensureStringValue.ts
100% 100% 100% 100%
🟢
... / isDefined.ts
100% 100% 100% 100%
🟢
... / map-values.ts
100% 100% 100% 100%
🔴
... / group-store.ts
34.55% 25% 25.93% 33.33%
🟢 lib/types/group.ts 90% 0% 100% 90%
🟢 lib/util/env.ts 100% 100% 100% 100%
🟢
... / validateJsonString.ts
100% 100% 100% 100%
🟢 lib/util/semver.ts 92.86% 100% 100% 91.67%
🔴
... / group-service.ts
13.58% 0% 5.71% 14.67%
🟢
... / create-request-schema.ts
100% 100% 100% 100%
🟢
... / create-response-schema.ts
100% 100% 100% 100%
🟢
... / token-user-schema.ts
100% 100% 100% 100%
🟢
... / role-schema.ts
100% 100% 100% 100%
🟢
... / standard-responses.ts
100% 100% 100% 100%
🟢
... / user-schema.ts
100% 100% 100% 100%
🟢
... / serialize-dates.ts
100% 100% 100% 100%
🟢
... / environment-schema.ts
100% 100% 100% 100%
🟢
... / strategies-schema.ts
100% 100% 100% 100%
🟢
... / anonymise.ts
100% 100% 100% 100%
🟢
... / endpoint-descriptions.ts
100% 100% 100% 100%
🟢
... / events-schema.ts
100% 100% 100% 100%
🟢
... / event-schema.ts
100% 100% 100% 100%
🟢
... / feature-events-schema.ts
100% 100% 100% 100%
🟢
... / playground.ts
100% 100% 100% 100%
🟢
... / playground-response-schema.ts
100% 100% 100% 100%
🟢
... / sdk-context-schema.ts
100% 100% 100% 100%
🟢
... / playground-request-schema.ts
100% 100% 100% 100%
🟢
... / playground-feature-schema.ts
100% 100% 100% 100%
🟢
... / playground-strategy-schema.ts
100% 100% 100% 100%
🟢
... / playground-constraint-schema.ts
100% 100% 100% 100%
🟢
... / playground-segment-schema.ts
100% 100% 100% 100%
🟢
... / me-schema.ts
100% 100% 100% 100%
🟢
... / permission-schema.ts
100% 100% 100% 100%
🟢
... / feedback-schema.ts
100% 100% 100% 100%
🟢
... / ui-config-schema.ts
100% 100% 100% 100%
🟢
... / version-schema.ts
100% 100% 100% 100%
🟢
... / context-field-schema.ts
100% 100% 100% 100%
🟢
... / legal-value-schema.ts
100% 100% 100% 100%
🟢
... / feature-usage-schema.ts
100% 100% 100% 100%
🟢
... / feature-environment-metrics-schema.ts
100% 100% 100% 100%
🟢
... / feature-metrics-schema.ts
100% 100% 100% 100%
🟢
... / bootstrap-ui.ts
100% 100% 100% 100%
🟢
... / bootstrap-ui-schema.ts
100% 100% 100% 100%
🟢
... / feature-type-schema.ts
100% 100% 100% 100%
🟢
... / tag-type-schema.ts
100% 100% 100% 100%
🟢
... / project-schema.ts
100% 100% 100% 100%
🟢
... / export-query-parameters.ts
100% 100% 100% 100%
🟢
... / tags-schema.ts
100% 100% 100% 100%
🟢
... / tag-with-version-schema.ts
100% 100% 100% 100%
🟢
... / addon-schema.ts
100% 100% 100% 100%
🟢
... / addons-schema.ts
100% 100% 100% 100%
🟢
... / addon-type-schema.ts
100% 100% 100% 100%
🟢
... / addon-parameter-schema.ts
100% 100% 100% 100%
🟢
... / api-token.ts
93.02% 60% 100% 92.86%
🟢
... / api-tokens-schema.ts
100% 100% 100% 100%
🟢
... / api-token-schema.ts
100% 100% 100% 100%
🟢
... / users-schema.ts
100% 100% 100% 100%
🟢
... / users-search-schema.ts
100% 100% 100% 100%
🟢
... / reset-password-schema.ts
100% 100% 100% 100%
🟢
... / users-groups-base-schema.ts
100% 100% 100% 100%
🟢
... / group-schema.ts
100% 100% 100% 100%
🟢
... / group-user-model-schema.ts
100% 100% 100% 100%
🟢
... / user-feedback.ts
100% 71.43% 100% 100%
🟢
... / user-splash.ts
100% 100% 100% 100%
🟢
... / splash-schema.ts
100% 100% 100% 100%
🟢
... / health-overview-schema.ts
100% 100% 100% 100%
🟢
... / health-report-schema.ts
100% 100% 100% 100%
🟢
... / projects-schema.ts
100% 100% 100% 100%
🟢
... / environments.ts
100% 100% 100% 100%
🟢
... / environments-schema.ts
100% 100% 100% 100%
🟢
... / client-feature-schema.ts
100% 100% 100% 100%
🟢
... / client-variant-schema.ts
100% 100% 100% 100%
🟢
... / client-features-schema.ts
100% 100% 100% 100%
🟢
... / client-features-query-schema.ts
100% 100% 100% 100%
🟢
... / segment-schema.ts
100% 100% 100% 100%
🟢
... / application-schema.ts
100% 100% 100% 100%
🟢
... / applications-schema.ts
100% 100% 100% 100%
🟢
... / change-password-schema.ts
100% 100% 100% 100%
🟢
... / client-application-schema.ts
100% 100% 100% 100%
🟢
... / client-metrics-schema.ts
100% 100% 100% 100%
🟢
... / date-schema.ts
100% 100% 100% 100%
🟢
... / context-fields-schema.ts
100% 100% 100% 100%
🟢
... / create-api-token-schema.ts
100% 100% 100% 100%
🟢
... / create-feature-strategy-schema.ts
100% 100% 100% 100%
🟢
... / create-user-schema.ts
100% 100% 100% 100%
🟢
... / email-schema.ts
100% 100% 100% 100%
🟢
... / feature-environment-schema.ts
100% 100% 100% 100%
🟢
... / feature-strategy-segment-schema.ts
100% 100% 100% 100%
🟢
... / feature-tag-schema.ts
100% 100% 100% 100%
🟢
... / feature-types-schema.ts
100% 100% 100% 100%
🟢
... / feature-variants-schema.ts
100% 100% 100% 100%
🟢
... / health-check-schema.ts
100% 100% 100% 100%
🟢
... / id-schema.ts
100% 100% 100% 100%
🟢
... / login-schema.ts
100% 100% 100% 100%
🟢
... / name-schema.ts
100% 100% 100% 100%
🟢
... / omit-keys.ts
100% 100% 100% 100%
🟢
... / password-schema.ts
100% 100% 100% 100%
🟢
... / patches-schema.ts
100% 100% 100% 100%
🟢
... / patch-schema.ts
100% 100% 100% 100%
🟢
... / project-environment-schema.ts
100% 100% 100% 100%
🟢
... / set-strategy-sort-order-schema.ts
100% 100% 100% 100%
🟢
... / sort-order-schema.ts
100% 100% 100% 100%
🟢
... / state-schema.ts
100% 100% 100% 100%
🟢
... / tag-types-schema.ts
100% 100% 100% 100%
🟢
... / update-api-token-schema.ts
100% 100% 100% 100%
🟢
... / update-feature-schema.ts
100% 100% 100% 100%
🟢
... / update-feature-strategy-schema.ts
100% 100% 100% 100%
🟢
... / update-tag-type-schema.ts
100% 100% 100% 100%
🟢
... / update-user-schema.ts
100% 100% 100% 100%
🟢
... / upsert-context-field-schema.ts
100% 100% 100% 100%
🟢
... / upsert-strategy-schema.ts
100% 100% 100% 100%
🟢
... / validate-password-schema.ts
100% 100% 100% 100%
🟢
... / validate-tag-type-schema.ts
100% 100% 100% 100%
🟢
... / variants-schema.ts
100% 100% 100% 100%
🟢
... / groups-schema.ts
100% 100% 100% 100%
🟢
... / validate.ts
100% 66.67% 100% 100%
🟢
... / client-spec-service.ts
100% 100% 100% 100%
🟢
... / playground-service.ts
100% 90% 100% 100%
🟢
... / offline-unleash-client.ts
100% 100% 100% 100%
🟢
... / index.ts
100% 100% 50% 100%
🟢
... / feature-evaluator.ts
82.61% 75% 55.56% 82.61%
🟢
... / client.ts
87.72% 76.47% 88.24% 87.72%
🟢
... / variant.ts
83.72% 52.94% 85.71% 83.33%
🟢
... / util.ts
100% 100% 100% 100%
🟢
... / helpers.ts
63.16% 57.14% 28.57% 80%
🟢
... / index.ts
93.33% 80% 92.86% 92.86%
🟢
... / index.ts
100% 100% 0% 100%
🟢
... / default-strategy.ts
100% 100% 100% 100%
🟢
... / strategy.ts
93.33% 83.33% 88.89% 93.33%
🟢
... / constraint.ts
86.67% 79.17% 100% 85.71%
🔴
... / gradual-rollout-random.ts
55.56% 100% 33.33% 55.56%
🔴
... / gradual-rollout-user-id.ts
36.36% 0% 50% 36.36%
🔴
... / gradual-rollout-session-id.ts
36.36% 0% 50% 36.36%
🟢
... / user-with-id-strategy.ts
100% 100% 100% 100%
🟡
... / remote-address-strategy.ts
71.43% 33.33% 100% 71.43%
🟢
... / flexible-rollout-strategy.ts
90.91% 62.5% 100% 90.91%
🟢
... / unknown-strategy.ts
88.89% 100% 66.67% 88.89%
🟡
... / application-hostname-strategy.ts
62.5% 50% 50% 62.5%
🟢
... / bootstrap-provider.ts
87.5% 100% 100% 87.5%
🟢
... / storage-provider-in-mem.ts
80% 100% 66.67% 80%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢 lib/types/events.ts
92.15% (-7.85% 🔻)
100%
86.36% (-13.64% 🔻)
92.15% (-7.85% 🔻)
🟢
... / addon-store.ts
82.5%
76.92% (-3.08% 🔻)
76.92% 82.5%
🟢
... / feature-strategy-store.ts
90.91% 79.31% 83.33% 91.53%
🟢
... / feature-toggle-client-store.ts
98.57% (-1.43% 🔻)
80.65% (+3.72% 🔼)
100%
98.57% (-1.43% 🔻)
🟢
... / create-config.ts
96.69%
91.11% (+6.04% 🔼)
90% (-10% 🔻)
96.61%
🟡
... / access-service.ts
80% 93.1%
80.7% (-1.3% 🔻)
78.72%
🟢 lib/routes/util.ts
84.85% (-3.03% 🔻)
73.68% (-5.26% 🔻)
100%
84.38% (-3.13% 🔻)
🟢
... / constraint-types.ts
93.33% (-3.44% 🔻)
83.33% (-16.67% 🔻)
85.71%
91.67% (-4.17% 🔻)
🟡
... / project-service.ts
75.16% (-16.57% 🔻)
61.11% (-7.64% 🔻)
71.43% (-20.88% 🔻)
75.86% (-15.52% 🔻)
🟢
... / controller.ts
96.88% (-3.13% 🔻)
100%
93.33% (-6.67% 🔻)
96.77% (-3.23% 🔻)
🟢
... / user-admin.ts
84.69% (-2.21% 🔻)
66.67% (-13.33% 🔻)
62.5% (-20.83% 🔻)
85.57% (-1.34% 🔻)
🟢
... / features.ts
92.24% 100% 90% 92.24%
🟢
... / metrics.ts
88.89% (-2.02% 🔻)
33.33% 100%
88.89% (-2.02% 🔻)
🟡
... / health-service.ts
66.67% (-33.33% 🔻)
100%
50% (-50% 🔻)
66.67% (-33.33% 🔻)
🟢
... / user-service.ts
88.97% (-1.18% 🔻)
69.39% (-1.34% 🔻)
86.36%
89.55% (-1.22% 🔻)
🔴
... / password-undefined.ts
14.29% (-85.71% 🔻)
100%
0% (-100% 🔻)
14.29% (-85.71% 🔻)
🟡
... / user-splash-service.ts
69.23% (-2.2% 🔻)
0% 80%
69.23% (-2.2% 🔻)

Test suite run success

1094 tests passing in 180 suites.

Report generated by 🧪jest coverage report action from 0650ec5

@gastonfournier gastonfournier marked this pull request as ready for review August 4, 2022 16:36
Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Just a few small rewording changes I'd love to have in. What do you think? 😄

src/lib/openapi/util/standard-responses.ts Outdated Show resolved Hide resolved
src/lib/openapi/util/standard-responses.ts Outdated Show resolved Hide resolved
gastonfournier and others added 2 commits August 5, 2022 10:33
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one 🙌🏼

Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
@gastonfournier gastonfournier enabled auto-merge (squash) August 5, 2022 12:06
@gastonfournier gastonfournier merged commit 678e3f9 into main Aug 5, 2022
@gastonfournier gastonfournier deleted the feat/new-standard-errors branch August 5, 2022 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants