Skip to content

fix: register config command in lazy loading map and add CI workflow#265

Merged
tomaz-lc merged 1 commit intocli-v2from
fix-ci-microbenchmarks
Mar 20, 2026
Merged

fix: register config command in lazy loading map and add CI workflow#265
tomaz-lc merged 1 commit intocli-v2from
fix-ci-microbenchmarks

Conversation

@tomaz-lc
Copy link
Copy Markdown
Contributor

@tomaz-lc tomaz-lc commented Mar 20, 2026

Details

Fixes CI failures (both GHA and Cloud Build) caused by PR #257 (config directory consolidation) and PR #261 (lazy command loading) being merged independently - the config command was not registered in the lazy loading map.

Also adds a CI workflow and upgrades both workflows with latest action versions, minimum permissions, and Python version matrix testing.

I will take the liberty to merge these fixes directly so I can publish a new release.

Fixes

  1. config_cmd missing from _COMMAND_MODULE_MAP - PR feat: consolidate config files into ~/.limacharlie.d/ directory #257 added config_cmd.py but PR feat: lazy command loading for faster CLI startup #261 replaced auto-discovery with a static map that didn't include it. All test_config_cmd.py tests failed with "No such command 'config'". Fixed by adding "config": ("config_cmd", "group") to the map.

  2. Regression test snapshots out of date - EXPECTED_TOP_LEVEL_COMMANDS, EXPECTED_MODULE_MAP, and EXPECTED_SUBCOMMANDS in test_cli_lazy_loading_regression.py were missing the config command.

  3. test_cli_import_does_not_load_output flaky in shared process - The test asserted jmespath not in sys.modules after a fresh limacharlie.cli import, but jmespath could already be loaded by other tests earlier in the same pytest process. Fixed by tracking pre-existing modules and only asserting on newly imported ones.

CI improvements

  1. New ci.yml workflow - Runs unit tests on PRs targeting master/cli-v2 and pushes to those branches. Tests across all supported Python versions (3.9-3.14) with fail-fast: false. Includes minimum permissions (contents: read) and concurrency with cancel-in-progress: true. Uses concurrency group keyed on PR number to avoid duplicate runs for push + pull_request events.

  2. Publish workflow matrix tests - publish-to-pypi.yml now runs unit tests across all supported Python versions (3.9-3.14) before building and publishing. Added workflow-level permissions: contents: read with job-level overrides only for the publish job.

  3. Latest GHA action versions - Updated both workflows to use latest action versions:

    • actions/checkout v4 -> v6
    • actions/setup-python v5 -> v6
    • actions/upload-artifact v4 -> v7
    • actions/download-artifact v4 -> v8

Blast radius / isolation

  • limacharlie/cli.py - one line added to static map
  • tests/unit/test_cli_lazy_loading_regression.py - snapshot updates only
  • tests/microbenchmarks/test_cli_startup_microbenchmark.py - test isolation fix
  • .github/workflows/ci.yml - new workflow file
  • .github/workflows/publish-to-pypi.yml - matrix tests, permissions, action version upgrades

Performance characteristics

No impact.

Notable contracts / APIs

None.

Related PRs

@tomaz-lc tomaz-lc force-pushed the fix-ci-microbenchmarks branch 5 times, most recently from 6d82e0f to 6623cea Compare March 20, 2026 19:50
- Add config_cmd to _COMMAND_MODULE_MAP in cli.py (missing after #257
  and #261 were merged independently)
- Add config to EXPECTED_TOP_LEVEL_COMMANDS, EXPECTED_MODULE_MAP, and
  EXPECTED_SUBCOMMANDS in regression tests
- Fix test_cli_import_does_not_load_output to handle third-party deps
  already loaded by other tests in the same pytest process
- Add ci.yml GHA workflow that runs unit tests and dist checks on every
  push and PR

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tomaz-lc tomaz-lc force-pushed the fix-ci-microbenchmarks branch from 6623cea to abb9f88 Compare March 20, 2026 19:51
@tomaz-lc tomaz-lc merged commit 3def0e7 into cli-v2 Mar 20, 2026
7 checks passed
@tomaz-lc tomaz-lc deleted the fix-ci-microbenchmarks branch March 20, 2026 20:03
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