Skip to content

Conversation

Eeshu-Yadav
Copy link
Contributor

@Eeshu-Yadav Eeshu-Yadav commented Sep 4, 2025

  • 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/

Fixes : #70

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines 197 to 202
path.file_name()
.unwrap()
.to_str()
.unwrap()
.trim_end_matches(".yaml")
.replace("envoy-", "orion-")
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

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.

Suggested change
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>
@Eeshu-Yadav Eeshu-Yadav force-pushed the fix/yaml-new-files-issue-70 branch from e049bcd to 8604d32 Compare September 4, 2025 15:02
@kmesh-bot kmesh-bot added size/S and removed size/XS labels Sep 4, 2025
@Eeshu-Yadav
Copy link
Contributor Author

@YaoZengzeng kidnly review this

@kmesh-bot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dawid-nowak
Copy link
Member

/lgtm

@kmesh-bot kmesh-bot added the lgtm label Sep 11, 2025
@kmesh-bot kmesh-bot merged commit 7405f98 into kmesh-net:main Sep 11, 2025
4 checks passed
@Eeshu-Yadav Eeshu-Yadav deleted the fix/yaml-new-files-issue-70 branch September 19, 2025 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Clarification Needed on Generated *-new.yaml Files
3 participants