[test] Use GitHub's GraphQL schema definition#256
Conversation
Summary of ChangesHello @joshlf, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the testing utility's GraphQL mock server by integrating a robust GraphQL parser and schema validator. This change ensures that the mock server accurately interprets and responds to GraphQL queries according to the official GitHub schema, moving away from brittle regex-based parsing. The update improves the reliability and maintainability of GraphQL-related tests. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request is a great improvement for the test suite's mock server. It replaces brittle regex-based parsing of GraphQL queries with apollo-compiler, using GitHub's actual GraphQL schema for validation. This makes the mock server much more robust, maintainable, and aligned with the real API. The code is well-structured into helper functions for different GraphQL operations. I have one suggestion to fully complete the transition away from string-based query matching by refactoring the remaining legacy fallback logic.
2ac19fd to
dcf561d
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a great improvement to the test suite's mock server. It replaces brittle regex-based parsing of GraphQL queries with a proper GraphQL parser using the apollo-compiler crate. This makes the mock server more robust and easier to maintain.
My review focuses on further improving this new implementation by fully eliminating the remaining string-based query matching. I've suggested a refactoring to the GraphQL query handling logic to make it more comprehensive and remove a legacy fallback, which will make the code cleaner and more aligned with the goals of this PR.
dcf561d to
6f570a0
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a significant improvement, replacing fragile regex-based GraphQL parsing in the test mock server with proper schema-based parsing and validation using apollo-compiler. This makes the tests more robust and maintainable. The code has been well-refactored into smaller, more manageable functions. I've provided a few suggestions to further enhance code quality by removing redundant code, avoiding hardcoded values, and using more idiomatic Rust constructs.
6f570a0 to
ede917a
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a great improvement to the test suite. It replaces a brittle regex-based GraphQL query parsing in the mock server with a robust approach using apollo-compiler and a real GraphQL schema. This makes the tests more reliable and easier to maintain. The code is also nicely refactored into smaller, more manageable functions.
I've added a couple of suggestions to make the test failure modes even clearer by using expect() for required GraphQL input fields, which will help catch issues in test setups more effectively.
ede917a to
9edc14c
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request is a great improvement to the test utilities. It replaces the fragile regex-based parsing of GraphQL queries in the mock server with apollo-compiler, which parses and validates queries against the actual GitHub GraphQL schema. This makes the mock server much more robust and reliable. The changes also include some nice refactorings, like using constants for default repository owner and name. I have one suggestion to further improve the accuracy of the mock server by validating the owner and name arguments in repository queries.
9edc14c to
c5d4485
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces significant improvements to the mock GitHub GraphQL server by integrating apollo-compiler for schema validation and query parsing. This change replaces the previous regex-based parsing, making the mock server more robust and accurate in simulating GitHub's GraphQL API. New test cases have been added to verify the repository query arguments, ensuring the mock server behaves as expected. The dependency updates in Cargo.lock reflect the addition of apollo-compiler and related crates, along with consistent thiserror versioning. Overall, these changes enhance the reliability and maintainability of the test utility.
gherrit-pr-id: Gbbdff26495afa0bdc2c7c26b01675eb5da40a4d1
c5d4485 to
27b3b7a
Compare
Latest Update: v7 — Compare vs v6
📚 Full Patch History
Links show the diff between the row version and the column version.