-
Notifications
You must be signed in to change notification settings - Fork 78
Add a utility script to bump supported OS versions #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is msync exec for that. If it doesn't work, then we should enhance it so it does work.
| os_index = metadata['operatingsystem_support'].map { |os| os['operatingsystem'] }.index(options.os) | ||
|
|
||
| metadata['operatingsystem_support'][os_index]['operatingsystemrelease'] << options.version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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:
| 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 |
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):