Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tjaffri
Copy link
Contributor

@tjaffri tjaffri commented Oct 27, 2025

Summary

Refactors the CLI --cloud option from boolean flags to a string-based URL parameter, removing exposure of internal environment URLs (--alpha, --staging) and providing more flexibility.

Changes

Breaking Changes

  • Removed --alpha flag - Use --cloud https://alpha.uipath.com instead
  • Removed --staging flag - Use --cloud https://staging.uipath.com instead
  • Enhanced --cloud option - Now accepts any URL string (defaults to https://cloud.uipath.com)

Implementation

  • Updated environment_options decorator to use string-based --cloud option
  • Modified resolve_domain() to handle URL strings with proper validation
  • Updated AuthService to use cloud_url parameter instead of environment
  • Added URL validation with helpful error messages
  • Updated all test cases including mocks for build_tenant_url() and resolve_tenant_info()
  • Bumped version to 2.2.0 (breaking change)

Usage Examples

# Default (production)
uipath auth

# Staging environment
uipath auth --cloud https://staging.uipath.com

# Alpha environment
uipath auth --cloud https://alpha.uipath.com

# Custom domain
uipath auth --cloud https://custom.domain.com

Testing

✅ All tests pass (608 passed)

  • Updated test_auth.py with new URL-based scenarios
  • Updated test_portal_service_refresh_token.py for new parameter
  • Added test for malformed URL error handling
  • Fixed test mocks to prevent invalid .env file creation

Documentation

📚 Docs will auto-update when merged to main because:

  • CLI help text updated in cli_auth.py docstring
  • mkdocs-click auto-generates docs from source code
  • pyproject.toml change triggers docs workflow

Migration Guide

For users currently using:

uipath auth --alpha
uipath auth --staging

Change to:

uipath auth --cloud https://alpha.uipath.com
uipath auth --cloud https://staging.uipath.com

Replace boolean --alpha, --staging, --cloud flags with a single
string-based --cloud option that accepts custom URLs. This provides
more flexibility and removes exposure of internal environment URLs.

Changes:
- Remove --alpha and --staging CLI flags
- Change --cloud from boolean to string option accepting URLs
- Default --cloud to https://cloud.uipath.com
- Update resolve_domain() to handle URL strings directly
- Update AuthService to use cloud_url parameter
- Add URL validation with helpful error messages
- Update all test cases to use new URL-based approach
- Bump version to 2.2.0 for breaking change

Usage examples:
  uipath auth                                    # Uses default prod
  uipath auth --cloud https://staging.uipath.com
  uipath auth --cloud https://alpha.uipath.com
  uipath auth --cloud https://custom.domain.com

BREAKING CHANGE: Removed --alpha and --staging flags. Users must now
use --cloud with full URLs (e.g., --cloud https://staging.uipath.com
or --cloud https://alpha.uipath.com).
…jaffri/cli

Resolved conflicts in:
- pyproject.toml: Kept version 2.2.0 for breaking change
- src/uipath/_cli/_auth/_url_utils.py: Combined upstream base_url priority logic with cloud_url parameter changes
- uv.lock: Regenerated with updated dependencies

All tests passing after merge.
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.

1 participant