Skip to content

fix(examples): add v prefix to collection version in requirements.yml#23

Merged
lexfrei merged 2 commits intomainfrom
fix/requirements-tag-prefix
Apr 15, 2026
Merged

fix(examples): add v prefix to collection version in requirements.yml#23
lexfrei merged 2 commits intomainfrom
fix/requirements-tag-prefix

Conversation

@lexfrei
Copy link
Copy Markdown
Contributor

@lexfrei lexfrei commented Apr 12, 2026

The release workflow creates git tags with v prefix (e.g. v1.2.2),
but examples/*/requirements.yml referenced versions without it (1.2.2).

Since ansible-galaxy collection install with type: git checks out the
exact version string, the missing prefix caused installation failures:

git checkout 1.2.2
error: pathspec '1.2.2' did not match any file(s) known to git

Changes

  • Add v prefix to cozystack.installer version in all three example
    requirements files (ubuntu, rhel, suse)
  • Configure Renovate autoReplaceStringTemplate for the requirements.yml
    regex manager so future version bumps preserve the v prefix

Notes

galaxy.yml and defaults/main.yml intentionally keep versions without
v — Ansible Galaxy collection metadata and Helm chart references do not
use tag-style prefixes.

Closes #17

Summary by CodeRabbit

  • Chores
    • Updated Ansible dependencies to reference versioning with the v prefix format.
    • Enhanced configuration for automated dependency updates to support optional prefix characters in version strings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Warning

Rate limit exceeded

@lexfrei has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 40 minutes and 33 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 40 minutes and 33 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 20e9fa43-6568-4740-9eb6-123ffa9b622e

📥 Commits

Reviewing files that changed from the base of the PR and between 4d5837e and 34950c0.

📒 Files selected for processing (5)
  • CLAUDE.md
  • examples/rhel/requirements.yml
  • examples/suse/requirements.yml
  • examples/ubuntu/requirements.yml
  • renovate.json
📝 Walkthrough

Walkthrough

The changes update version references for the cozystack.installer Ansible collection across three example configurations from 1.2.2 to v1.2.2, and configure Renovate to automatically maintain this v-prefixed version format during dependency updates.

Changes

Cohort / File(s) Summary
Version Tag Updates
examples/rhel/requirements.yml, examples/suse/requirements.yml, examples/ubuntu/requirements.yml
Updated cozystack.installer collection version from 1.2.2 to v1.2.2 to match Git tag naming convention.
Renovate Configuration
renovate.json
Enhanced regex pattern to optionally match the leading v in version strings and added template for auto-replacement to format versions as v{{{newValue}}}.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 With a hop and a bound, we've added the v,
Git tags now match what they're meant to be,
Renovate learns to keep versions precise,
No more checkout errors—our fix is quite nice! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding the 'v' prefix to collection versions in requirements.yml files across examples.
Description check ✅ Passed The description provides context for the change, explains the problem, and lists the changes made, but does not include all template sections (missing Test plan checkbox completion).
Linked Issues check ✅ Passed The PR fully addresses issue #17 by adding the 'v' prefix to collection versions in all example requirements.yml files and configuring Renovate to preserve it.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #17: adding 'v' prefix to examples and configuring Renovate. No out-of-scope changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 fix/requirements-tag-prefix

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.

@lexfrei lexfrei marked this pull request as ready for review April 12, 2026 17:22
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a 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 updates the versioning format in several requirements.yml files to include a v prefix and modifies the Renovate configuration to handle this change. A review comment points out that the new Renovate regex and autoReplaceStringTemplate will likely result in double v prefixes (e.g., vv1.2.3) because the datasource tags already include the prefix. It is recommended to capture the optional prefix within the currentValue group and remove the hardcoded replacement template to ensure more robust updates.

Comment thread renovate.json
Comment on lines +38 to +42
"source:\\s*https://github\\.com/cozystack/ansible-cozystack\\.git\\s+type:\\s*git\\s+version:\\s*v?(?<currentValue>\\S+)"
],
"depNameTemplate": "ghcr.io/cozystack/cozystack/cozy-installer",
"datasourceTemplate": "docker"
"datasourceTemplate": "docker",
"autoReplaceStringTemplate": "source: https://github.com/cozystack/ansible-cozystack.git\n type: git\n version: v{{{newValue}}}"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The current Renovate configuration is likely to cause a double v prefix (e.g., vv1.2.3) during updates. Since the project's git tags (and likely the Docker tags from ghcr.io) already include the v prefix, newValue will contain it. By hardcoding another v in the autoReplaceStringTemplate and excluding it from the currentValue capture group, the prefix will be duplicated.

Additionally, using autoReplaceStringTemplate hardcodes the URL and indentation, which makes the configuration fragile. It is better to include the optional v prefix within the currentValue capture group and rely on Renovate's default replacement behavior, which only replaces the captured group. This approach is more robust and automatically handles both cases where the v might be present or missing in the file.

        "source:\\s*https://github\\.com/cozystack/ansible-cozystack\\.git\\s+type:\\s*git\\s+version:\\s*(?<currentValue>v?\\S+)"
      ],
      "depNameTemplate": "ghcr.io/cozystack/cozystack/cozy-installer",
      "datasourceTemplate": "docker"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Checked this against the most recent Renovate PR on this repo (#22, which bumped cozy-installer 1.2.1 → 1.2.2). That PR rewrote both galaxy.yml (version: 1.2.1version: 1.2.2) and the old requirements.yml entries without a v. In other words, for the ghcr.io/cozystack/cozystack/cozy-installer docker datasource Renovate emits newValue without the v prefix, so v{{{newValue}}} expands to v1.2.2, not vv1.2.2.

The alternative you suggest — capturing the optional v inside currentValue and relying on default replacement — would strip the v from the file on every bump, because Renovate replaces the whole captured group with the bare newValue. The hardcoded prefix in autoReplaceStringTemplate is precisely what keeps the v in place. Leaving as-is.

@lexfrei lexfrei enabled auto-merge (squash) April 12, 2026 17:27
@lexfrei lexfrei self-assigned this Apr 12, 2026
kitsunoff
kitsunoff previously approved these changes Apr 15, 2026
Copy link
Copy Markdown

@kitsunoff kitsunoff left a comment

Choose a reason for hiding this comment

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

LGTM. Straightforward fix — version field now matches the v-prefixed git tags, and Renovate config preserves the prefix on future bumps via autoReplaceStringTemplate.

lexfrei added 2 commits April 15, 2026 14:37
The release workflow creates git tags with v prefix (v1.2.2), but
requirements.yml files referenced versions without it (1.2.2).
ansible-galaxy collection install with type: git does git checkout
of the version string, so the missing v prefix caused installation
failures.

Update all three example requirements.yml to use v-prefixed versions.
Configure Renovate autoReplaceStringTemplate to preserve the v prefix
on future version bumps.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@lexfrei lexfrei merged commit d28697a into main Apr 15, 2026
5 checks passed
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.

Wrong tag reference in requirments.yaml

2 participants