Skip to content

refactor(core): use pyproject.toml as single source of truth for version (#248) - #249

Merged
dan-petty merged 3 commits into
release/v0.2.20from
refactor/pyproject-version-single-source
Sep 18, 2026
Merged

dan-petty merged 3 commits into
release/v0.2.20from
refactor/pyproject-version-single-source

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary of Changes

Closes #248

  • pyproject.toml as Single Source of Truth:
    • src/devops_cli/__init__.py: Dynamically initializes __version__ = get_version() from pyproject.toml (via load_project_metadata().version) and re-exports metadata helper functions directly.
    • Eliminated hardcoded __version__ = "0.2.20" from __init__.py.
  • Release Automation Compatibility:
    • src/devops_cli/commands/release.py:
      • In _update_pyproject_version(), invalidates load_project_metadata LRU cache upon version updates.
      • In _update_init_version(), inspects __init__.py for string literal quotes; if __version__ is dynamically assigned, skips file modifications without errors.
  • Clean Up Stale Version Fallbacks:
    • src/devops_cli/config/metadata.py: Updated _DEFAULT_METADATA.version from stale "0.1.11" to "0.0.0".
    • src/devops_cli/telemetry/tracer.py: Updated _detect_version() exception fallback from stale "0.1.0" to "0.0.0".
  • Test Coverage & Verification:
    • tests/test_release.py: Added test_dynamic_init_version_handling testing dynamic init version retrieval and noop updates.
    • All 10 CI quality gates pass 100%.

@dan-petty
dan-petty marked this pull request as ready for review September 18, 2026 15:21
Copilot AI lite review requested due to automatic review settings September 18, 2026 15:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Correct the release helper’s success behavior for missing assignments and synchronize task metadata; cache invalidation coverage is also incomplete.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Refactors version handling to make pyproject.toml the authoritative source and updates release automation for dynamic versions.

Changes:

  • Dynamizes package version and metadata loading.
  • Updates release version updates and cache invalidation.
  • Refreshes fallback versions and adds release coverage.
  • Updates task tracking metadata.
File summaries
File Summary
tests/test_release.py Adds dynamic-version release handling coverage.
src/devops_cli/telemetry/tracer.py Updates the telemetry version fallback.
src/devops_cli/config/metadata.py Updates the default metadata version fallback.
src/devops_cli/commands/release.py Supports dynamic versions and cache invalidation; the missing-assignment behavior requires correction.
src/devops_cli/__init__.py Loads and exports metadata dynamically.
docs/agent/tasks/task-248-pyproject-version-single-source.md Tracks the version-source refactor and needs synchronized status fields.
Review details

Suppressed comments (1)

src/devops_cli/commands/release.py:280

  • The new cache invalidation path is not covered by this test: it updates the TOML and then reads it through _get_init_version, which parses the file directly rather than exercising cached get_version()/load_project_metadata(). Add an assertion that calls get_version(pyproject_path) before and after _update_pyproject_version so a stale-cache regression fails.
        from devops_cli.config.metadata import load_project_metadata

        load_project_metadata.cache_clear()
  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/devops_cli/commands/release.py
Comment thread docs/agent/tasks/task-248-pyproject-version-single-source.md Outdated
@dan-petty
dan-petty force-pushed the refactor/pyproject-version-single-source branch from b7db53c to 50e0967 Compare September 18, 2026 16:26
@dan-petty
dan-petty merged commit d4013a3 into release/v0.2.20 Sep 18, 2026
5 checks passed
@dan-petty
dan-petty deleted the refactor/pyproject-version-single-source branch September 18, 2026 16:43
Copilot AI mentioned this pull request Sep 18, 2026
7 tasks
dan-petty added a commit that referenced this pull request Sep 19, 2026
* feat(release): v0.2.20

* fix(pr): handle JSON array timeline payload in _parse_timeline_copilot_state (#245) (#246)

* fix(pr): handle JSON array timeline payload in _parse_timeline_copilot_state (#245)

* docs(tasks): update task 245 status to In Review and link PR #246

* docs(agents): add roadmap ingestion rules for missing parameters and bad patterns (#247)

* docs(agents): add roadmap ingestion rules for missing parameters and bad patterns

* fix(agents): gate devops roadmap governance block on is_devops_cli

* fix(review): remediate markdown formatting issues and unbalanced code blocks in review reports (#250) (#251)

* refactor(core): use pyproject.toml as single source of truth for version (#248) (#249)

* refactor(core): use pyproject.toml as single source of truth for version (#248)

* fix(release): require __version__ presence in init before dynamic fallback (#249)

* docs(roadmap): add universal subcommand option propagation task

* feat(cli): universal trailing --dry-run option propagation across subcommands (#252) (#253)

* feat(pm): forward-looking project management, roadmap reconstruction, compactor hardening & issue sync (#254) (#255)

* feat(pm): forward-looking project management, roadmap reconstruction, compactor hardening & issue sync (#254)

* docs(agent): link PR #255 to task-254

* fix(github): handle remote issue query failures gracefully in roadmap sync (#254)

* feat(ci): fast execution caching when unchanged & pre-commit file change tracking integration (#256) (#257)

* feat(ci): fast execution caching when unchanged & pre-commit file change tracking integration (#256)

* docs(agent): link PR #257 to task-256

* feat(pr): add integrations to keep pull requests up to date (#258) (#259)

* feat(pr): add integrations to keep pull requests up to date (#258)

* docs(agent): link PR #259 to task-258

* fix(ci): address actionlint shellcheck warning and add shellcheck to devcontainer

* docs(roadmap): prune completed items from Value vs. Effort Prioritization Matrix

* feat(ci): accelerate devops ci performance with worker auto-scaling, test hotspot isolation, and zero-blocking dispatch (#260) (#261)

* docs(roadmap): add v0.2.24 milestone for Vibes architectural alignment

- POSIX Process Group Sandbox Enforcement (Obs 05)
- Structural Pre-Commit Hook Inversion (Systems Obs 08)
- Anti-Brittle Constant Elimination (Obs 06)
- Semantic Validator Deprecation & Structural Positional Oracles (Obs 17)

* feat(ci): accelerate devops ci performance with worker auto-scaling, test hotspot isolation, and zero-blocking dispatch (#260)

* fix(review): remediate session findings, harden defensive boundaries, and improve review feedback loop (#262) (#263)

* fix(review): remediate session findings, harden defensive boundaries, and improve review feedback loop (#262)

* docs(agent): link PR #263 and update status to In Review

* docs(agent): reconcile task-262 as merged and prune completed item from matrix (#264)

* fix(review): resolve PR #244 review threads, harden markdown fence/asterisk parsing, and update release notes (#265) (#266)

* fix(review): resolve PR #244 review threads, harden markdown fence/asterisk parsing, and update release notes (#265)

* docs(agent): link PR #266 and set status to In Review

* refactor(core): replace inconsistent N-Gate references with Gated (#267) (#268)

* refactor(core): replace inconsistent N-Gate references with Gated (#267)

* docs(agent): link PR #268 in task-267 tracking

* docs(agent): author deliverables as merged and prohibit administrative tracking PRs (#270) (#271)
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.

2 participants