summaryrefslogtreecommitdiff
path: root/spec/unit/policy_builder
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #11803 from chef/lcg/policyfile-run-listLamont Granquist2021-07-161-44/+115
|\
| * Support command line setting of run_list with policyfilesLamont Granquist2021-07-131-44/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow temporarily setting the run list to a different setting and still having the node saved (complimentary to setting an override run list which does not save the node). This can be used inside of test-kitchen for setting the run_list to a fixture cookbook that is not in the policyfile without needing to go through named_run_lists. This can also be used with -j or -r on provisioning to run a bootstrapping recipe, which will then be overridden by the policyfile. A switch is included to cause the node.run_list setting from the -j or -r setting (or setting via code with `node.run_list <<`) to persist and to override the policyfile. This is for sites which have adopted complicated run_list mutating workflows to make it so they can set Chef::Config[:policy_persist_run_list] to true and will be able to migrate those workflows more easily to a policyfile world. When it is run in this configuration it will always print a WARN level message that the policyfile is being overridden since it is not intended that the common state of the server would be to ignore the policyfile run_list. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* | Deprecate the old policyfile compat modeLamont Granquist2021-07-131-1/+11
|/ | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Support override run_lists in policyfilesLamont Granquist2021-06-222-18/+20
| | | | | | This extends override run_lists to work with policyfiles Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Remove copyright dateslcg/remove-copyright-datesLamont Granquist2020-04-133-3/+3
| | | | | | | | Legally incredibly dubious, particularly since we don't follow it strictly as policy, and we have git history instead, which does it right. This is just a waste of time and a cargo cult. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Layout/MultilineMethodCallIndentationLamont Granquist2019-07-021-2/+2
| | | | | | | | Layout/MultilineMethodCallIndentation: Enabled: true EnforcedStyle: indented Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Allow empty strings in -o to result in empty override run listlcg/empty-override-runlistLamont Granquist2019-04-121-3/+3
| | | | | | | | | | | | | | | | | Previously this was not possible. Now you can do this: ``` chef-client -o "" ./foo.rb ``` And it will only run foo.rb and not any of the recipes in your run_list at all. Node will not be saved at the end. Useful to one-shot something like keyrotation (which still needs keys and needs to talk to the chef server API, so this is a different use case from simple chef-apply). Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* change HTTPServerException to HTTPClientException for ruby 2.6Lamont Granquist2019-01-031-2/+2
| | | | | | includes backcompat for 2.5 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Always run policy_file if a policy_file or policy_group existspolicy_files_alwaysTim Smith2018-11-091-12/+0
| | | | | | Remove the config to turn it off Signed-off-by: Tim Smith <tsmith@chef.io>
* fix Layout/LeadingCommentSpaceLamont Granquist2018-07-021-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/DotPositionLamont Granquist2018-07-021-25/+25
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/HashSyntaxLamont Granquist2018-07-022-7/+7
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* RFC 106: expose name and chef_environment as attrstm/chef_environmentThom May2018-03-091-0/+5
| | | | | | | We also now set chef_environment the same as policy group when that's appropriate Signed-off-by: Thom May <thom@chef.io>
* Make sure before block of specs is calling correct methods now defensive ↵jcowie/poise-hoistJon Cowie2018-03-051-1/+2
| | | | | | code removed Signed-off-by: Jon Cowie <jonlives@gmail.com>
* Add attribute hoisting into coreJon Cowie2018-03-011-2/+73
| | | | | | This commit implements RFC-105 and adds specs to verify attribute hoisting is working correctly in conjunction with existing attributes. Signed-off-by: Jon Cowie <jonlives@gmail.com>
* Properly send run_list_expanded event in policy node casetc/fix-expanded-run-list-reporting-for-policyfilesTyler Cloke2017-06-201-0/+50
| | | | Signed-off-by: Tyler Cloke <tylercloke@gmail.com>
* RFC 67: Remove cookbook segmentsThom May2017-04-041-12/+12
| | | | | | | | | This implements RFC 67, which removes cookbook segments, and moves to a single list of all the files contained in a cookbook. This allows us to move forward with better audit modes and also proper shipping of ohai plugins. Signed-off-by: Thom May <thom@chef.io>
* remove test that removing load_node brokeLamont Granquist2017-02-281-21/+0
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Chef-13: Remove Chef::PolicyBuilder::ExpandNodeObject#load_nodeLamont Granquist2017-02-281-6/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Ensure that solo specific code is run at the proper timeThom May2016-05-162-2/+2
| | | | | | ie, only when we're in OG mode and not in local mode. Signed-off-by: Thom May <thom@chef.io>
* Merge pull request #4663 from chef/lcg/better-chef-rspec-constraintsLamont Granquist2016-03-041-1/+1
|\ | | | | better chef+ruby rspec constraints
| * better chef+ruby rspec constraintsLamont Granquist2016-03-031-1/+1
| | | | | | | | | | | | | | | | lets us use Gem::Dependency constraints directly as rspec constraints for matching Chef::Version and RUBY_VERSION. copies some magic sauce from bundler that does something similar
* | Merge pull request #4478 from chef/lcg/rfc-060-gem-metadataLamont Granquist2016-03-031-0/+2
|\ \ | |/ |/| RFC-060 gem metadata MVP
| * fix broken specsLamont Granquist2016-02-091-0/+2
| |
* | deal with 0.37.2 renamed copsLamont Granquist2016-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 252 Style/TrailingCommaInLiteral 84 Style/TrailingCommaInArguments 15 Style/SpaceAroundKeyword -- 351 Total We already dealt with SpaceAroundKeyword under its old name SpaceBeforeModifierKeyword, it looks like it got stricter about spaces after keywords. TrailingComma also got split, and it looks like the TrailingCommaInArguments behavior is new?
* | Fix policyfile testsad/fix_policyfile_zeroandy-dufour2016-02-121-2/+6
| |
* | autofixing auto-inserted delimiterslcg/chefstyle-batchLamont Granquist2016-02-091-1/+1
| |
* | auto fixing some rubocopsLamont Granquist2016-02-091-1/+1
|/ | | | | | | | | Style/NegatedWhile Style/ParenthesesAroundCondition Style/WhileUntilDo Style/WordArray Performance/ReverseEach Style/ColonMethodCall
* autofixing whitespace copsLamont Granquist2016-02-053-32/+23
| | | | | | | | | | | | | | | | | | | | | | 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
* Update all auth email address from opscode.com and getchef.com to chef.io.Noah Kantrowitz2016-02-023-3/+3
| | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-023-3/+3
| | | Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
* Use double quotes by defaultThom May2016-01-143-6/+6
| | | | | | | This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
* autocorrecting Style/TrailingCommalcg/trailing_commaLamont Granquist2016-01-131-12/+12
| | | | chefstyle -a fixed 1044 occurrances
* Convert all uses of Chef::REST to Chef::ServerAPItm/no_more_restThom May2016-01-112-6/+8
| | | | | | | In the process, stop auto-expanding JSON in the HTTP client, and let individual classes control that themselves. Fixes #2737, Fixes #3518
* stub #validate! methodLamont Granquist2015-10-261-0/+2
|
* Un-remove ExpandNodeObject#load_node, deprecate itpolicybuilder-load-node-unremovedanielsdeleo2015-10-011-0/+29
| | | | Some third-party tools are using this, we need it to work.
* Apply a named_run_list in policy builder via configurationdanielsdeleo2015-09-211-21/+85
|
* Add `setup_chef_class` to Policyfile policy builderdanielsdeleo2015-09-171-0/+13
| | | | Also, mark internal public API as @private
* Detect when user wants policyfile compat modedanielsdeleo2015-09-171-0/+13
|
* Set the precedence of policyfile attrs and propagate them everywheredanielsdeleo2015-09-171-0/+158
|
* Use the dynamic policy builder everywheredanielsdeleo2015-09-173-72/+72
|
* Add Dynamic PolicyBuilder to switch on policyfile modedanielsdeleo2015-09-171-0/+211
| | | | | | Now we need to switch PolicyBuilder implementations based on several factors instead of just a single config settings, including content of the node fetched from the Chef Server.
* Make policyfile native mode the defaultpolicyfile-native-defaultdanielsdeleo2015-05-201-1/+5
|
* add/fix node attributesLamont Granquist2015-05-181-2/+2
| | | | | | * fix node[:recipes] * add node[:expanded_run_list] * add node[:cookbooks]
* Update policyfile URLs and cookbook artifact data format per RFCdanielsdeleo2015-03-251-13/+48
|
* Remove ruby 1.8-specific code from testsdanielsdeleo2015-02-121-6/+0
|
* Fetch cookbooks from cookbook_artifacts/ in native api modedanielsdeleo2015-02-121-4/+28
|
* Reorganize contexts to better test compat vs. native mode behaviorsdanielsdeleo2015-02-121-75/+100
|
* Add policyfile native support to policy builderdanielsdeleo2015-01-271-1/+46
|
* Update to RSpec 3.Claire McQuin2014-10-292-38/+37
|