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

fix(dataproxy): remove 3.4.1 fallback from DataProxy Client #12738

Closed
wants to merge 17 commits into from

Conversation

janpio
Copy link
Member

@janpio janpio commented Apr 8, 2022

The Data Proxy Client in PDP Data Browser used to fall back to 3.4.1 because of customization of the Client version (it was set to not-provided instead of a version) silently becuase of the code that is changed here. After this change, that should fail visibly instead and hopefully surface these cases better.

Also introduces PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION to override the version that the Data Proxy should choose, no matter what Client version is used. This will make the Data Proxy (more) usable with dev versions of Prisma Client.

@Jolg42

This comment was marked as outdated.

@janpio

This comment was marked as outdated.

@aqrln

This comment was marked as outdated.

@Jolg42 Jolg42 changed the title fix: remove 3.4.1 fallback from DataProxy Client fix(dataproxy): remove 3.4.1 fallback from DataProxy Client Apr 26, 2022
@millsp millsp added this to the 3.14.0 milestone Apr 26, 2022
@Jolg42 Jolg42 marked this pull request as ready for review April 26, 2022 09:51
@Jolg42 Jolg42 requested a review from millsp as a code owner April 26, 2022 09:51
@Jolg42

This comment was marked as outdated.

@janpio

This comment was marked as outdated.

@janpio janpio modified the milestones: 3.14.0, 3.15.0 May 24, 2022
package-lock.json Outdated Show resolved Hide resolved
@janpio janpio requested a review from SevInf as a code owner May 30, 2022 10:00
Copy link
Contributor

@jkomyno jkomyno left a comment

Choose a reason for hiding this comment

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

