Skip to content

[Nitro CLI] Respect NITRO_CLOUD_URL environment variable#9738

Merged
tobias-tengler merged 1 commit into
mainfrom
tte/consider-cloud-url-env-var
May 19, 2026
Merged

[Nitro CLI] Respect NITRO_CLOUD_URL environment variable#9738
tobias-tengler merged 1 commit into
mainfrom
tte/consider-cloud-url-env-var

Conversation

@tobias-tengler
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings May 19, 2026 10:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts the Nitro CLI so the NITRO_CLOUD_URL environment variable is respected for the --cloud-url option, taking precedence over the session URL (but not over an explicit --cloud-url argument). Previously the option's default was hard-coded to Constants.ApiUrl, which meant the session URL was always preferred over the env var.

Changes:

  • Remove the hard-coded default value from OptionalCloudUrlOption, relying on NitroClientContext.Configure to fall back to Constants.ApiUrl when no URL is provided.
  • Simplify ConfigureClientContext to use the option's resolved value (explicit arg or env var) and only fall back to the session URL when it's empty.
  • Update help-text snapshots across all command tests (remove [default: api.chillicream.com]) and add new GlobalOptionsTests cases covering the new precedence rules.

Reviewed changes

Copilot reviewed 66 out of 66 changed files in this pull request and generated no comments.

File Description
src/Nitro/CommandLine/src/CommandLine/Options/OptionalCloudUrlOption.cs Drop hard-coded default so env var isn't masked.
src/Nitro/CommandLine/src/CommandLine/Extensions/RootCommandExtensions.cs Simplified URL resolution preferring option value (explicit/env) over session.
src/Nitro/CommandLine/test/CommandLine.Tests/GlobalOptionsTests.cs New tests covering env vs session vs explicit --cloud-url precedence.
src/Nitro/CommandLine/test/CommandLine.Tests/Commands/**/*.cs Updated help-text snapshots to drop [default: api.chillicream.com].

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tobias-tengler tobias-tengler merged commit e19ef4f into main May 19, 2026
144 of 146 checks passed
@tobias-tengler tobias-tengler deleted the tte/consider-cloud-url-env-var branch May 19, 2026 10:08
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