Repository navigation
Add root dirs to userns - #981
Conversation
Reviewer's GuideThis PR updates the userns helper and its tests to support explicit root directory options for qm, and ensures the generated quadlet has the required [Container] section, aligning function signatures and filesystem layout between the script and tests. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
setup_test_env,MOCK_SYSUSERS_DIRis created twice; you can drop the secondmkdir -pcall to avoid redundant directory creation. - The
test_generate_qm_dropin_custom_usertest currently setstest_user="qm_root", which contradicts the test name and expectation of a custom username; updating this to a distinct value (e.g.,custom_user_123) will better validate custom user handling. - The change in
verify_sysusers_formattolocal config_file="${1}"is a no-op compared to the original and could be reverted to keep the function focused on behavior changes only.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `setup_test_env`, `MOCK_SYSUSERS_DIR` is created twice; you can drop the second `mkdir -p` call to avoid redundant directory creation.
- The `test_generate_qm_dropin_custom_user` test currently sets `test_user="qm_root"`, which contradicts the test name and expectation of a custom username; updating this to a distinct value (e.g., `custom_user_123`) will better validate custom user handling.
- The change in `verify_sysusers_format` to `local config_file="${1}"` is a no-op compared to the original and could be reverted to keep the function focused on behavior changes only.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request refactors the userns script and its associated unit tests to support custom root directories (--root-dir and --qm-root-dir) for the host and QM filesystems. Key feedback includes addressing potential path concatenation bugs caused by trailing slashes in directory variables, fixing a bug where grep checks host files instead of the specified custom root directory, removing a redundant directory creation in the test setup, and correcting a test logic error where the custom user test incorrectly uses the default root user.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
By providing the --root-dir and --qm-root-dir option, the userns script is able to fetch information from QM and create files on the host machine in the proper places. Signed-off-by: Michael Engel <mengel@redhat.com>
Signed-off-by: Michael Engel <mengel@redhat.com>
71e2aaa to
afac65a
Compare
|
There is a know issue regarding tests failing. |
This PR does
[Containersection to userns generated quadletSummary by Sourcery
Add root directory support to userns-generated configuration and update related tests.
New Features:
Enhancements:
Tests: