-
Notifications
You must be signed in to change notification settings - Fork 246
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
compare scaffold folders instead of rebuilding #5186
Conversation
This adds to the repository the files that the scaffold test is supposed to generate, makes sure they are built and tested as part of the workspace, then when the scaffold test runs, instead of rebuilding a router from scratch, we only compare that the generated folder is the same. To that end, we skip the generated `Cargo.toml` files because they will contain hardcoded paths dependent on the repository's path
@Geal, please consider creating a changeset entry in |
CI performance tests
|
# Update our build image and install required packages | ||
RUN apt-get update | ||
RUN apt-get -y install \ | ||
npm \ |
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.
npm is no longer needed when using router-bridge from crates.io, is it?
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.
probably. I have not rewritten the templated Dockerfile to follow our latest version
|
||
2. Run the Apollo Router | ||
|
||
During development it is convenient to use `cargo run` to run the Apollo Router as it will |
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.
Was this sentence accidentally cut off?
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.
looks like it, but that was in the original template https://github.com/apollographql/router/blob/dev/apollo-router-scaffold/templates/base/README.md
use serde::Deserialize; | ||
use tower::BoxError; | ||
{{#if type_auth}} | ||
use apollo_router::layers::ServiceBuilderExt; | ||
use std::ops::ControlFlow; | ||
use tower::ServiceExt; | ||
use tower::ServiceBuilder; | ||
use tower::ServiceExt; | ||
{{/if}} | ||
{{#if type_tracing}} | ||
use apollo_router::layers::ServiceBuilderExt; | ||
use tower::ServiceExt; | ||
use tower::ServiceBuilder; | ||
use tower::ServiceExt; |
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.
Are these changes intentional? They look possibly made by a formatter that does understand template conditionnals
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.
yes, the formatter that understands template conditional was me 😅
The generated project that is now committed would be flagged by the lint step, the ignore
option in rustfmt.toml
is not stable yet, so I chose to format the project, then edit the template so it generates properly formatted code
Co-authored-by: Simon Sapin <[email protected]>
Co-authored-by: Simon Sapin <[email protected]>
This adds to the repository the files that the scaffold test is supposed to generate, makes sure they are built and tested as part of the workspace, then when the scaffold test runs, instead of rebuilding a router from scratch, we only compare that the generated folder is the same. To that end, we skip the generated
Cargo.toml
files because they will contain hardcoded paths dependent on the repository's pathDescription here
Fixes #issue_number
Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