Update Chef Git Customizations for Chef Client 17 Compatibility - #49789
Merged
Conversation
Hamms
marked this pull request as ready for review
January 17, 2023 23:38
Comment on lines
+69
to
+72
| ref_exists = [ | ||
| "config --get remote.#{remote}.fetch '^\\+refs/heads/#{branch}:refs/remotes/#{remote}/#{branch}$'", | ||
| "config --get remote.#{remote}.fetch '^\\+refs/heads/\*:refs/remotes/#{remote}/\*$'" | ||
| ].any? do |cmd| |
Contributor
Author
There was a problem hiding this comment.
this little cleanup was easily the most fun part of this whole investigation 😄
cat5inthecradle
approved these changes
Jan 19, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Specifically, stop relying on the deprecated Ruby functionality which treats a final hash argument as representing keyword parameters, and start either explicitly passing keyword parameters or using a splat argument. Also updated a couple places we were manually calling
shell_outto instead call thegithelper.This is required for Chef 17 compatibility, since Chef 17 embeds Ruby 3.0, which is the version of Ruby which fully separated positional and keyword arguments.
Note also that this codepath is only executed when the
cdo-repositorycookbook'ssyncattribute is set to true, which is not the case for most of our servers.Links
Testing story
Tested on an adhoc, by manually overriding the
syncattribute and manually restting git history.Follow-up work
PR Checklist: