Add --winpass-timeout flag for gcewinpass password reset#225
Merged
Conversation
2f84be9 to
31a4948
Compare
Expose the gcewinpass timeout option via a new CLI flag --winpass-timeout SECS so users can override the default 120-second timeout for Windows password reset operations. - Add `--winpass-timeout` option (default: 120) to knife google server create - Pass `timeout:` to GoogleComputeWindowsPassword.new in reset_windows_password - Add RSpec tests covering custom timeout, nil passthrough, default value, and CLI flag parsing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Sachin Jain <Sachin.jain@chef.io>
31a4948 to
ed1d8c9
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new --winpass-timeout CLI flag to allow users to override the gcewinpass Windows password reset timeout, and wires that value into the Windows password reset flow.
Changes:
- Introduces
--winpass-timeout SECS(default120) toknife google server createand parses it as an integer. - Passes
timeout:intoGoogleComputeWindowsPassword.newduringreset_windows_password. - Adds RSpec coverage for custom timeout, nil behavior, default option value, and CLI parsing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
lib/chef/knife/google_server_create.rb |
Adds the --winpass-timeout option and forwards timeout: into the gcewinpass password reset constructor. |
spec/google_server_create_spec.rb |
Adds specs covering timeout forwarding, option default, and CLI parsing behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+262
to
+268
| it "passes nil as timeout when winpass_timeout is not set in config" do | ||
| winpass = double("winpass", new_password: "my_password") | ||
| expect(GoogleComputeWindowsPassword).to receive(:new).with( | ||
| hash_including(timeout: nil) | ||
| ).and_return(winpass) | ||
| command.reset_windows_password | ||
| end |
Comment on lines
304
to
313
| debug: gcewinpass_debug_mode | ||
| debug: gcewinpass_debug_mode, | ||
| timeout: config[:winpass_timeout] | ||
| ).new_password |
added 2 commits
June 3, 2026 11:56
Avoid always passing timeout: keyword to GoogleComputeWindowsPassword, which could change behavior when config[:winpass_timeout] is nil versus omitting the option entirely. Signed-off-by: Sachin Jain <Sachin.jain@chef.io>
Signed-off-by: Sachin Jain <Sachin.jain@chef.io>
sanghinitin
approved these changes
Jun 4, 2026
nikhil2611
approved these changes
Jun 8, 2026
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.
Expose the gcewinpass timeout option via a new CLI flag --winpass-timeout SECS so users can override the default 120-second timeout for Windows password reset operations.
--winpass-timeoutoption (default: 120) to knife google server createtimeout:to GoogleComputeWindowsPassword.new in reset_windows_passwordDescription
Issues Resolved
Check List