Add script to adjust modules afer dep got migrated#729
Add script to adjust modules afer dep got migrated#729bastelfreak wants to merge 1 commit intovoxpupuli:masterfrom
Conversation
be39fd1 to
d030979
Compare
| fi | ||
|
|
||
| # fix all modules with systemd in .fixtures.yml | ||
| sed --in-place 's#camptocamp/puppet-systemd#voxpupuli/puppet-systemd#' modules/voxpupuli/puppet-*/.fixtures.yml |
There was a problem hiding this comment.
FreeBSD does not have long options… A more portable solution would be:
| sed --in-place 's#camptocamp/puppet-systemd#voxpupuli/puppet-systemd#' modules/voxpupuli/puppet-*/.fixtures.yml | |
| sed -I '' 's#camptocamp/puppet-systemd#voxpupuli/puppet-systemd#' modules/voxpupuli/puppet-*/.fixtures.yml |
…but POSIX does not have in-place edit either (no -I / -i) so I am not sure about the best way to handle this if we want it to be portable.
Maybe just set -e at the beginning of the script to exit as soon as the first command fail?
There was a problem hiding this comment.
You've got ruby involved with a puppet agent so you could use that :)
ruby -pi -e "gsub(/before/, 'after')" filename
|
So rather than building these one-off solutions I started voxpupuli/metadata_json_deps#7. It would rely on the Puppet Forge to have them deprecated with the proper replacement, but it's scalable. I think the next step should be to introduce a "fix" mode in that gem so it can rectify the dependency. It could open the path to dependabot-style checks. |
|
@bastelfreak thoughts on closing this? The check mode is currently there. We also migrated most if not all systemd modules. If we do have a new big change, I think it makes sense we focus our efforts on enhancing the generic replacement tool instead. |
the camptocamp/systemd module is now voxpupuli/systemd. I wrote a script to update the namespace in .fixtures.yml, the namespace and upper version in metadata.json and to create a pull request afterwards. Call it like this: ``` export GITHUB_TOKEN=... ./bin/clean-git-checkouts ./bin/systemd_module_migration.sh ``` This script can be adjusted for other modules. None of our modules install the systemd module in spec/spec_helper_acceptance.rb nor spec/acceptance/*, so I didn't implement this.
the camptocamp/systemd module is now voxpupuli/systemd. I wrote a script
to update the namespace in .fixtures.yml, the namespace and upper
version in metadata.json and to create a pull request afterwards.
Call it like this:
This script can be adjusted for other modules. None of our modules
install the systemd module in spec/spec_helper_acceptance.rb nor
spec/acceptance/*, so I didn't implement this.