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

Allow cookbook uploads without dependency resolution. Add spec. #296

Merged
merged 1 commit into from
Jan 16, 2013

Conversation

chrisroberts
Copy link
Contributor

No description provided.

@@ -188,6 +188,11 @@ def update(*cookbook_names)
default: false,
desc: "Skip Ruby syntax check when uploading cookbooks",
aliases: "-s"
option :nodeps,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would personally prefer if this were :no_dependencies (--no-dependencies). I think it's far better to be specific. --nodeps isn't very informative. You already have the "short-form" -D.

reset added a commit that referenced this pull request Jan 16, 2013
Allow cookbook uploads without dependency resolution. Add spec.
@reset reset merged commit 627b444 into berkshelf:master Jan 16, 2013
@chrisroberts
Copy link
Contributor Author

@reset @sethvargo updated option name and added custom class/exit code in the branch this pull request was based on if it would be useful.

reset added a commit that referenced this pull request Jan 16, 2013
This reverts commit 627b444, reversing
changes made to cf68305.
@reset
Copy link
Contributor

reset commented Jan 16, 2013

@chrisroberts reverted this initial PR.

ode/berkshelf (refactor-nodeps ✘)✹ ᐅ bundle exec bin/berks upload -D
Using artifact (0.9.8)
Using build-essential (0.7.0)
/Users/reset/code/berkshelf/lib/berkshelf/berksfile.rb:512:in `upload': Failed to locate requested cookbook(s). (RuntimeError)
  - Cookbooks uploaded without dependencies must be defined within Berksfile.
    from /Users/reset/code/berkshelf/lib/berkshelf/cli.rb:230:in `upload'
    from /Users/reset/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
    from /Users/reset/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /Users/reset/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor.rb:275:in `dispatch'
    from /Users/reset/code/berkshelf/lib/berkshelf/cli.rb:10:in `dispatch'
    from /Users/reset/.rbenv/versions/1.9.3-p327/lib/ruby/gems/1.9.1/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
    from bin/berks:6:in `<main>'

This error message is not clear enough to why the upload failed. The expected behavior from the description of the CLI flag is that the explicitly defined cookbooks in the Berksfile (in this case, artifact and build-essential) would be uploaded but their dependencies would be skipped.

solution = resolve(options)

if(options[:nodeps])
r = resolver(options)
Copy link
Contributor

Choose a reason for hiding this comment

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

we can clean this up, but please take a look at the surrounding code and match the style.

  • no single letter variables
  • no parentheses around parameters to control statements (if, then, else)
  • do/end on multiline blocks

@reset
Copy link
Contributor

reset commented Jan 16, 2013

prefer the skip-dependencies flag/option to nodeps

@berkshelf berkshelf locked and limited conversation to collaborators Jun 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants