Skip to content

chore: add option for staging repos to dev-lima#386

Draft
jason-lynch wants to merge 1 commit into
feat/PLAT-579/debian-support-iifrom
chore/staging-repos-in-dev-lima
Draft

chore: add option for staging repos to dev-lima#386
jason-lynch wants to merge 1 commit into
feat/PLAT-579/debian-support-iifrom
chore/staging-repos-in-dev-lima

Conversation

@jason-lynch
Copy link
Copy Markdown
Member

@jason-lynch jason-lynch commented May 14, 2026

Adds a new deploy option to enable the staging repository in the dev-lima environment:

make dev-lima-deploy DEV_LIMA_USE_STAGING_PACKAGES=true

See the doc updates included in this commit for further usage instructions.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 96816022-e5a1-4936-ac63-b39ed17dc80b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

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

Changes

Staging Package Repository Testing

Layer / File(s) Summary
Configuration entry points and variable threading
Makefile, lima/Makefile, lima/vars.yaml
New DEV_LIMA_USE_STAGING_PACKAGES Make variable defaults to false and is threaded through Ansible extra-vars to lima/vars.yaml use_staging_packages flag, establishing the invocation pathway.
Debian prerequisites with conditional staging/release repository switching
lima/roles/deb_prerequisites/vars/main.yaml, lima/roles/deb_prerequisites/tasks/main.yaml
Base prerequisites installation refactored to use loop instead of with_items; new pgedge_packages variable replaces hardcoded lists; conditional ansible.replace tasks switch pgedge.sources between staging and release, trigger package removal on configuration change, and reinstall via package variable.
RHEL prerequisites with conditional staging/release repository switching
lima/roles/rhel_prerequisites/vars/main.yaml, lima/roles/rhel_prerequisites/tasks/main.yaml
Unified base prerequisites task via loop; new pgedge_packages variable lists all pgEdge package names; conditional ansible.replace switches /etc/yum.repos.d/pgedge.repo between staging and release, removes and reinstalls pgedge_packages when repository configuration changes.
Documentation and supporting configuration
docs/development/running-locally.md, lima/ansible.cfg
New "Prerelease Package Testing" section documents the workflow for using DEV_LIMA_USE_STAGING_PACKAGES=true, reset steps, and distribution switching; Ansible config disables display_skipped_hosts output.

Poem

🐰 Staging repos hop through the Makefile's door,
Ansible variables dance to the playbook's score,
Conditional switches swap packages with ease,
Debian and RHEL both test packages to please!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is missing required sections (Changes, Testing, Checklist, Notes for Reviewers) from the template and lacks details about testing and documentation updates. Complete the PR description by adding the missing template sections, including a bulleted Changes list, Testing steps, completing the Checklist, and any relevant reviewer notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding an option for staging repositories in the dev-lima environment.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/staging-repos-in-dev-lima

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 14, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@jason-lynch jason-lynch force-pushed the chore/staging-repos-in-dev-lima branch from a298686 to bb26925 Compare May 14, 2026 20:51
@jason-lynch
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 14, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
Makefile (1)

415-417: ⚡ Quick win

Pass DEV_LIMA_USE_STAGING_PACKAGES explicitly to the sub-make for clarity.

The dev-lima-deploy target explicitly passes DEV_LIMA_OS but relies on implicit command-line variable inheritance for DEV_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 tradeoff

Consider using a more targeted regex pattern to avoid unintended replacements.

The unanchored regexp: release and regexp: staging patterns 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

📥 Commits

Reviewing files that changed from the base of the PR and between d407d48 and bb26925.

📒 Files selected for processing (9)
  • Makefile
  • docs/development/running-locally.md
  • lima/Makefile
  • lima/ansible.cfg
  • lima/roles/deb_prerequisites/tasks/main.yaml
  • lima/roles/deb_prerequisites/vars/main.yaml
  • lima/roles/rhel_prerequisites/tasks/main.yaml
  • lima/roles/rhel_prerequisites/vars/main.yaml
  • lima/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
```
@jason-lynch jason-lynch force-pushed the chore/staging-repos-in-dev-lima branch from bb26925 to 12f0910 Compare May 14, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant