Skip to content

Commit

Permalink
don't validate endpoint config with --secret
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fauna-chase committed Oct 18, 2023
1 parent 6d5486d commit e9ee78b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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({
Expand All @@ -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}'`);
Expand Down

0 comments on commit e9ee78b

Please sign in to comment.