Skip to content

Conversation

@smortex
Copy link
Member

@smortex smortex commented Aug 19, 2025

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

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
```
Copy link
Member

@ekohl ekohl left a 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.

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"
Copy link
Member

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.

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
Copy link
Member

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:

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

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.

2 participants