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

Update check result in stdout breaks composed supergraph #583

Closed
lkol opened this issue May 28, 2021 · 2 comments
Closed

Update check result in stdout breaks composed supergraph #583

lkol opened this issue May 28, 2021 · 2 comments
Labels
Milestone

Comments

@lkol
Copy link

lkol commented May 28, 2021

Description

Were running a command to compose a supergraph:
» npx @apollo/rover supergraph compose --config ./graph/supergraph-config.yaml > supergraph.graphql

However, because our rover version is not up to date (on CI server), the beginning of file will look like this:

There is a newer version of Rover available: �[36mv0.1.5�[0m (currently running v0.1.3)

For instructions on how to install, run �[33m`rover docs open start`�[0m
schema
  @core(feature: "https://specs.apollo.dev/core/v0.1"),
  @core(feature: "https://specs.apollo.dev/join/v0.1")
{
  query: Query

This results to internal server error, when we pass the generated supergraph to graphql gateway.

Steps to reproduce

Add an older rover version to package.json devDependencies:

  "devDependencies": {
    "@apollo/rover": "0.1.3",
    ...

Make sure you have no config, so the update check will be performed:

npx @apollo/rover config clear 

Run rover command to compose a supergraph:
npx @apollo/rover supergraph compose --config ./graph/supergraph-config.yaml > supergraph.graphql

Expected result

The output file supergraph.graphql should contain a valid composed supergraph

Actual result

The beginning of file contains an update notice:

      ┌──────────────────────────────────────────────────────────────────────────────────────────┐
      │                                                                                          │
      │      There is a newer version of Rover available: v0.1.5 (currently running v0.1.3)      │
      │                                                                                          │
      │             For instructions on how to install, run `rover docs open start`              │
      │                                                                                          │
      └──────────────────────────────────────────────────────────────────────────────────────────┘
schema
  @core(feature: "https://specs.apollo.dev/core/v0.1"),
  @core(feature: "https://specs.apollo.dev/join/v0.1")
{
  query: Query
  mutation: Mutation
}
...

Environment

Rover Info:
Version: 0.1.3
Install Location: /Users/lkol/projects/sok/voikukka/services/backend/graphql/node_modules/binary-install/bin/rover
OS: Mac OS 10.15.7 [64-bit]
Shell: /bin/zsh
@lkol lkol added bug 🐞 triage issues and PRs that need to be triaged labels May 28, 2021
@lkol
Copy link
Author

lkol commented May 28, 2021

My dirty solution on CI:

mkdir -p .apollo
echo "secs_since_epoch = `date "+%s"`\nnanos_since_epoch = 0" > .apollo/version.toml
APOLLO_CONFIG_HOME=.apollo npx @apollo/rover supergraph compose --config ./graph/supergraph-config.yaml > supergraph.graphql

@EverlastingBugstopper
Copy link
Contributor

Thanks for the report @lkol - this has been fixed in an upstream dependency and will be resolved in the next release 😄 Love the workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants