-
Notifications
You must be signed in to change notification settings - Fork 5k
feat: add generate encrypt key at test framework. #34182
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
Conversation
Summary of ChangesHello @xiao-77, 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 test framework by automating the generation of encryption keys for database tests. It centralizes the configuration of encryption settings within test classes and leverages the 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. 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.
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 introduces a feature to generate encryption keys within the test framework. However, it also introduces a critical command injection vulnerability and a high-severity issue with hardcoded cryptographic keys in test files. There are also several medium-severity issues related to code maintainability, portability, and an accidentally committed log file. I recommend addressing the security vulnerabilities before merging.
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.
Pull request overview
This pull request introduces automated encryption key generation in the test framework, replacing manual encryption key creation in test cases. The changes streamline encryption testing by generating keys automatically before taosd starts, eliminating the need for explicit create encrypt_key SQL statements in individual tests.
Key changes:
- Added framework support for encryption configuration via
encryptConfigclass attribute in test classes - Implemented
_generate_encrypt_keys_on_remotemethod to executetaoskcommand on remote servers during test setup - Removed manual encryption key creation from test cases and enabled previously disabled encryption tests
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| test/taoskLog.0 | Log file that should not be committed to version control |
| test/new_test_framework/utils/before_test.py | Added update_encrypt_config method to update YAML configuration with encryption settings |
| test/new_test_framework/taostest/components/taosd.py | Implemented automatic encryption key generation using taosk before starting taosd |
| test/conftest.py | Added hook to call update_encrypt_config when test class has encryptConfig attribute |
| test/ci/cases.task | Enabled two previously commented-out encryption-related test cases |
| test/cases/80-Components/01-Taosd/test_com_taosd_audit.py | Replaced manual key creation with framework-based encryption config |
| test/cases/02-Databases/01-Create/test_db_create_encrypt.py | Removed manual key creation and deleted obsolete test method for recreating dnode keys |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tomchon
left a comment
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.
LGTM
Description
Issue(s)
Checklist
Please check the items in the checklist if applicable.