-
Notifications
You must be signed in to change notification settings - Fork 16
Fix : Generate *-new.yaml files to temp directory instead of orion-proxy/conf/ #85
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
Fix : Generate *-new.yaml files to temp directory instead of orion-proxy/conf/ #85
Conversation
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.
Summary of Changes
Hello @Eeshu-Yadav, 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 addresses an issue where temporary test output files were being generated directly within the project's source tree. By redirecting these files to the system's temporary directory, it prevents the accidental inclusion of test artifacts in commits, thereby improving repository hygiene and developer workflow.
Highlights
- Test Output Location: The roundtrip_configs test now writes generated *-new.yaml files to the system's temporary directory (std::env::temp_dir()) instead of a fixed path within the repository (orion-proxy/conf/).
- Preventing Accidental Commits: This modification ensures that temporary test artifacts are not inadvertently committed to the version control system, maintaining a cleaner repository.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
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 .gemini/
folder in the base of the repository. Detailed instructions can be found here.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request correctly addresses the issue of test artifacts being written to the source directory by redirecting them to the system's temporary directory. This is a good practice that prevents accidental commits of generated files. The implementation is straightforward and effective. I have one suggestion to improve the robustness of the test code by replacing unwrap()
calls with expect()
for better error diagnostics.
path.file_name() | ||
.unwrap() | ||
.to_str() | ||
.unwrap() | ||
.trim_end_matches(".yaml") | ||
.replace("envoy-", "orion-") |
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.
While the unwrap()
calls are likely safe due to the checks in the preceding if
condition, it's a good practice to use expect()
with a descriptive message instead, even in tests. This provides more context if the test ever fails due to an unexpected file name (e.g., one that isn't valid UTF-8), making debugging easier.
path.file_name() | |
.unwrap() | |
.to_str() | |
.unwrap() | |
.trim_end_matches(".yaml") | |
.replace("envoy-", "orion-") | |
path.file_name() | |
.expect("path should have a file name") | |
.to_str() | |
.expect("file name should be valid UTF-8") | |
.trim_end_matches(".yaml") | |
.replace("envoy-", "orion-") |
…nstead of orion-proxy/conf/ - Changed the roundtrip_configs test to write *-new.yaml files to std::env::temp_dir() - This prevents test artifacts from being accidentally committed to the repository - Files are now written to /tmp/ instead of orion-proxy/conf/ Signed-off-by: Eeshu-Yadav <eeshuyadav123@gmail.com>
e049bcd
to
8604d32
Compare
@YaoZengzeng kidnly review this |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dawid-nowak The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
Fixes : #70