Seems good to me!

}
} else {
throw new NotImplementedYetError(
'clientVersion or `PRISMA_CLIENT_DATA_PROXY_CLIENT_VERSION` env var needs to be set with a `major.minor.patch` version for Prisma Data Proxy.',
Copy link
Member Author

@janpio janpio May 31, 2022

Choose a reason for hiding this comment

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

Where would I set the clientVersion myself?
Is that the PDP use case?

@janpio
Copy link
Member Author

janpio commented May 31, 2022

The 5 new tests are currently failing:

[2022-05-31T12:49:18Z]  FAIL  src/__tests__/getPrismaClient/getPrismaClient.dataproxy.test.ts
[2022-05-31T12:49:18Z]   ● getPrismaClient › Data Proxy: Error: inlineDatasources is required
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]     Get config: Unable to resolve path to query-engine binary
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]     Prisma CLI Version : 0.0.0
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]       63 |     const { left: e } = preliminaryEither;
[2022-05-31T12:49:18Z]       64 |     debugErrorType(e);
[2022-05-31T12:49:18Z]     > 65 |     throw new GetConfigError(e.reason, e.error);
[2022-05-31T12:49:18Z]          |           ^
[2022-05-31T12:49:18Z]       66 |   }
[2022-05-31T12:49:18Z]       67 |   const { queryEnginePath } = preliminaryEither.right;
[2022-05-31T12:49:18Z]       68 |   debug(`Using CLI Query Engine (Node-API Library) at: ${queryEnginePath}`);
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]       at getConfigNodeAPI (../sdk/dist/engine-commands/getConfig.js:65:11)
[2022-05-31T12:49:18Z]       at getConfig (../sdk/dist/engine-commands/getConfig.js:51:16)
[2022-05-31T12:49:18Z]       at Object.<anonymous> (src/__tests__/getPrismaClient/getPrismaClient.dataproxy.test.ts:25:14)
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]   ● getPrismaClient › Data Proxy: Error: Datasource URL must start with prisma://
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]     Get config: Unable to resolve path to query-engine binary
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]     Prisma CLI Version : 0.0.0
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]       63 |     const { left: e } = preliminaryEither;
[2022-05-31T12:49:18Z]       64 |     debugErrorType(e);
[2022-05-31T12:49:18Z]     > 65 |     throw new GetConfigError(e.reason, e.error);
[2022-05-31T12:49:18Z]          |           ^
[2022-05-31T12:49:18Z]       66 |   }
[2022-05-31T12:49:18Z]       67 |   const { queryEnginePath } = preliminaryEither.right;
[2022-05-31T12:49:18Z]       68 |   debug(`Using CLI Query Engine (Node-API Library) at: ${queryEnginePath}`);
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]       at getConfigNodeAPI (../sdk/dist/engine-commands/getConfig.js:65:11)
[2022-05-31T12:49:18Z]       at getConfig (../sdk/dist/engine-commands/getConfig.js:51:16)
[2022-05-31T12:49:18Z]       at Object.<anonymous> (src/__tests__/getPrismaClient/getPrismaClient.dataproxy.test.ts:25:14)
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]   ● getPrismaClient › Data Proxy: InvalidDatasourceError: No valid API key found in the datasource URL
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]     Get config: Unable to resolve path to query-engine binary
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]     Prisma CLI Version : 0.0.0
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]       63 |     const { left: e } = preliminaryEither;
[2022-05-31T12:49:18Z]       64 |     debugErrorType(e);
[2022-05-31T12:49:18Z]     > 65 |     throw new GetConfigError(e.reason, e.error);
[2022-05-31T12:49:18Z]          |           ^
[2022-05-31T12:49:18Z]       66 |   }
[2022-05-31T12:49:18Z]       67 |   const { queryEnginePath } = preliminaryEither.right;
[2022-05-31T12:49:18Z]       68 |   debug(`Using CLI Query Engine (Node-API Library) at: ${queryEnginePath}`);
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]       at getConfigNodeAPI (../sdk/dist/engine-commands/getConfig.js:65:11)
[2022-05-31T12:49:18Z]       at getConfig (../sdk/dist/engine-commands/getConfig.js:51:16)
[2022-05-31T12:49:18Z]       at Object.<anonymous> (src/__tests__/getPrismaClient/getPrismaClient.dataproxy.test.ts:25:14)
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]   ● getPrismaClient › Data Proxy: Error: client version is required
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]     Get config: Unable to resolve path to query-engine binary
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]     Prisma CLI Version : 0.0.0
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]       63 |     const { left: e } = preliminaryEither;
[2022-05-31T12:49:18Z]       64 |     debugErrorType(e);
[2022-05-31T12:49:18Z]     > 65 |     throw new GetConfigError(e.reason, e.error);
[2022-05-31T12:49:18Z]          |           ^
[2022-05-31T12:49:18Z]       66 |   }
[2022-05-31T12:49:18Z]       67 |   const { queryEnginePath } = preliminaryEither.right;
[2022-05-31T12:49:18Z]       68 |   debug(`Using CLI Query Engine (Node-API Library) at: ${queryEnginePath}`);
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]       at getConfigNodeAPI (../sdk/dist/engine-commands/getConfig.js:65:11)
[2022-05-31T12:49:18Z]       at getConfig (../sdk/dist/engine-commands/getConfig.js:51:16)
[2022-05-31T12:49:18Z]       at Object.<anonymous> (src/__tests__/getPrismaClient/getPrismaClient.dataproxy.test.ts:25:14)
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]   ● getPrismaClient › Data Proxy: Error: client version must be major.minor.patch
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]     Get config: Unable to resolve path to query-engine binary
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]     Prisma CLI Version : 0.0.0
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]       63 |     const { left: e } = preliminaryEither;
[2022-05-31T12:49:18Z]       64 |     debugErrorType(e);
[2022-05-31T12:49:18Z]     > 65 |     throw new GetConfigError(e.reason, e.error);
[2022-05-31T12:49:18Z]          |           ^
[2022-05-31T12:49:18Z]       66 |   }
[2022-05-31T12:49:18Z]       67 |   const { queryEnginePath } = preliminaryEither.right;
[2022-05-31T12:49:18Z]       68 |   debug(`Using CLI Query Engine (Node-API Library) at: ${queryEnginePath}`);
[2022-05-31T12:49:18Z]
[2022-05-31T12:49:18Z]       at getConfigNodeAPI (../sdk/dist/engine-commands/getConfig.js:65:11)
[2022-05-31T12:49:18Z]       at getConfig (../sdk/dist/engine-commands/getConfig.js:51:16)
[2022-05-31T12:49:18Z]       at Object.<anonymous> (src/__tests__/getPrismaClient/getPrismaClient.dataproxy.test.ts:25:14)

@janpio
Copy link
Member Author

janpio commented Jun 2, 2022

To be replaced by #13629

1 similar comment
@janpio
Copy link
Member Author

janpio commented Jun 2, 2022

To be replaced by #13629

@millsp millsp closed this Jun 3, 2022
@Jolg42 Jolg42 deleted the janpio/dataproxy-no-fallback branch July 5, 2022 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants