summaryrefslogtreecommitdiff
path: root/lib/chef/chef_fs/file_system/chef_server
Commit message (Collapse)AuthorAgeFilesLines
* fix specs: RedundantReturn, RedundantSelf, RedundantBeginLamont Granquist2017-02-138-122/+105
| | | | | | department of redundancy department Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* [cheffs] Don't iterate parent object on exist? callssd/chef-fs-n-squaredSteven Danna2016-12-131-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, this code determined if an object existed by doing the following: parent.children.any? { |child| child.api_child_name == api_child_name } For organizations and object types with a small number of total objects, this wasn't problematic; however, it has very bad worst-case behavior. For example, if a user was attempting to restore an organization with 30k client records to an empty organization, each client upload would do the following: 1. Run GET /clients 2. Iterate the list returned in (1) normalizing the clients names along the way. 3. Upload the client via POST when exist? returned false. When the clients don't exist, this means step (2) will always iterate over every member returned in step (1). By the time you get into the 1000s of clients, this iteration dominates the running time of the process. For instance, consider the following ruby profile data: Measure Mode: wall_time Thread ID: 16939380 Fiber ID: 22163920 Total: 109.860468 Sort by: self_time %self total self wait child calls name 26.83 29.475 29.475 0.000 0.000 500 <Class::IO>#select 8.60 38.876 9.446 0.000 29.430 464125 <Class::Chef::ChefFS::PathUtils>#join 7.02 12.226 7.717 0.000 4.509 928750 Chef::ChefFS::FileSystem::ChefServer::RestListEntry#api_child_name 6.79 7.459 7.459 0.000 0.000 930250 String#gsub 5.31 5.834 5.834 0.000 0.000 2320625 <Class::Chef::ChefFS::PathUtils>#regexp_path_separator 3.33 3.654 3.654 0.000 0.000 500 OpenSSL::X509::Store#set_default_paths 3.28 42.482 3.606 0.000 38.876 464125 Chef::ChefFS::FileSystem::BaseFSObject#initialize 2.95 3.244 3.244 0.000 0.000 930250 <Class::File>#extname 2.29 48.421 2.513 0.000 45.908 483375 *Class#new 38 wall clock seconds spent in PathUtils.join (part of the name normalization during the list walk) Note, an alternative might be to skip the exist? check completely, opting to blindly POST and then rescuing the 409 and retry with a PUT. Experimentation shows that PathUtils.join can also be improved substantially; however, I'll leave those for a follow-up PR. Signed-off-by: Steven Danna <steve@chef.io>
* Fixed knife download cookbooks issue which used to corrupt the certificate ↵aliasgar162016-10-271-7/+3
| | | | | | files each time the command was fired. Signed-off-by: aliasgar16 <aliasgar.batterywala@msystechnologies.com>
* More Opscode -> Chef updatesTim Smith2016-10-201-1/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Introduce display_name and use itThom May2016-05-053-2/+4
| | | | | | | | This allows us to use the path we produce for other display purposes and consume it internally to have a canonical path for comparisons and printing Signed-off-by: Thom May <thom@may.lt>
* Remove file extensions from API targetsThom May2016-05-055-10/+12
| | | | Signed-off-by: Thom May <thom@may.lt>
* Allow rest entries to define a display pathThom May2016-05-058-0/+57
| | | | | This gives us much more control over what an individual entry will display when formatted
* Move all ChefFS exceptions into a single filetm/combined_chef_fs_exceptionsThom May2016-04-1311-19/+11
| | | | This leaves back compat requires to ensure nothing breaks.
* Merge pull request #4640 from chef/tm/zero_deep_librariesThom May2016-03-151-1/+1
|\ | | | | Support libraries with sub directories
| * Ensure that chef-zero loads libraries recursivelytm/zero_deep_librariesThom May2016-03-031-1/+1
| |
* | Autofixing new Perf cops in 0.37.2Lamont Granquist2016-02-2311-13/+13
|/ | | | | | | | | | 6 Performance/Casecmp 18 Performance/Detect 1 Performance/RangeInclude 27 Performance/RedundantBlockCall 6 Performance/RedundantMatch 5 Performance/RedundantMerge 18 Performance/StringReplacement
* 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-055-8/+7
| | | | | | | | | | | | | | | | | | | | | | 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-0223-23/+23
| | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* Replace all Opscode copyrights with Chef Software.Noah Kantrowitz2016-02-0223-23/+23
| | | Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
* Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-0223-23/+23
| | | 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"
* Adjust tests for ACLsJohn Keiser2016-02-011-0/+1
|
* Add ACLs for policies, policy_groups and cookbook_artifactsJohn Keiser2016-02-014-4/+57
|
* Merge pull request #4423 from chef/tm/rest_deprecationThom May2016-01-212-2/+2
|\ | | | | Add deprecation warnings to Chef::REST and all json_creates
| * Ensure we use from_hash rather than the deprecated json_createThom May2016-01-181-1/+1
| |
| * tidy up cookbook_loaderThom May2016-01-181-1/+1
| |
* | Merge pull request #4424 from chef/lcg/chefstyle-catchup2Lamont Granquist2016-01-192-7/+7
|\ \ | | | | | | another chefstyle catchup + pull master
| * | another chefstyle catchup + pull masterlcg/chefstyle-catchup2Lamont Granquist2016-01-182-7/+7
| | | | | | | | | | | | | | | | | | | | | bunch of merges over the weekend need re-fixing again. seems like pointing at master of chefstyle is probably a good idea to start making people fix their code before merging.
* | | Autofixing Style/PercentLiteralDelimeterslcg/percentliteraldelimetersLamont Granquist2016-01-183-3/+3
|/ / | | | | | | | | | | See chef/chefstyle#11 for analysis and discussion. We select '{}' since audit of our source code shows that is the most common, and that used to be the dominant learning paradigm (e.g. in ruby 1.9 pickaxe book.
* | Revert "another chefstyle catchup + pull master"Lamont Granquist2016-01-182-7/+7
| | | | | | | | This reverts commit ccf46bf3055b2a1c06499ec104f3d74c26643395.
* | another chefstyle catchup + pull masterLamont Granquist2016-01-182-7/+7
|/ | | | | | | bunch of merges over the weekend need re-fixing again. seems like pointing at master of chefstyle is probably a good idea to start making people fix their code before merging.
* Fix unused variables and commentsjk/cookbook-artifactsJohn Keiser2016-01-151-2/+0
|
* Make upload cookbook_artifacts workJohn Keiser2016-01-153-2/+9
|
* Get download of cookbook_artifacts workingJohn Keiser2016-01-151-1/+0
|
* Add server cookbook artifacts and list_specJohn Keiser2016-01-156-10/+154
|
* Use double quotes by defaultThom May2016-01-1424-121/+121
| | | | | | | 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.
* Merge pull request #4398 from chef/lcg/trailing_commaThom May2016-01-142-3/+3
|\ | | | | autocorrecting Style/TrailingComma
| * autocorrecting Style/TrailingCommalcg/trailing_commaLamont Granquist2016-01-132-3/+3
| | | | | | | | chefstyle -a fixed 1044 occurrances
* | Split versioned cookbook dir from unversionedJohn Keiser2016-01-134-24/+75
| |
* | Split versioned and unversioned cookbooks into separate classesJohn Keiser2016-01-133-65/+106
|/
* Move server and repository fs objects to their own directoriesJohn Keiser2016-01-1322-0/+2088