-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Require project environment in SDK #14679
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
Changes from 7 commits
186822e
d34e259
647e18c
d91741b
c1781ed
40bab31
7753a5b
a904e53
5efcc32
45b4875
7abedce
8de3f44
16704ee
9d5e709
d0362d0
2070190
87fb597
5b86f27
041a594
a171866
96fc56b
044daed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,14 @@ | ||
| <!-- markdownlint-disable MD024 --> | ||
| # Changelog | ||
|
|
||
| ## [1.0.5] - 2024-11-18 | ||
|
|
||
| ### Changed | ||
|
|
||
| - The backend client used to default to `production` if the environment was | ||
|
Check failure on line 8 in packages/sdk/CHANGELOG.md
|
||
| not specified. Now `environment` is a required argument for | ||
|
Check failure on line 9 in packages/sdk/CHANGELOG.md
|
||
| `createBackendClient` and must be one of `production` or `development`. | ||
|
Check failure on line 10 in packages/sdk/CHANGELOG.md
|
||
|
|
||
| ## [1.0.4] - 2024-11-15 | ||
|
|
||
| ### Changed | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,6 +16,11 @@ | |||||||||
| clientSecret: string; | ||||||||||
| }; | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * The environment in which the server client is running. | ||||||||||
| */ | ||||||||||
| export type ProjectEnvironment = "development" | "production" | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * Options for creating a server-side client. | ||||||||||
| * This is used to configure the BackendClient instance. | ||||||||||
|
|
@@ -25,7 +30,7 @@ | |||||||||
| * The environment in which the server client is running (e.g., "production", | ||||||||||
| * "development"). | ||||||||||
| */ | ||||||||||
| environment?: string; | ||||||||||
| environment?: ProjectEnvironment; | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * The credentials to use for authentication against the Pipedream API. | ||||||||||
|
|
@@ -353,7 +358,8 @@ | |||||||||
| * @param opts - The options for configuring the server client. | ||||||||||
| */ | ||||||||||
| constructor(opts: BackendClientOpts) { | ||||||||||
| this.environment = opts.environment ?? "production"; | ||||||||||
| this.ensureValidEnvironment(opts.environment) | ||||||||||
| this.environment = opts.environment!! | ||||||||||
|
Check failure on line 362 in packages/sdk/src/server/index.ts
|
||||||||||
|
||||||||||
| this.ensureValidEnvironment(opts.environment) | |
| this.environment = opts.environment!! | |
| this.ensureValidEnvironment(opts.environment); | |
| this.environment = opts.environment; |
🧰 Tools
🪛 GitHub Check: Lint Code Base
[failure] 361-361:
Missing semicolon
[failure] 362-362:
Forbidden extra non-null assertion
[failure] 362-362:
Missing semicolon
🪛 Biome
[error] 362-362: Forbidden extra non-null assertion.
Safe fix: Remove extra non-null assertion.
(lint/suspicious/noExtraNonNullAssertion)
🪛 eslint
[error] 361-362: Missing semicolon.
(@typescript-eslint/semi)
[error] 362-362: Forbidden extra non-null assertion.
(@typescript-eslint/no-extra-non-null-assertion)
Check failure on line 380 in packages/sdk/src/server/index.ts
GitHub Actions / Lint Code Base
A linebreak is required after '['
Check failure on line 380 in packages/sdk/src/server/index.ts
GitHub Actions / Lint Code Base
There should be a linebreak after this element
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Based on the code analysis, I can now generate the final response:
Breaking change confirmed - version bump needed
The change is indeed a breaking change as evidenced by:
environmentwas optional:environment?: ProjectEnvironmentensureValidEnvironmentmethod"Project environment is required"The version should be bumped to either:
🔗 Analysis chain
Version bump should follow semver for breaking changes
The change makes
environmenta required parameter, which is a breaking change as it modifies the existing API contract. According to semantic versioning:Currently, only the patch version is incremented (1.0.4 -> 1.0.5).
Let's verify if this is indeed a breaking change by checking the usage:
Let me gather more context about the breaking change by checking the implementation and previous behavior.
Let me check the type definition of BackendClientOpts to verify if environment is indeed a required parameter.
Let me try a different pattern to find the type definitions and environment-related code.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 155
Script:
Length of output: 24492
Script:
Length of output: 102
Script:
Length of output: 24981
🧰 Tools
🪛 GitHub Check: test
[failure] 8-8: Trailing spaces
packages/sdk/CHANGELOG.md:8:76 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md009.md
[failure] 9-9: Trailing spaces
packages/sdk/CHANGELOG.md:9:62 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md009.md
[failure] 10-10: Trailing spaces
packages/sdk/CHANGELOG.md:10:74 MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1] https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md009.md