Skip to content

MPT-18131: add version field to store the version when the migration was a…#47

Merged
d3rky merged 1 commit intomainfrom
MPT-18131-add-version
Feb 24, 2026
Merged

MPT-18131: add version field to store the version when the migration was a…#47
d3rky merged 1 commit intomainfrom
MPT-18131-add-version

Conversation

@svazquezco
Copy link
Collaborator

@svazquezco svazquezco commented Feb 23, 2026

…pplied

Closes MPT-18131

  • Added SERVICE_VERSION environment variable to persist the service version at the time each migration is applied
  • Extended Migration model with version (str | None) and started_at (dt.datetime | None) fields
  • Extended MigrationListItem model with applied_at, migration_type, started_at, and version fields
  • Added get_service_version() function to mpt_tool/config.py to retrieve the SERVICE_VERSION environment variable
  • Updated Airtable state manager to initialize, read, and persist version field in migration state records
  • Updated file-based state manager to populate version field when creating new migrations
  • Added version column to MigrationRender table display
  • Updated documentation and tests to reflect the new version field in migration state schema and output

@svazquezco svazquezco requested a review from a team as a code owner February 23, 2026 16:06
@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25adb09 and e310966.

📒 Files selected for processing (9)
  • README.md
  • docs/PROJECT_DESCRIPTION.md
  • mpt_tool/config.py
  • mpt_tool/managers/state/airtable.py
  • mpt_tool/managers/state/file.py
  • mpt_tool/models.py
  • mpt_tool/renders.py
  • tests/cli/test_cli_airtable_storage.py
  • tests/cli/test_cli_local_storage.py

📝 Walkthrough

Walkthrough

The PR adds a SERVICE_VERSION environment variable to persist version metadata per migration. This involves introducing a version field to the Migration data model and related classes, updating state managers to read and persist this field from the environment variable, extending the rendering pipeline to display the version in migration listings, and updating corresponding tests and documentation.

Changes

Cohort / File(s) Summary
Documentation
README.md, docs/PROJECT_DESCRIPTION.md
Added SERVICE_VERSION environment variable documentation with defaults and examples; documented version column additions to Airtable schema and migration state.
Configuration
mpt_tool/config.py
Introduced get_service_version() function to retrieve SERVICE_VERSION environment variable as str | None.
Data Models
mpt_tool/models.py
Added version field to Migration and extended MigrationListItem with applied_at, migration_type, started_at, and version fields; updated from_dict, to_dict, and failed methods to handle these fields.
State Managers
mpt_tool/managers/state/airtable.py, mpt_tool/managers/state/file.py
Threaded version field through state lifecycle methods; Airtable manager adds version to schema and state initialization; file manager populates version via get_service_version() during creation.
Rendering
mpt_tool/renders.py
Added "version" column to MigrationRender's field list for table display.
Tests
tests/cli/test_cli_airtable_storage.py, tests/cli/test_cli_local_storage.py
Extended test signatures with monkeypatch parameter; updated fixtures and assertions to include version field in migration state records and table output expectations.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • PR #17: Directly extends MigrationRender class introduced in that PR by adding the "version" column to the field list and rendering logic.
  • PR #30: Extends the rendering and model pipeline introduced in that PR by threading the SERVICE_VERSION environment variable through Migration, MigrationListItem, and state managers.
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Jira Issue Key In Title ✅ Passed Found Jira issue key in the title: MPT-18131. The PR title contains exactly one Jira issue key in the correct format (MPT-XXXX) as required.
Test Coverage Required ✅ Passed The pull request modifies 5 code files in the mpt_tool module and includes changes to 2 test files in the tests/cli/ directory.
Single Commit Required ✅ Passed The pull request contains exactly one commit, as verified by git log main..HEAD command, satisfying the Single Commit Required check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

@d3rky d3rky merged commit 271a5e6 into main Feb 24, 2026
4 checks passed
@d3rky d3rky deleted the MPT-18131-add-version branch February 24, 2026 08:13
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