From f38c6cb6385bb80ef9f40b6492d910817ece8d45 Mon Sep 17 00:00:00 2001 From: fauna-chase Date: Tue, 7 Nov 2023 17:48:27 -0600 Subject: [PATCH] fix schema from pipeline tests --- src/lib/config/index.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/lib/config/index.ts b/src/lib/config/index.ts index fd18b38f..165fd569 100644 --- a/src/lib/config/index.ts +++ b/src/lib/config/index.ts @@ -290,8 +290,18 @@ export class ShellConfig { throw new Error( `No endpoint or secret set. Set an endpoint in ~/.fauna-shell, ${PROJECT_FILE_NAME}, or pass --endpoint` ); + /** + * If there is no secret flag set we need to ensure we validate we can find a secret + * from the endpoint. Additionally if there is a root config present, we + * want to validate that things line up with the project. Even if a secret + * flag is set, there could be other properties of the endpoint that we need to + * pull in, url being the current one. + * The inverse of this is the running from a pipeline scenario where there is a secret + * set and no root config. In that case we don't want to validate the project configuration. + */ + } else if (this.secretFlag === undefined || !this.rootConfig.isEmpty()) { + this.projectConfig?.validate(this.rootConfig); } - this.projectConfig?.validate(this.rootConfig); }; lookupEndpoint = (opts: { scope?: string }): EndpointConfig => {