Skip to content

DNM: Create dist if it doesn't exist - #558

Draft
Alex-Welsh wants to merge 6 commits into
mainfrom
bump-squeezer-bodge
Draft

DNM: Create dist if it doesn't exist#558
Alex-Welsh wants to merge 6 commits into
mainfrom
bump-squeezer-bodge

Conversation

@Alex-Welsh

Copy link
Copy Markdown
Member

This PR is only up for discussion, not to be merged

Bumps Ansible pulp collections (pulp squeezer and our downstream
ansible-collection-pulp) to the same versions we currently use in SKC.
These should come with bugfixes and performance improvements.

These now depend on pulp-glue and pulp-glue-deb pip packages, which have
been added to requirements.txt
@Alex-Welsh
Alex-Welsh requested a review from a team as a code owner August 4, 2026 09:29
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3960e8ef-0ea7-43cd-a681-afc8e056cba3

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

Updates Python setup and dependencies, including newer Pulp collections and pulp-glue packages. Enhances Debian and RPM repository tests to create a distribution when none exists, then re-query it.

Walkthrough

The setup now uses Python 3.12.x and installs updated Pulp packages and collections. Debian and RPM repository tests now select existing distributions, create missing distributions, and re-query them.

Changes

Pulp tooling setup

Layer / File(s) Summary
Pulp tooling setup
.github/actions/setup/action.yml, requirements.txt, requirements.yml
The setup uses Python 3.12.x and installs the declared requirements. The requirements add pulp-glue, pulp-glue-deb, and setuptools. The Ansible requirements use the Git-based Pulp collection and pulp.squeezer 0.3.0.

Distribution query flow

Layer / File(s) Summary
Distribution query and creation flow
ansible/test-pulp-repo-version-query.yml
Debian and RPM tasks collect matching distributions, select the first existing distribution, create one when none exists for the latest publication, and re-query after creation. Version fact expressions are reformatted.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AnsibleTest as Ansible test
  participant DistributionQuery as Distribution query
  participant DistributionCreation as Distribution creation
  AnsibleTest->>DistributionQuery: collect matching distributions
  DistributionQuery-->>AnsibleTest: return distribution list
  AnsibleTest->>DistributionCreation: create distribution when none exists
  DistributionCreation-->>AnsibleTest: return created distribution
  AnsibleTest->>DistributionQuery: re-query distributions
  DistributionQuery-->>AnsibleTest: return updated distribution list
Loading
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
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.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 7b9d3d0e-65eb-4758-a9c9-3bea5d7ba0a3

📥 Commits

Reviewing files that changed from the base of the PR and between 8b60c57 and eb7ceea.

📒 Files selected for processing (4)
  • .github/actions/setup/action.yml
  • ansible/test-pulp-repo-version-query.yml
  • requirements.txt
  • requirements.yml

Comment thread ansible/test-pulp-repo-version-query.yml Outdated
Comment thread requirements.yml
@Alex-Welsh
Alex-Welsh force-pushed the bump-squeezer-bodge branch 2 times, most recently from 423a72a to ef228b2 Compare August 4, 2026 11:50
@Alex-Welsh
Alex-Welsh force-pushed the bump-squeezer-bodge branch 2 times, most recently from 9ca7402 to ea54d7d Compare August 4, 2026 14:21
@Alex-Welsh
Alex-Welsh marked this pull request as draft August 4, 2026 14:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 59d21ccc-ade3-4c9d-b095-01278aca2dcf

📥 Commits

Reviewing files that changed from the base of the PR and between eb7ceea and ea54d7d.

📒 Files selected for processing (1)
  • ansible/test-pulp-repo-version-query.yml

test_pulp_repository_deb_repo_details: "{{ (_deb_composite | from_json).details }}"
vars:
_deb_composite: >-
{%- set short_map = test_pulp_repository_deb_repo_versions | default({}) -%}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

# Trace prior assignments and repeated imports of this fact producer.
rg -n -g '*.yml' -g '*.yaml' \
  'test_pulp_repository_(deb|rpm)_repo_versions|test-pulp-repo-version-query\.yml|import_playbook:|include_tasks:' .

Repository: stackhpc/stackhpc-release-train

Length of output: 5012


🏁 Script executed:

wc -l ./ansible/test-pulp-repo-version-query.yml

Repository: stackhpc/stackhpc-release-train

Length of output: 216


🏁 Script executed:

cat -n ./ansible/test-pulp-repo-version-query.yml | sed -n '115,165p'

Repository: stackhpc/stackhpc-release-train

Length of output: 3457


🏁 Script executed:

cat -n ./ansible/test-pulp-repo-version-query.yml | sed -n '210,255p'

Repository: stackhpc/stackhpc-release-train

Length of output: 2632


Initialise the short_map variables to {} to prevent accumulation across repeated executions.

The current implementation seeds short_map from the previous execution's fact using the default() filter, whilst details_map is reset to {}. When the playbook executes again, repositories that no longer exist in the current dev_pulp_distribution_deb or dev_pulp_distribution_rpm lists will persist in short_map, creating a mismatch with details_map.

The loop updates short_map entries only if a matching distribution exists; it does not remove entries that are no longer current. Downstream code that uses both test_pulp_repository_deb_repo_versions and test_pulp_repository_deb_repo_details facts may fail if an orphaned version key has no matching detail entry.

To fix:

  • ansible/test-pulp-repo-version-query.yml, line 129: change {%- set short_map = test_pulp_repository_deb_repo_versions | default({}) -%} to {%- set short_map = {} -%}
  • ansible/test-pulp-repo-version-query.yml, line 220: change {%- set short_map = test_pulp_repository_rpm_repo_versions | default({}) -%} to {%- set short_map = {} -%}
📍 Affects 1 file
  • ansible/test-pulp-repo-version-query.yml#L129-L129 (this comment)
  • ansible/test-pulp-repo-version-query.yml#L220-L220

@Alex-Welsh
Alex-Welsh force-pushed the bump-squeezer-bodge branch 3 times, most recently from fb22840 to 949a4bb Compare August 4, 2026 14:56
@Alex-Welsh
Alex-Welsh force-pushed the bump-squeezer-bodge branch from 949a4bb to 6dc9b09 Compare August 4, 2026 14:57
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