-
Notifications
You must be signed in to change notification settings - Fork 681
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 GitFetcher and rework Fetchers+SourceReaders #1034
Conversation
dc02d50
to
d22029e
Compare
ref: resolved_ref } | ||
end | ||
|
||
def repo_path |
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.
This is unused, remove
Test failures look like a difference in Tempfile's api across ruby version, will update this to use a more compatible call in my next update. |
|
||
# InSpec Target Helper for Chef Compliance | ||
# reuses UrlHelper, but it knows the target server and the access token already | ||
# similar to `inspec exec http://localhost:2134/owners/%base%/compliance/%ssh%/tar --user %token%` | ||
module Compliance | ||
class Fetcher < Fetchers::Url | ||
class Fetcher < Inspec.fetcher(1) |
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.
👍
3c5942a
to
8250bcc
Compare
85fcad8
to
c4d5d76
Compare
94dc3f6
to
00fbd11
Compare
dd64089
to
079f894
Compare
@chris-rock Regarding changing Fetcher.resolve to only take a single hash, I've held off on that for now. Once I started it I realized that to do that we basically have to have another parsing mechanism somewhere else to translate from string -> hash and then suddenly some fetcher specific stuff lives outside that fetcher, which feels odd since they should be pluggable. I agree that the resolve() method signature is pretty odd now, definitely in favor of refactoring it, just thinking we might do that in a follow up. |
fixes #959 |
# displays a list of profiles | ||
def self.profiles | ||
url = "#{SUPERMARKET_URL}/api/v1/tools-search" | ||
def self.profiles(supermarket_url) |
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.
This breaks our CLI:
b inspec supermarket profiles
/Users/chartmann/Development/compliance/inspec/lib/bundles/inspec-supermarket/api.rb:13:in `profiles': wrong number of arguments (0 for 1) (ArgumentError)
from /Users/chartmann/Development/compliance/inspec/lib/bundles/inspec-supermarket/cli.rb:21:in `profiles'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:115:in `invoke'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:235:in `block in subcommand'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
from /Users/chartmann/Development/compliance/inspec/bin/inspec:9:in `<top (required)>'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/bin/inspec:23:in `load'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/bin/inspec:23:in `<main>'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/bin/ruby_executable_hooks:15:in `eval'
from /Users/chartmann/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/bin/ruby_executable_hooks:15:in `<main>'
Looks like we are missing a functional test for supermarket
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.
I propose to set the default to SUPERMARKET_URL
079f894
to
4ca0edd
Compare
4ca0edd
to
c497695
Compare
c497695
to
2d808f0
Compare
This adds a new git fetcher. In doing so, it also refactors how the fetchers work a bit to better support fetchers that need to resolve user-provided sources to fully specified sources appropriate for a lockfile. Signed-off-by: Steven Danna <[email protected]>
Signed-off-by: Steven Danna <[email protected]>
2d808f0
to
120b3d8
Compare
This adds a new git fetcher. In doing so, it also refactors how the
fetchers work a bit to better support fetchers that need to resolve
user-provided sources to fully specified sources appropriate for a
lockfile.