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

Add --graph-ref flag to rover dev #1984

Merged
merged 3 commits into from
Jul 16, 2024
Merged

Add --graph-ref flag to rover dev #1984

merged 3 commits into from
Jul 16, 2024

Conversation

dotdat
Copy link
Contributor

@dotdat dotdat commented Jul 15, 2024

Adds --graph-ref to rover dev which builds a SupergraphConfig from Apollo Studio and optionally overrides its values with a supplied supergraph.yaml

Related Issue: #1494

@dotdat dotdat marked this pull request as ready for review July 15, 2024 18:59
@dotdat dotdat requested a review from a team as a code owner July 15, 2024 18:59
@@ -86,6 +92,19 @@ pub struct SupergraphOpts {
conflicts_with_all = ["subgraph_name", "subgraph_url", "subgraph_schema_path"]
)]
supergraph_config_path: Option<Utf8PathBuf>,

/// A graph ref that is accessible in Apollo Studio.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

graphRef? or, maybe graph reference? I don't know how common graph ref is outside of apollo

@jonathanrainer jonathanrainer added this to the v0.25.0 milestone Jul 15, 2024
@jonathanrainer jonathanrainer added the feature 🎉 new commands, flags, functionality, and improved error messages label Jul 15, 2024
@dotdat dotdat force-pushed the dotdat/rover-dev-graphref branch from 42a18c7 to 08b4a77 Compare July 16, 2024 15:48
@dotdat dotdat merged commit 36e1db3 into main Jul 16, 2024
18 checks passed
@dotdat dotdat deleted the dotdat/rover-dev-graphref branch July 16, 2024 21:49
@jonathanrainer jonathanrainer mentioned this pull request Jul 19, 2024
jonathanrainer added a commit that referenced this pull request Jul 22, 2024
# [0.25.0] - 2024-07-22

## 🚀 Features

- **Enable Retries For Transient Errors Connecting To Graphs/Subgraphs -
@jonathanrainer PR #1936**

This turns on retries at the HTTP level for connections to
graphs/subgraphs to minimize connection resets and cancellations. Also,
a new --subgraph-retries flag for rover dev lets you set the number of
retries allowed when trying to re-establish a connection.

- **Add `--graph-ref` flag to `rover dev` - @dotdat PR #1984**

Introduces subgraph mirroring to rover dev. Subgraph mirroring inherits
the subgraph routing URLs and schemas from an existing Studio graphref.
This makes it easy to spin up a locally running supergraph without
maintaining a supergraph config. [See
here](https://www.apollographql.com/docs/rover/commands/dev#starting-a-session-from-a-graphos-studio-variant)
for more information.

## 🐛 Fixes

- **Fixes issues related to passing filenames to `--output` -
@jonathanrainer PR #1996**

An issue was raised whereby previous versions of Rover supported passing
filenames to the `--output` flag but this was
broken in v0.24.0. This has now been fixed and the previous
functionality restored.

## 🛠 Maintenance

- **Expand Smoke Tests To Run On All Supported Platforms -
@jonathanrainer PR #1980**
- **Fix cron expression, so it runs only once per day - @jonathanrainer
PR #1986**
- **Ensure we always use the correct version of Federation when testing
- @jonathanrainer PR #1987**
- **Add manual Smoke test invocation and pin Windows to `npm@9` for
testing - @jonathanrainer PR #1989**
- **Update apollographql/router to v1.51.0 - @jonathanrainer PR #1988**
- **Update node.js packages - @jonathanrainer PR #1979**

Includes `@eslint/compat` to v1.1.1, `eslint` to v9.7.0, `node.js` to
v20.15.1, `npm` to v10.8.2 and `prettier` to v3.3.3

- **Make sure x86 Mac Tests use 'latest' supergraph plugin version -
@jonathanrainer PR #1990**
- **Make sure homebrew runs `brew update` when we use it -
@jonathanrainer PR #1993**



## 📚 Documentation

- **Adds `graph-ref` flag to dev subcommand docs - @jackonawalk PR
#1945**
- **Update schema proposals capabilities docs - @Meschreiber PR #1949**
aaronArinder pushed a commit that referenced this pull request Aug 1, 2024
**NOTE: This should not be merged until #1874 has been merged, and then
this rebased on top**

In #1984 we added support to pass a `--graph-ref` flag to `rover dev`.
Since `supergraph compose` is performing the same function as `rover
dev` it makes sense to expose the same option there too. However, this
requires some refactoring in order to make work.

In principle the idea is fairly simple, we should centralise the
construction of the SupergraphConfig object so that both `dev` and
`supergraph compose` can hook in to it from a central location. However
to do this I've also had to add a fair amount of testing because there
was very little coverage in this area, however, due to @dotdat's work on
#1977 we have a lot more test coverage than before. That work has been
integrated into this PR.

Further more @dotdat was working on another PR #1985 , which optimises
the calls made by the `--graph-ref` option to fetch subgraphs in one
request rather than multiple. Due to being in this area and working on
the `--graph-ref` option it also made sense to integrate that PR here as
well, to prevent a complicated rebase later on.

This PR has been tested by the addition of unit tests and running
`supergraph compose` locally.

_There is also a small change to `deny.toml` in this PR to add support
for BSD-2-Clause licences. We already support BSD-3-Clause, and 2-Clause
is strictly a subset so this should not be a problem_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🎉 new commands, flags, functionality, and improved error messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants