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

Adds validate task #35

Merged
merged 2 commits into from
Jul 25, 2019
Merged

Adds validate task #35

merged 2 commits into from
Jul 25, 2019

Conversation

logicminds
Copy link
Contributor

  • Adds basic tests for ra10ke
  • Adds a text based Puppetfile parser module
  • Adds a monkey patch file for string colors
  • Adds a new validate task that checks all the refs
    of all the git urls.
  • Adds some new development dependencies
  • Adds table_print gem for pretty output with validate task

.ruby-version Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
ra10ke.gemspec Outdated Show resolved Hide resolved
spec/spec_helper.rb Outdated Show resolved Hide resolved
@logicminds logicminds force-pushed the validate branch 2 times, most recently from 6ec9555 to e719e53 Compare July 2, 2019 23:05
@ZeroPointEnergy
Copy link
Contributor

ZeroPointEnergy commented Jul 3, 2019

Very nice addition, this will be very useful.

There seems to be an issue if the ref does not exist and does not start with a v or something. (The latest puppet-hiera version is v3.4.1, there is no 6.0.0 version):

$ cat some_dir/Puppetfile    
mod 'puppet-hiera',
  git: 'https://github.com/voxpupuli/puppet-hiera.git',
  tag: '6.0.0'

$ bundle exec rake r10k:validate
NAME  | URL                                           | REF   | STATUS
------|-----------------------------------------------|-------|-------
hiera | https://github.com/voxpupuli/puppet-hiera.git | 6.0.0 | 👍     
👍  Puppetfile looks good. 👍

$ cat some_dir/Puppetfile       
mod 'puppet-hiera',
  git: 'https://github.com/voxpupuli/puppet-hiera.git',
  tag: 'v6.0.0'

$ bundle exec rake r10k:validate
NAME  | URL                                           | REF    | STATUS
------|-----------------------------------------------|--------|-------
hiera | https://github.com/voxpupuli/puppet-hiera.git | v6.0.0 | 😨     
😨  Not all modules in the Puppetfile are valid. 😨

$ cat some_dir/Puppetfile       
mod 'puppet-hiera',
  git: 'https://github.com/voxpupuli/puppet-hiera.git',
  tag: 'abc'

$ bundle exec rake r10k:validate
NAME  | URL                                           | REF | STATUS
------|-----------------------------------------------|-----|-------
hiera | https://github.com/voxpupuli/puppet-hiera.git | abc | 👍     
👍  Puppetfile looks good. 👍

@logicminds logicminds force-pushed the validate branch 2 times, most recently from 5688eda to 1e0b78d Compare July 3, 2019 19:18
@logicminds
Copy link
Contributor Author

@ZeroPointEnergy good catch. That was definitely a bug which is now fixed in latest code.

 ~/voxpupuli/ra10ke$ PUPPETFILE=spec/fixtures/Puppetfile_test be rake r10k:validate
NAME  | URL                                           | REF    | STATUS
------|-----------------------------------------------|--------|-------
hiera | https://github.com/voxpupuli/puppet-hiera.git | 6.0.0  | 😨     
hiera | https://github.com/voxpupuli/puppet-hiera.git | v6.0.0 | 😨     
hiera | https://github.com/voxpupuli/puppet-hiera.git | abc    | 😨     
😨  Not all modules in the Puppetfile are valid. 😨

@logicminds
Copy link
Contributor Author

logicminds commented Jul 3, 2019

If you need a easy way to test this out on this branch do the following:

Update the Rakefile temporarily in this branch/repo with:

require 'ra10ke'
Ra10ke::RakeTask.new do |t|
    t.puppetfile_path = ENV['PUPPETFILE']
end

Then run PUPPETFILE=spec/fixtures/Puppetfile_test bundle exec rake r10k:validate

.gitignore Outdated Show resolved Hide resolved
  * Adds basic tests for ra10ke
  * Adds a text based Puppetfile parser module
  * Adds a monkey patch file for string colors
  * Adds a new validate task that checks all the refs
    of all the git urls.
  * Adds table_print gem for pretty output with validate task
Copy link
Member

@dhollinger dhollinger left a comment

Choose a reason for hiding this comment

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

Looks good to me, just a quick request to address what @bastelfreak noted here: https://github.com/voxpupuli/ra10ke/pull/35/files#r300161439

@logicminds
Copy link
Contributor Author

@dhollinger Everything looks good to me and updated all the newline endings. Any other comments?

Copy link
Member

@dhollinger dhollinger left a comment

Choose a reason for hiding this comment

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

LGTM

@logicminds logicminds merged commit 7bc0f85 into master Jul 25, 2019
@logicminds logicminds deleted the validate branch July 25, 2019 21:09
@logicminds logicminds mentioned this pull request Jul 25, 2019
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.

4 participants