Skip to content

Add interactive cloud credential selection on stacker deploy --target cloud#129

Merged
vsilent merged 3 commits intomainfrom
copilot/add-cloud-provider-selection
Mar 9, 2026
Merged

Add interactive cloud credential selection on stacker deploy --target cloud#129
vsilent merged 3 commits intomainfrom
copilot/add-cloud-provider-selection

Conversation

Copy link
Contributor

Copilot AI commented Mar 9, 2026

When deploying to cloud without deploy.cloud configured in stacker.yml, the CLI immediately errored with CloudProviderMissing. Users who have saved cloud credentials expected to be able to pick one interactively rather than manually editing the config first.

Changes

  • cloud_provider_from_code() — maps provider strings (short codes htz/do/lo/vu and full names) to CloudProvider enum; returns an error on unrecognised codes instead of silently defaulting to Hetzner

  • prompt_select_cloud() — fetches saved credentials from the Stacker server and presents a dialoguer::Select menu:

    • Lists all saved clouds as ID NAME (provider)
    • Last item is → Connect a new cloud provider
    • If no credentials exist, prints per-provider export TOKEN=... guidance and returns CloudProviderMissing
  • run_deploy() step 3b — inserted between credential verification and strategy validation; when cloud target is active and config.deploy.cloud is None, invokes prompt_select_cloud():

    • On selection: sets config.deploy.cloud with the chosen provider and key = credential_name, then writes the result back to stacker.yml so subsequent deploys skip the prompt
    • On "Connect new": prints provider-specific token export instructions and aborts
  No cloud provider configured in stacker.yml.
  Select a saved cloud credential to use for this deployment:

