Skip to content
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

CI: Print summary for outdated modules #866

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,20 @@ jobs:
- name: Run msync --noop
run: bundle exec msync clone --git-base=https://github.com/
- run: bundle exec rake metadata_deps
outdated_module_summary:
runs-on: ubuntu-latest
name: Prints a list of all modules with outdated modulesync_config version
steps:
- uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
bundler-cache: true
- name: Run msync --noop
run: bundle exec msync clone --git-base=https://github.com/
- name: Generate summary
run: bundle exec bin/outdated_modules_and_their_version

tests:
needs:
Expand Down
17 changes: 17 additions & 0 deletions bin/outdated_modules_and_their_version
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env ruby

require 'yaml'
require 'erb'

# the current version in modulesync_config
version = YAML.load(ERB.new(File.read('moduleroot/.msync.yml.erb')).result)['modulesync_config_version']

puts "current version: #{version}"
puts '---------------------------------------------'
puts "| Module\t| modulesync_config version |"
puts '---------------------------------------------'
Dir.glob('modules/voxpupuli/puppet-*/.msync.yml').each do|f|
version_module = YAML.load_file(f)['modulesync_config_version']
mod = f.split('/')[2]
puts "| #{mod}\t| #{version_module}\t|" if version != version_module
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is hacky and can be improved. But it provides a readable table and it works without any additional ruby gems.If someone wants to improve it, feel free.

end