fix: config set circular dependency - allow config commands without default account#799
Draft
natalie-o-perret wants to merge 22 commits intomasterfrom
Draft
fix: config set circular dependency - allow config commands without default account#799natalie-o-perret wants to merge 22 commits intomasterfrom
natalie-o-perret wants to merge 22 commits intomasterfrom
Conversation
…efault account Fixes circular dependency where 'exo config set' required a default account to exist in order to set one. Now config management commands (list, set, show) can run without a default account being configured. Changes: - Allow config list/set/show to run without default account - Improve error messages with helpful guidance and available accounts - Split test scenarios into focused test files for better clarity Tests: - set_without_default_account: Tests the core circular dependency fix - commands_require_default_or_flag: Tests error handling and workarounds - no_config_file: Tests first-time user experience All e2e tests passing.
Organize integration tests into: - tests/integ/local/ - Tests that don't require API credentials - tests/integ/api/ - Tests requiring real API (with integration_api build tag) Changes: - Move config_panic_test.go to local/ (no API needed) - Move blockstorage_test.go to api/ (requires API) - Add build tag to API tests to prevent accidental execution - Update package names and imports for new structure - Add comprehensive README documenting the test organization Benefits: - Local tests can run in CI/CD without credentials - API tests clearly marked and require explicit opt-in via build tag - Better separation of concerns - Prevents accidental execution of tests that create real resources
Add tests/integ/local to the build workflow. These tests don't require API credentials and verify CLI behavior like config command handling. This ensures that integration tests that can run without credentials are automatically validated in CI/CD.
Split test execution into focused workflows: 1. main.yml (CI) - Build + Unit tests - Fast feedback on code quality - Runs on all branches 2. integration.yml (NEW) - Integration tests - tests/integ/local (no API credentials) - Placeholder for tests/integ/api (with credentials, commented out) - Runs on all branches and PRs 3. testscript.yml - E2E testscript tests - tests/e2e local scenarios - Runs on master and PRs Benefits: - Clear separation of test types - Parallel execution for faster CI - Easy to identify which test suite failed - Integration tests no longer mixed with unit tests
- Change 'Add an account with: exo config add' to 'Run: exo config' - More concise and directs users to the interactive config flow - Update all e2e and integration tests to match new messages - Remove debug logging from root.go
User feedback: show both 'exo config' and 'exo config add' options Error message now: 'Run: exo config (or exo config add)'
- integration.yml -> test-integration.yml - testscript.yml -> test-e2e-testscript.yml Makes it clear these are test workflows alongside main.yml
- 'E2E Testscript Tests' -> 'Tests - E2E - Testscript' - 'Integration Tests' -> 'Tests - Integration' Makes all test workflows easier to identify in GitHub UI
Added 'Build And Test' name to match other workflows
- Run on all branches (not just master) - Add paths-ignore for markdown and bucket - Add tags-ignore for version tags - Matches integration test pattern
Push to all branches already covers PR branches, so pull_request trigger is unnecessary. Matches main CI build pattern.
- Renamed 'Build And Test' job to separate Build and Tests - Unit - Added Tests - Integration job (from test-integration.yml) - Added Tests - E2E job (from test-e2e-testscript.yml) - Removed separate test workflow files - All test jobs now run in parallel under one CI status check
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.
This pull request improves the CLI's configuration command handling, especially in scenarios where no default account is set or the config file is missing. It ensures that config commands like
set,list, andshowwork gracefully without a default account, fixes circular dependencies, and provides more helpful error messages for users. The CI workflows are also refactored for better structure and coverage. Integration and E2E tests are updated and expanded to cover these behaviors.Config command robustness and user experience:
set,list,show) to run even when no default account is set, fixing the circular dependency where setting a default account previously required a default to exist. Provides clear, actionable error messages and guidance for users in these scenarios. [1] [2] [3] [4] [5] [6] [7] [8]exo configorexo config addwith appropriate instructions. [1] [2] [3] [4]Testing improvements:
local(no API required) andapi(real API required) directories, adds documentation for running them, and updates package naming for clarity. [1] [2] [3] [4] [5]CI/CD workflow refactoring:
main.yml. [1] [2] [3] [4] [5]These changes make the CLI more robust and user-friendly, especially for first-time users and those with non-standard configurations.
Description
Checklist
(For exoscale contributors)
Testing