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

refactor(2904): clean up apollo federation #2906

Closed

Conversation

ayusham001
Copy link

/claim #2904

Summary:
Briefly describe the changes made in this PR.

Issue Reference(s):
Fixes #... (Replace "..." with the issue number)

Build & Testing:

  • I ran cargo test successfully.
  • I have run ./lint.sh --mode=fix to fix all linting issues raised by ./lint.sh --mode=check.

Checklist:

  • I have added relevant unit & integration tests.
  • I have updated the documentation accordingly.
  • I have performed a self-review of my code.
  • PR follows the naming convention of <type>(<optional scope>): <title>

@github-actions github-actions bot added type: chore Routine tasks like conversions, reorganization, and maintenance work. type: fix Iterations on existing features or infrastructure. labels Sep 25, 2024
@tusharmath tusharmath marked this pull request as draft September 25, 2024 04:45
@tusharmath
Copy link
Contributor

Added some comments. Moving to draft to reduce noise and improve CI efficiency. Once you are ready just mark it as "ready to review". Feel free to give a shoutout on the #contributors channel on Discord if you want immediate attention.

@ayusham001 ayusham001 changed the title fix: refactor: clean up apollo_federation::compile_service fix: clean up apollo federation Sep 25, 2024
@ayusham001 ayusham001 changed the title fix: clean up apollo federation refactor: clean up apollo federation Sep 25, 2024
@ayusham001 ayusham001 changed the title refactor: clean up apollo federation refactor(2904): clean up apollo federation Sep 25, 2024
@ayusham001 ayusham001 marked this pull request as ready for review September 25, 2024 05:18
@ayusham001
Copy link
Author

Sure, @tusharmath I have pushed some changes

Value::String("@provides".to_string()),
Value::String("@requires".to_string()),
Value::String("@composeDirective".to_string()),
Value::String("@interfaceObject".to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

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

better to take a vec of strings and map over them to create a value::string

assert_snapshot!(output);
} else {
panic!("Expected Valid::Success");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Drop if condition use unwrap.

service_doc.add_directive(federation_directive);

let mut complete_sdl = String::new();
writeln!(complete_sdl, "{}", crate::core::document::print(service_doc))?;
Copy link
Contributor

Choose a reason for hiding this comment

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

don't think we need writeln. Just call print directly.

@@ -1,4 +1,4 @@
mod apollo_federation;
pub mod federation;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub mod federation;
mod federation;

let result = compile_service(&cfg_module);

if let Ok(IR::Service(output)) = result {
assert_snapshot!(output);
Copy link
Contributor

Choose a reason for hiding this comment

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

Snapshot file is missing in the project.

@tusharmath tusharmath marked this pull request as draft September 25, 2024 07:23
Copy link

Action required: PR inactive for 5 days.
Status update or closure in 10 days.

@github-actions github-actions bot added the state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. label Sep 30, 2024
Copy link

PR closed after 10 days of inactivity.

@github-actions github-actions bot closed this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 Bounty claim state: inactive No current action needed/possible; issue fixed, out of scope, or superseded. type: chore Routine tasks like conversions, reorganization, and maintenance work. type: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants