fix: Update for Click 8.2+ compatibility and fix quality gates #3774

Merged
HAL9000 merged 4 commits from fix/quality-gates-click82-compat into master 2026-06-17 03:58:39 +00:00

4 Commits

Author SHA1 Message Date
HAL9000 0dc1a3c629 style(tests): apply ruff format to plan_cli_spec_alignment step
CI / load-versions (pull_request) Successful in 14s
CI / push-validation (pull_request) Successful in 21s
CI / lint (pull_request) Successful in 35s
CI / typecheck (pull_request) Successful in 53s
CI / security (pull_request) Successful in 1m3s
CI / quality (pull_request) Successful in 58s
CI / build (pull_request) Successful in 46s
CI / helm (pull_request) Successful in 1m16s
CI / unit_tests (pull_request) Successful in 6m55s
CI / docker (pull_request) Successful in 1m58s
CI / integration_tests (pull_request) Successful in 11m12s
CI / coverage (pull_request) Successful in 12m34s
CI / status-check (pull_request) Successful in 3s
Collapse the namespace-filter ``runner.invoke(...)`` call onto a single
line so ``ruff format --check`` (the ``lint`` gate's ``format``
session) passes.

ISSUES CLOSED: #3773
2026-06-16 23:08:30 -04:00
HAL9000 2e04e8597e test(config,plan): add coverage for CLEVERAGENTS_HOME branch and --namespace filter
Two changed source lines were uncovered by the existing test suite:

- ``src/cleveragents/cli/commands/config.py:57`` — ``return Path(home_env)``
  branch in ``_get_config_dir()`` (only reached when
  ``CLEVERAGENTS_HOME`` is set).
- ``src/cleveragents/cli/commands/plan.py:3131`` —
  ``active_filters.append(f"[yellow]Namespace:[/yellow] {namespace}")``
  in ``lifecycle_list_plans`` (only reached when ``--namespace`` is
  passed).

Add one scenario per uncovered line:

- ``features/config_cli_safety_net_coverage.feature`` — new
  ``safety-net _get_config_dir`` scenario sets
  ``CLEVERAGENTS_HOME`` and asserts the resolver returns that
  path. Step reuses the existing safety-net env var helper.
- ``features/plan_cli_spec_alignment.feature`` — new ``Plan list
  with --namespace filter`` scenario invokes ``plan list
  --namespace myteam`` against the existing plan-spec-alignment
  fixtures and reuses the existing ``the plan spec list should
  succeed`` assertion.

ISSUES CLOSED: #3773
2026-06-16 23:08:30 -04:00
HAL9000 12828ca7e8 fix(config): use module-level _CONFIG_DIR/_CONFIG_PATH in _get_service for patchability
Tests in features/config_cli_*.feature and robot/config_cli.robot /
robot/automation_profile_cli.robot patch
``cleveragents.cli.commands.config._CONFIG_DIR`` /
``_CONFIG_PATH`` with ``unittest.mock.patch.object`` to redirect
the CLI to a temp config directory. ``_get_service`` was calling
``_get_config_dir()`` and recomputing the path from
``CLEVERAGENTS_HOME`` / ``Path.home()`` on every invocation, which
bypassed the patches and routed every test through the developer's
real ``~/.cleveragents`` — producing the 8 unit_tests scenario
failures and 3 integration Robot failures observed on CI.

Read the patched module-level constants directly so the patches
take effect. Module-load-time path resolution (the assignment at
file scope) still honours ``CLEVERAGENTS_HOME``.

The 4 robot tests that had ``tdd_expected_fail`` for tdd_issue_4204
and tdd_issue_4302 now pass — drop the tag so the
tdd_expected_fail_listener doesn't invert their PASS into a FAIL.

ISSUES CLOSED: #3773
2026-06-16 23:08:30 -04:00
brent.edwards 29639558a3 fix(tests): resolve all failing CI checks on PR #3774
Fix 8 distinct integration test and E2E failures:

1. JSON envelope unwrapping in test helpers
   Helpers were asserting keys at the top-level of the JSON envelope
   ({command, status, exit_code, data, timing, messages}) rather than
   inside the nested 'data' field.  Updated helpers to access
   parsed['data'] for assertions on the actual response payload:
   - helper_cli_formats.py: action_list_json, action_show_yaml,
     plan_list_json, global_format_json_version, global_format_yaml_version,
     global_format_shorthand
   - helper_automation_profile_cli.py: test_show_json, test_list_json
   - helper_cli_extensions.py: action_show_json
   - helper_config_cli.py: config_set_get_roundtrip
   - helper_config_project_scope.py: cli_roundtrip

2. Plan list --namespace / -n option (issue #4301)
   Add 'namespace' parameter to lifecycle_list_plans() in plan.py,
   passing it through to service.list_plans(namespace=...) and
   displaying it in the Filters panel.

3. Config registry key count (issue #4304)
   Update expected count from 105 to 106 to match current registry
   (additional server key was added via the server stubs feature).

4. Container tool exec mock fix (issue #4243)
   The test mocked ev.resolve_and_validate (no longer called) instead
   of ev.resolve_with_precedence.  Fix the mock target so ToolRunner
   correctly routes to the container path and returns the expected
   error when no ContainerToolExecutor is configured.

5. E2E config CLI CLEVERAGENTS_HOME support
   config.py used a hardcoded Path.home() / '.cleveragents' for the
   config directory, ignoring CLEVERAGENTS_HOME.  E2E tests run in
   isolated temporary homes set via CLEVERAGENTS_HOME; this caused the
   WF07 CI Profile Configuration test to read from the global config
   (returning 'review') instead of the test-scoped config.  Make
   _get_config_dir() and _get_service() respect CLEVERAGENTS_HOME.

ISSUES CLOSED: #4204 #4205 #4206 #4243 #4301 #4302 #4303 #4304
2026-06-16 23:08:30 -04:00