fix(examples): add v prefix to collection version in requirements.yml#23
fix(examples): add v prefix to collection version in requirements.yml#23
Conversation
|
Warning Rate limit exceeded
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe changes update version references for the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
There was a problem hiding this comment.
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.
| "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}}}" |
There was a problem hiding this comment.
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"There was a problem hiding this comment.
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.1 → version: 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.
kitsunoff
left a comment
There was a problem hiding this comment.
LGTM. Straightforward fix — version field now matches the v-prefixed git tags, and Renovate config preserves the prefix on future bumps via autoReplaceStringTemplate.
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>
4d5837e to
34950c0
Compare
The release workflow creates git tags with
vprefix (e.g.v1.2.2),but
examples/*/requirements.ymlreferenced versions without it (1.2.2).Since
ansible-galaxy collection installwithtype: gitchecks out theexact version string, the missing prefix caused installation failures:
Changes
vprefix tocozystack.installerversion in all three examplerequirements files (ubuntu, rhel, suse)
autoReplaceStringTemplatefor the requirements.ymlregex manager so future version bumps preserve the
vprefixNotes
galaxy.ymlanddefaults/main.ymlintentionally keep versions withoutv— Ansible Galaxy collection metadata and Helm chart references do notuse tag-style prefixes.
Closes #17
Summary by CodeRabbit
vprefix format.