From e9ee78b5cde74c0ab96b6cedba0877d4ab1e34ee Mon Sep 17 00:00:00 2001 From: fauna-chase Date: Tue, 17 Oct 2023 19:35:12 -0500 Subject: [PATCH] don't validate endpoint config with --secret ENG-5661 This came up while I was testing updating schema in a pipeline. In this scenario the endpoints present in the project configuration won't exist, which is ok as long as a secret is getting passed. --- src/lib/config/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/lib/config/index.ts b/src/lib/config/index.ts index 1232f35c..4d7c819a 100644 --- a/src/lib/config/index.ts +++ b/src/lib/config/index.ts @@ -201,8 +201,6 @@ export class ShellConfig { ? ProjectConfig.fromConfig(new Config("config key", opts.projectConfig)) : undefined; - this.projectConfig?.validate(this.rootConfig); - const urlFlag = Endpoint.getURLFromFlags(this.flags); if (urlFlag !== undefined) { try { @@ -250,7 +248,7 @@ export class ShellConfig { ); } - if (endpointName === undefined) { + if (endpointName === undefined || secretFlag !== undefined) { // This is a dummy secret. `--secret` must be set in this case, which // `validate` enforces. this.endpoint = new Endpoint({ @@ -260,6 +258,7 @@ export class ShellConfig { graphqlPort: this.flags.numberOpt("graphqlPort"), }); } else { + this.projectConfig?.validate(this.rootConfig); this.endpoint = this.rootConfig.endpoints[endpointName]; if (this.endpoint === undefined) { throw new Error(`No such endpoint '${endpointName}'`);