Add a utility script to bump supported OS versions#989
Open
Add a utility script to bump supported OS versions#989
Conversation
Add support for a newer version of an Operating System if the previous version is supported. Update metadata.json, create a feature branch, commit, and open a PR automatically. If the previous version was not supported but older version are, prompt the user interactively for what to do. If the OS is not supported at all, do nothing. Typical usage (when Debian 13 is released): ``` bundle exec msync execute -B -- git pull bundle exec msync execute -B -- $PWD/bin/add-support-for-new-os -o Debian -v 13 ```
ekohl
requested changes
Aug 19, 2025
Member
ekohl
left a comment
There was a problem hiding this comment.
I don't think this belongs in our modulesync config. I wrote voxpupuli/puppet_metadata#188 which already knows about which OS releases could/should be added.
Comment on lines
+145
to
+150
| else | ||
| system "git", "checkout", "-b", options.branch_name | ||
| File.write('metadata.json', "#{pp_metadata}\n") | ||
| system "git", "add", "metadata.json" | ||
| system "git", "commit", "-m", "Add support for #{options.os} #{options.version}" | ||
| system "gh", "pr", "create", "--fill", "--draft", "--label", "enhancement" |
Member
There was a problem hiding this comment.
There is msync exec for that. If it doesn't work, then we should enhance it so it does work.
Comment on lines
+134
to
+136
| os_index = metadata['operatingsystem_support'].map { |os| os['operatingsystem'] }.index(options.os) | ||
|
|
||
| metadata['operatingsystem_support'][os_index]['operatingsystemrelease'] << options.version |
Member
There was a problem hiding this comment.
operatingsystemrelease can be nil and it doesn't deal with that. This is also fragile because it doesn't handle a missing OS (typo).
If anything you should probably do something like:
Suggested change
| os_index = metadata['operatingsystem_support'].map { |os| os['operatingsystem'] }.index(options.os) | |
| metadata['operatingsystem_support'][os_index]['operatingsystemrelease'] << options.version | |
| os = metadata['operatingsystem_support'].find { |os| os['operatingsystem'] == options.os } | |
| unless os | |
| exit 1 | |
| end | |
| if os['operatingsystemrelease'] | |
| os['operatingsystemrelease'] << options.version | |
| else | |
| os['operatingsystemrelease'] = [options.version] | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for a newer version of an Operating System if the previous
version is supported. Update metadata.json, create a feature branch,
commit, and open a PR automatically.
If the previous version was not supported but older version are, prompt
the user interactively for what to do.
If the OS is not supported at all, do nothing.
Typical usage (when Debian 13 is released):