Skip to content

Add --winpass-timeout flag for gcewinpass password reset#225

Merged
sanjain-progress merged 4 commits into
mainfrom
sanjain/CHEF-33238/gcewin_timeout_support
Jun 9, 2026
Merged

Add --winpass-timeout flag for gcewinpass password reset#225
sanjain-progress merged 4 commits into
mainfrom
sanjain/CHEF-33238/gcewin_timeout_support

Conversation

@sanjain-progress

@sanjain-progress sanjain-progress commented May 20, 2026

Copy link
Copy Markdown
Contributor

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

Description

Issues Resolved

Check List

@sanjain-progress sanjain-progress force-pushed the sanjain/CHEF-33238/gcewin_timeout_support branch from 2f84be9 to 31a4948 Compare May 22, 2026 07:27
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>
@sanjain-progress sanjain-progress force-pushed the sanjain/CHEF-33238/gcewin_timeout_support branch from 31a4948 to ed1d8c9 Compare May 22, 2026 07:28
@sanjain-progress sanjain-progress marked this pull request as ready for review May 25, 2026 08:20
@ashiqueps ashiqueps requested a review from Copilot May 25, 2026 08:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 (default 120) to knife google server create and parses it as an integer.
  • Passes timeout: into GoogleComputeWindowsPassword.new during reset_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 thread spec/google_server_create_spec.rb Outdated
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 thread lib/chef/knife/google_server_create.rb Outdated
Comment on lines 304 to 313
debug: gcewinpass_debug_mode
debug: gcewinpass_debug_mode,
timeout: config[:winpass_timeout]
).new_password
Sachin Jain 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>
@sanjain-progress sanjain-progress merged commit 3177871 into main Jun 9, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants