-
Notifications
You must be signed in to change notification settings - Fork 9
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
Respect CLI arguments and configuration when both provided #342
Conversation
0a3bbd0
to
d1b889a
Compare
🚀 Snapshot Release (
|
Package | Version | Info |
---|---|---|
@graphql-mesh/fusion-runtime |
0.10.23-alpha-8ff78beeb027abbd7fe46dcb5238a2aa1e371f96 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway |
1.7.2-alpha-8ff78beeb027abbd7fe46dcb5238a2aa1e371f96 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-opentelemetry |
1.3.30-alpha-8ff78beeb027abbd7fe46dcb5238a2aa1e371f96 |
npm ↗︎ unpkg ↗︎ |
@graphql-mesh/plugin-prometheus |
1.3.18-alpha-8ff78beeb027abbd7fe46dcb5238a2aa1e371f96 |
npm ↗︎ unpkg ↗︎ |
@graphql-hive/gateway-runtime |
1.4.2-alpha-8ff78beeb027abbd7fe46dcb5238a2aa1e371f96 |
npm ↗︎ unpkg ↗︎ |
f98bfd3
to
60f913c
Compare
🚀 Snapshot Release (Bun Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared
|
🚀 Snapshot Release (Node Docker Image)The latest changes of this PR are available as image on GitHub Container Registry (based on the declared
|
60f913c
to
8e74782
Compare
d69118c
to
4ff3aec
Compare
4ff3aec
to
6e1ea3c
Compare
where can I find the documentation that covers both cases to pass the arguments? |
CLI Arguments reference -> https://the-guild.dev/graphql/hive/docs/api-reference/gateway-cli We also have CLI configuration reference but it doesn't even mention about reporting; But instead we have this page for the configuration API for reporting And it is not clear how to pass other options like |
packages/runtime/src/types.ts
Outdated
/** GraphQL Hive registry access token. */ | ||
token: string; |
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.
There is no CLI or CLI arguments in the runtime. The token
is still required in the runtime.
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.
Then we need to make it optional for CLI only?
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.
How about now? @enisdenjo
Thanks! |
3ba9b3c
to
1f7a032
Compare
@@ -249,7 +250,9 @@ export const addCommand: AddCommand = (ctx, cli) => | |||
process.exit(1); | |||
} | |||
return runSupergraph(ctx, config); | |||
}); | |||
}) | |||
.allowUnknownOption(process.env.NODE_ENV === 'test') |
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.
Can you please elaborate on this change?
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.
When running tests, NODE_ENV
passed as test
, and this allows us to accept extra CLI arguments.
We need this but why?
Because during tests random ports are used and the CLI needs to know which ports are used for which services.
Test suite passes those ports as arguments like --serviceName-port=13212
This was missing for GW CLI but only available for Mesh Compose. So in order to have a test self hosting service, we need to pass our test environment's port to the GW CLI.
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.
LGTM. Let's wait for @enisdenjo confirmation.
@ardatan , do we need docs updates for this change? I
Actually this is a PR for fixing a bug more than changing it. But I added docs for Hive Client reference here to make it clear for users need to use more features from Hive Console. This is the PR improving docs for that purpose. |
Co-authored-by: Denis Badurina <[email protected]>
This reverts commit 84b5cfc.
This reverts commit 73e8f28.
This reverts commit b175ad0.
4b76032
to
8ff78be
Compare
Closes #310
User can provide the token in the CLI arguments, and have some registry configuration in `gateway.config`
Since
token
can be provided in the CLI arguments, it should not be required in the configuration.[Extra but needed] : Fixes in Test suite
Besides the changes in the code, I also saw that `bin` serve runner was not there and the tests were never running with the binary.
So I fixed it by adding
bin
serve runner implementation in the test suite.I also found that
process.env
is not passed to the Docker runners as we do for other runners.But I couldn't figure out why
args
not passed to the Docker runners, I need @enisdenjo 's help there because we testargs
here for Docker as in the original issue.