Skip to content

feat: added checkSwitchers for smoke testing#13

Merged
petruki merged 1 commit into
masterfrom
staging
Jun 3, 2026
Merged

feat: added checkSwitchers for smoke testing#13
petruki merged 1 commit into
masterfrom
staging

Conversation

@petruki
Copy link
Copy Markdown
Member

@petruki petruki commented Jun 3, 2026

This pull request introduces a new feature for validating switcher keys both locally (against a snapshot) and remotely (via the API), along with comprehensive error handling and associated tests. Additionally, there are minor updates to workflow files and some code cleanup.

New switcher validation feature:

  • Added a new CheckSwitchers function at both the package and client level to validate that provided switcher keys exist, either in the local snapshot or via the remote API, depending on the client's mode. This includes integration with authentication and error handling.
  • Implemented error types (RemoteSwitcherError, LocalSwitcherError) and constructor helpers for clear error reporting when switchers are missing locally or remotely. [1] [2]
  • Added a helper function checkLocalSwitchers to efficiently check for missing switchers in the local snapshot.
  • Implemented the remote API call and response handling for /criteria/switchers_check, including decoding and error mapping. [1] [2]

Testing:

  • Added a comprehensive test suite in client_check_switchers_test.go covering local and remote validation, error scenarios, and edge cases for the new switcher validation functionality.

Workflow and config updates:

  • Updated SonarCloud scan action version from v8.0.0 to v8.1.0 in GitHub Actions workflow files for improved CI scanning. [1] [2]
  • Removed the version line from .devcontainer/docker-compose.yml for configuration simplification.

Code cleanup:

  • Added missing imports and minor formatting improvements in errors.go.

These changes enhance the robustness of switcher key validation, improve error clarity, and add thorough test coverage for this critical functionality.

@petruki petruki self-assigned this Jun 3, 2026
@petruki petruki added enhancement New feature or request ai-generated Indicates that AI tools were used to generate this change labels Jun 3, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 3, 2026

@petruki petruki merged commit 9dd4136 into master Jun 3, 2026
7 checks passed
@petruki petruki deleted the staging branch June 3, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Indicates that AI tools were used to generate this change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant