-
Notifications
You must be signed in to change notification settings - Fork 71
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
Add script to adjust modules afer dep got migrated #729
base: master
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ekohl/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.