chore: add option for staging repos to dev-lima#386
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThis PR adds configurable support for deploying staging package repositories to the dev-lima environment. Configuration variables flow through Make and Ansible to role-level package management, enabling conditional switching between staging and release repositories in both Debian and RHEL-based systems. ChangesStaging Package Repository Testing
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
a298686 to
bb26925
Compare
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
Makefile (1)
415-417: ⚡ Quick winPass
DEV_LIMA_USE_STAGING_PACKAGESexplicitly to the sub-make for clarity.The
dev-lima-deploytarget explicitly passesDEV_LIMA_OSbut relies on implicit command-line variable inheritance forDEV_LIMA_USE_STAGING_PACKAGES. While this works (Make exports command-line variables to sub-makes automatically), explicit passing improves consistency and makes the variable flow easier to trace.♻️ Proposed change
.PHONY: dev-lima-deploy dev-lima-deploy: - $(MAKE) -C lima deploy DEV_LIMA_OS=$(DEV_LIMA_OS) + $(MAKE) -C lima deploy DEV_LIMA_OS=$(DEV_LIMA_OS) DEV_LIMA_USE_STAGING_PACKAGES=$(DEV_LIMA_USE_STAGING_PACKAGES)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Makefile` around lines 415 - 417, Update the dev-lima-deploy Make target so it explicitly forwards the DEV_LIMA_USE_STAGING_PACKAGES variable to the sub-make call; in the Make rule for the target named dev-lima-deploy (which currently runs "$(MAKE) -C lima deploy DEV_LIMA_OS=$(DEV_LIMA_OS)"), add "DEV_LIMA_USE_STAGING_PACKAGES=$(DEV_LIMA_USE_STAGING_PACKAGES)" to the invocation so the sub-make receives that variable explicitly.lima/roles/rhel_prerequisites/tasks/main.yaml (1)
39-52: ⚖️ Poor tradeoffConsider using a more targeted regex pattern to avoid unintended replacements.
The unanchored
regexp: releaseandregexp: stagingpatterns will match these words anywhere in/etc/yum.repos.d/pgedge.repo. While YUM repo files are typically simple INI-format files where "release" and "staging" appear mainly in baseurl paths (e.g.,https://dnf.pgedge.com/release/→https://dnf.pgedge.com/staging/), a more defensive approach would be to use anchored patterns matching the specific baseurl line. That said, the Debian implementation uses the same pattern without reported issues, so this is acceptable for a development environment.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lima/roles/rhel_prerequisites/tasks/main.yaml` around lines 39 - 52, The replace tasks "Reconfigure pgEdge repository for staging packages" and "Reconfigure pgEdge repository for release packages" use unanchored regexes ("release" / "staging") that may match unintended text; instead update the ansible.builtin.replace calls to target only the baseurl line (e.g., an anchored pattern matching lines starting with optional whitespace then "baseurl=" and containing the word "release" or "staging" respectively) so only the repository URL is switched, and keep the same path (/etc/yum.repos.d/pgedge.repo) and register variables.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@lima/roles/rhel_prerequisites/tasks/main.yaml`:
- Around line 39-52: The replace tasks "Reconfigure pgEdge repository for
staging packages" and "Reconfigure pgEdge repository for release packages" use
unanchored regexes ("release" / "staging") that may match unintended text;
instead update the ansible.builtin.replace calls to target only the baseurl line
(e.g., an anchored pattern matching lines starting with optional whitespace then
"baseurl=" and containing the word "release" or "staging" respectively) so only
the repository URL is switched, and keep the same path
(/etc/yum.repos.d/pgedge.repo) and register variables.
In `@Makefile`:
- Around line 415-417: Update the dev-lima-deploy Make target so it explicitly
forwards the DEV_LIMA_USE_STAGING_PACKAGES variable to the sub-make call; in the
Make rule for the target named dev-lima-deploy (which currently runs "$(MAKE) -C
lima deploy DEV_LIMA_OS=$(DEV_LIMA_OS)"), add
"DEV_LIMA_USE_STAGING_PACKAGES=$(DEV_LIMA_USE_STAGING_PACKAGES)" to the
invocation so the sub-make receives that variable explicitly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: e73a6b43-2b36-4a8e-8e29-00e78babbd8f
📒 Files selected for processing (9)
Makefiledocs/development/running-locally.mdlima/Makefilelima/ansible.cfglima/roles/deb_prerequisites/tasks/main.yamllima/roles/deb_prerequisites/vars/main.yamllima/roles/rhel_prerequisites/tasks/main.yamllima/roles/rhel_prerequisites/vars/main.yamllima/vars.yaml
Adds a new deploy option to enable the staging repository in the dev-lima environment: ```sh make dev-lima-deploy DEV_LIMA_USE_STAGING_PACKAGES=true ```
bb26925 to
12f0910
Compare
Adds a new deploy option to enable the staging repository in the dev-lima environment:
See the doc updates included in this commit for further usage instructions.