? Cloud credential
> 42     htz-10                   (htz)
  17     do-prod                  (do)
  →  Connect a new cloud provider
  • Test: test_cloud_provider_from_code covers all short codes, full names, case-insensitivity, and unknown inputs

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.openai.com
    • Triggering command: /home/REDACTED/work/stacker/stacker/target/debug/deps/stacker-9dc50868c97bc7f2 /home/REDACTED/work/stacker/stacker/target/debug/deps/stacker-9dc50868c97bc7f2 --color=always --test-threads=1 --nocapture 64-u�� 64-REDACTED-linux-gnu/lib/libminiz_oxide-ec844042f1e20091.rlib 64-REDACTED-linux-gnu/lib/libadler2-fa28e789c10e1e7f.rlib known-linux-gnu/-m zstd/lib/common -incompat pointer ilder_macro-dc06-dynamic-linker o -I 8c2be6c3d4e74645/build_script_build-8c2be6c3d4e74645.build_script_build.bc56fac7f4032739-cgu.0.r--norc 8c2be6c3d4e74645/build_script_build-8c2be6c3d4e74645.7jugm4gpz82prrw1256or3rph.rcgu.o zstd/lib/common -incompat lib/rustlib/x86_--noprofile lib/rustlib/x86_64-REDACTED-linux-gnu/lib/libpanic_unwind-35a18a1986ed2694.rlib (dns block)
    • Triggering command: /home/REDACTED/work/stacker/stacker/target/debug/deps/stacker-9dc50868c97bc7f2 /home/REDACTED/work/stacker/stacker/target/debug/deps/stacker-9dc50868c97bc7f2 --color=always --test-threads=1 --nocapture ITY=�� ons d0d2a6f29259bc1/build_script_build-5d0d2a6f29259bc1.build_script_build.11b0c152aa949fae-cgu.0.rc--norc d0d2a6f29259bc1/build_script_build-5d0d2a6f29259bc1.7nrlmqb89i1v9xf1yorsuounq.rcgu.o zstd/lib/common -incompat lib/rustlib/x86_-t lib/rustlib/x86_security lib/�� lib/rustlib/x86_OUTPUT lib/rustlib/x86_-d lib/rustlib/x86_168.63.129.16 lib/rustlib/x86_bash f4032739-cgu.0.r--norc cgu.o lib/rustlib/x86_owner (dns block)
    • Triggering command: /home/REDACTED/work/stacker/stacker/target/debug/deps/stacker-9dc50868c97bc7f2 /home/REDACTED/work/stacker/stacker/target/debug/deps/stacker-9dc50868c97bc7f2 --color=always --test-threads=1 known-linux-gnu/embed-bitcode=no rcgu�� rcgu.o rcgu.o known-linux-gnu/cfg(docsrs,test) rcgu.o e5b306a3-cgu.0.r-20 cgu.o known-linux-gnu/metadata=a59f0f1d13a0069b k/st�� ons k/stacker/stacker/target/debug/b/home/REDACTED/work/stacker/stacker/target/debug/deps/serde_valid_--norc -1949cf8c6b5b557f/reqwest-0.11.27/src/lib.rs -g -incompat ntained/cc stable-x86_64-REDACTED-linux-gnu/--edition=2021 (dns block)
  • stackerdb
    • Triggering command: /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/rustc /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/rustc --crate-name stacker --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg feature="default" --cfg feature="indexmap" --check-cfg cfg(docsrs,test) (dns block)
    • Triggering command: /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/rustc /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/rustc --crate-name stacker --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --cfg feature="default" --cfg feature="indexmap" --check-cfg cfg(docsrs,test) (dns block)
    • Triggering command: /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/rustc /home/REDACTED/.rustup/toolchains/stable-x86_64-REDACTED-linux-gnu/bin/rustc --crate-name stacker --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --test --cfg feature="default" --cfg feature="indexmap" --check-cfg cfg(docsrs,test) --check-cfg (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Start implementation

[Chronological Review: The conversation began with the user requesting a feature for the stacker tool that allows users to select from an existing list of cloud providers and add the selected provider to the stacker.yml file for deployment. The user provided examples of command-line interactions with stacker, highlighting errors encountered when trying to deploy without specifying a cloud provider. The user then expressed their expectations for the feature, detailing how they would like the interaction to flow, including connecting a new cloud provider and updating the stacker.yml file. The user subsequently requested to start the implementation of this feature.]

[Intent Mapping:

  1. "stacker should allow users to select from existing cloud list and add to the stacker.yml once they want to deploy." - User wants to enhance stacker functionality for cloud provider selection.
  2. "So as user uses their cloud key, they expect the stacker.yml is configured." - User expects automatic configuration of stacker.yml when using a cloud key.
  3. "What do I expect as a user, to see: Connect a new cloud provider" - User outlines expected user interface and experience for connecting cloud providers.
  4. "Start implementation" - User requests to begin coding the feature.]

[Technical Inventory:

  • Tool: stacker - A command-line tool for managing cloud deployments.
  • Commands: deploy, list, clouds - User interacted with these commands to check cloud provider configurations and deployment status.
  • Configuration File: stacker.yml - The file that needs to be updated with cloud provider information.]

[Code Archaeology: No specific files or code changes were discussed in detail yet, but the user indicated that the stacker.yml file will need to be modified to include cloud provider configurations.]

[Progress Assessment:

  • Completed Tasks: User has outlined the feature requirements and expectations.
  • Partially Complete Work: Implementation of the feature has not yet started but was requested by the user.]

[Context Validation: All necessary context for continuing the implementation of the cloud provider selection feature is captured, including user expectations and the need to modify stacker.yml.]

[Recent Commands Analysis:

  • Last Agent Commands: User executed commands related to stacker, including ./stacker deploy --target cloud --key htz-10, ./stacker list cloud, and ./stacker list clouds.
  • Tool Results Summary: The user encountered errors indicating that a cloud provider was required for deployment and that the 'cloud' subcommand was unrecognized. The command ./stacker list clouds successfully returned a list of cloud credentials, indicating that the user has one cloud credential (htz-10) available for use.
  • Pre-Summary State: The agent was actively working on implementing the requested feature for cloud provider selection when the token budget was exceeded.
  • Operation Context: The commands executed were directly related to the user's goal of enhancing stacker to allow for cloud provider selection and configuration.]
1. Conversation Overview: - Primary Objectives: User wants to enhance stacker to allow selection from existing cloud providers and automatic configuration of stacker.yml. User expects to see a user-friendly interface for connecting new cloud providers. - Session Context: The conversation flowed from identifying the need for a feature in stacker to outlining specific user expectations and requesting implementation. - User Intent Evolution: The user started with a feature request, detailed their expectations, and concluded with a request to start implementation.
  1. Technical Foundation:
  • Tool: stacker - A command-line tool for managing cloud deployments.
  • Configuration File: stacker.yml - Needs to be updated with cloud provider information.
  1. Codebase Status:
  • No specific files or code changes have been discussed yet, but the stacker.yml file is central to the upcoming implementation.
  1. Problem Resolution:
  • Issues Encountered: User faced errors related to cloud provider configuration and unrecognized commands.
  • Solutions Implemented: None yet, as the implementation has just been requested.
  • Debugging Context: User's commands highlighted the need for improved error handling and user guidance in stacker.
  • Lessons Learned: User expects seamless integration of cloud provider selection into the deployment process.
  1. Progress Tracking:
  • Completed Tasks: User has articulated feature requirements.
  • Partially Complete Work: Implementation of the feature is pending.
  • Validated Outcomes: User has confirmed the need for cloud provider configuration in stacker.yml.
  1. Active Work State:
  • Current Focus: User is focused on implementing the feature for cloud provider selection and configuration.
  • Recent Context: User provided examples of stacker command usage and outlined expectations for the new feature.
  • Working Code: No specific code ...

Created from VS Code.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits March 9, 2026 10:58
…gured cloud provider

Co-authored-by: vsilent <42473+vsilent@users.noreply.github.com>
Co-authored-by: vsilent <42473+vsilent@users.noreply.github.com>
Copilot AI changed the title [WIP] Add feature to select cloud provider for stacker Add interactive cloud credential selection on stacker deploy --target cloud Mar 9, 2026
@vsilent vsilent marked this pull request as ready for review March 9, 2026 11:39
@vsilent vsilent merged commit 41c2b27 into main Mar 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants