Skip to content

refactor: migrate to function-based design with multiple improvements#1

Merged
phsmith merged 1 commit intomainfrom
refactor/code-enhancements
Apr 7, 2026
Merged

refactor: migrate to function-based design with multiple improvements#1
phsmith merged 1 commit intomainfrom
refactor/code-enhancements

Conversation

@phsmith
Copy link
Copy Markdown
Owner

@phsmith phsmith commented Apr 7, 2026

Summary

  • Migrated build system to UV — replaced setup.py, requirements.txt, tox.ini, and MANIFEST.in with pyproject.toml + uv.lock; added ruff and bandit as dev dependencies for linting and security scanning
  • Refactored CLI from class-based to function-based design — replaced CircleCIEnvsManage class with a _Ctx dataclass + module-level functions; fixed CIRCLE_TOKEN env var not being picked up when installed as a console script via context_settings={"auto_envvar_prefix": "CIRCLE"}
  • Multiple UX improvements — sorted variable listings with count header, f-string logging throughout, no-op validation when no action flags are passed, graceful 404 handling, support for 2-part slugs (vcs_type/org) for context-only operations
  • Overhauled CI/CD pipelines — merged publish.yml + release.yml into a single 4-job release pipeline (prepare → publish_pypi ∥ publish_docker → commit_and_release); version bump committed to main only after all publish steps succeed with [skip ci]; added pr-checks.yml with linting, security scan, multi-version build matrix, and Docker build check; added update-changelog.yml triggered on release publish

Test plan

  • uv run circleci-env-cli --help works and CIRCLE_TOKEN is picked up from env
  • uv run circleci-env-cli -p github/org --list-envs returns a sorted list with count header
  • uv run circleci-env-cli -p github/org -c my-context --list-envs works without a project name
  • uv run circleci-env-cli -p github/org exits with "nothing to do" error
  • uv run ruff check circleci_env_cli.py passes
  • uv run bandit -c pyproject.toml circleci_env_cli.py passes
  • docker build . succeeds

@phsmith phsmith merged commit 3cb29ff into main Apr 7, 2026
6 checks passed
@phsmith phsmith deleted the refactor/code-enhancements branch April 7, 2026 18:00
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