Rename TPM2TOOLS_TCTI to RUST_TPM2_CLI_TCTI#6
Conversation
Summary of ChangesHello, 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 a potential naming conflict by standardizing the environment variable used for TCTI configuration within the project. The change improves clarity and avoids unintended interactions with external tools, ensuring a more robust and isolated configuration mechanism. Users will need to adjust their existing setups to accommodate this update. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
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 correctly renames the TPM2TOOLS_TCTI environment variable to RUST_TPM2_CLI_TCTI across the codebase, including documentation, command-line argument parsing, and internal logic. This change effectively avoids potential conflicts with tpm2-tools. The changes are consistent and well-executed. I have a couple of suggestions to improve code maintainability by reducing duplication and removing a magic string.
| let tcti_str = match tcti { | ||
| Some(s) => s.to_owned(), | ||
| None => std::env::var("TPM2TOOLS_TCTI").unwrap_or_else(|_| DEFAULT_TCTI.to_owned()), | ||
| None => std::env::var("RUST_TPM2_CLI_TCTI").unwrap_or_else(|_| DEFAULT_TCTI.to_owned()), | ||
| }; |
There was a problem hiding this comment.
There was a problem hiding this comment.
The proposed refactoring looks good to me, while it is irrelevant to this PR. It will likely be implemented during a future refactoring phase.
To prevent unintended conflicts between rust-tpm2-cli and tpm2-tools, rename the TCTI environment variable across the project. Signed-off-by: Takuma IMAMURA <209989118+hyperfinitism@users.noreply.github.com>
0415f68 to
175b14c
Compare
This PR renames the
TPM2TOOLS_TCTIenvironment variable toRUST_TPM2_CLI_TCTIto avoid unintended conflicts withtpm2-tools. This is a breaking API change.