apollographql / federation-subgraph-compatibility

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub Action fails while resolving the schema for the 'products' subgraph

enisdenjo opened this issue · comments

See this failing job (browse files).

setting debug setting
2023-01-30T14:28:19.255Z rover 
2023-01-30T[14](https://github.com/dotansimha/graphql-yoga/actions/runs/4044842218/jobs/6955516979#step:2:15):28:19.255Z ******************************************************
***********************
Composing supergraph...
2023-01-30T14:28:19.255Z Starting Apollo Federation Subgraph Compatibility Test
***********************


2023-01-30T14:28:19.255Z ******************************************************
2023-01-30T14:28:19.255Z starting supergraph...
2023-01-30T14:28:19.255Z composing supergraph...
2023-01-30T14:28:25.646Z rover npm 
2023-01-30T14:28:25.646Z rover WARN exec The following package was not found and will be installed: @apollo/rover@0.11.0

2023-01-30T14:28:29.0[15](https://github.com/dotansimha/graphql-yoga/actions/runs/4044842218/jobs/6955516979#step:2:16)Z rover ⌛ resolving SDL for subgraphs defined in supergraph-config.yaml

[20](https://github.com/dotansimha/graphql-yoga/actions/runs/4044842218/jobs/6955516979#step:2:21)[23](https://github.com/dotansimha/graphql-yoga/actions/runs/4044842218/jobs/6955516979#step:2:24)-01-30T14:[28](https://github.com/dotansimha/graphql-yoga/actions/runs/4044842218/jobs/6955516979#step:2:29):[29](https://github.com/dotansimha/graphql-yoga/actions/runs/4044842218/jobs/6955516979#step:2:30).028Z rover error[E038]: Encountered 1 build error while trying to build a supergraph.

Caused by:
    UNKNOWN: No such file or directory (os error 2) while resolving the schema for the 'products' subgraph
            Make sure supergraph compose config YAML points to a valid schema file.

2023-01-[30](https://github.com/dotansimha/graphql-yoga/actions/runs/4044842218/jobs/6955516979#step:2:31)T14:28:29.029Z rover     
        See https://www.apollographql.com/docs/rover/commands/supergraphs#yaml-configuration-file for information on the config format.

Error: Command failed with exit code 1: npx @apollo/rover supergraph compose --config supergraph-config.yaml
npm WARN exec The following package was not found and will be installed: @apollo/rover@0.11.0
⌛ resolving SDL for subgraphs defined in supergraph-config.yaml
error[E038]: Encountered 1 build error while trying to build a supergraph.

Caused by:
    UNKNOWN: No such file or directory (os error 2) while resolving the schema for the 'products' subgraph
            Make sure supergraph compose config YAML points to a valid schema file.
    
        See https://www.apollographql.com/docs/rover/commands/supergraphs#yaml-configuration-file for information on the config format.

Could a non-root working directory be an issue?

P.S. Using the CLI directly (with an adjusted CWD) works.

Hello 👋
Non-root directories should be fine - you just have to specify full paths from root to the compose and schema files. I need to update logic to allow for specifying defaults.run.working-directory. I'll open up an issue to track it.

See:

Opened up #15

Non-root directories should be fine - you just have to specify full paths from root to the compose and schema files.

I did exactly that here and the CI fails with the error stated above. The CWD suggestion was just a hunch, not necessarily the underlying issue.

@enisdenjo can you try again with specifying workingDirectory on the latest v1.3.1 action?

@dariuszkuc thanks for adding this! The schema resolution seems to work, but suddenly the CI started to fail fails with:

******************************************************
Starting Apollo Federation Subgraph Compatibility Test
******************************************************
starting supergraph...
composing supergraph...
rover 
***********************
Composing supergraph...
***********************


rover sh: 1: rover: not found

Error: Command failed with exit code 127: npx @apollo/rover supergraph compose --config supergraph-config.yaml
sh: 1: rover: not found

See the failing action here and the related PR. Maybe I am doing something wrong?

Your setup looks correct and rover should be available (it is distributed with the action -> https://github.com/apollographql/federation-subgraph-compatibility/tree/v1.2.0/node_modules/%40apollo/rover and is also available on NPM -> https://www.npmjs.com/package/@apollo/rover). Maybe there is something going on between npm and pnpm?

I had to manually install rover dotansimha/graphql-yoga@aff84f4, now this part works - it's very likely a pnpm vs npm issue...

Everything else works though, thanks for your help!

See our first compatibility result comment: dotansimha/graphql-yoga#2511 (comment). :D

Awesome!

FYI take a look at apollographql/apollo-federation-subgraph-compatibility#376 for the changes I made in the compatibility repo.

Those changes were very helpful, thank you!