Skip to content

Refactor manifest path resolution to use centralized helper#48

Merged
ainetx merged 1 commit into
mainfrom
fix-kit-validate-with-manifest
Jun 18, 2026
Merged

Refactor manifest path resolution to use centralized helper#48
ainetx merged 1 commit into
mainfrom
fix-kit-validate-with-manifest

Conversation

@ainetx

@ainetx ainetx commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • Improvements

    • Enhanced kit manifest resolution to prioritize canonical manifest format, ensuring consistent behavior when both canonical and legacy manifest types coexist.
    • Improved validation robustness for mixed manifest file scenarios.
  • Tests

    • Added test coverage for manifest format precedence and validation behavior.

…_manifest_path helper

Signed-off-by: ainetx <viator@via-net.org>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 12335258-de23-465d-90bf-c2d0643a53f9

📥 Commits

Reviewing files that changed from the base of the PR and between ac9df90 and 096ab52.

📒 Files selected for processing (4)
  • skills/studio/scripts/studio/commands/kit.py
  • skills/studio/scripts/studio/utils/manifest.py
  • tests/test_kit_manifest_validate.py
  • tests/test_manifest.py

📝 Walkthrough

Walkthrough

Adds resolve_kit_manifest_path to manifest.py to centralize manifest file selection, preferring .cf-studio-kit.toml over legacy manifest.toml. Updates load_manifest and two kit command functions (_load_manifest_install_adapter, _validate_register_manifest_containment) to use this helper. New tests verify canonical manifest takes priority when both files coexist.

Changes

Canonical manifest resolution

Layer / File(s) Summary
resolve_kit_manifest_path helper and load_manifest integration
skills/studio/scripts/studio/utils/manifest.py, tests/test_manifest.py
Adds resolve_kit_manifest_path returning the canonical .cf-studio-kit.toml path when present, falling back to manifest.toml, or None. Updates load_manifest to call this helper, return None when unresolved, and branch to _load_canonical_kit_manifest for canonical paths. Test asserts load_manifest ignores a malformed legacy manifest when canonical is present.
kit.py callers refactored and validation test added
skills/studio/scripts/studio/commands/kit.py, tests/test_kit_manifest_validate.py
Replaces manual manifest-file probing in _load_manifest_install_adapter and _validate_register_manifest_containment with resolve_kit_manifest_path. Adds test confirming _validate_kit_by_path succeeds with manifest_source == "canonical" and zero resource errors when a malformed legacy manifest is present alongside a canonical one.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hop, hop — which file shall we heed?
.cf-studio-kit.toml takes the lead!
Legacy manifest.toml? Cast aside,
The canonical path is our trusted guide.
One helper to rule them, neat and small —
Now all the callers agree after all! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: introducing a centralized helper function (resolve_kit_manifest_path) to replace duplicated manifest path resolution logic across multiple functions.
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-kit-validate-with-manifest

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

@sonarqubecloud

Copy link
Copy Markdown

@ainetx ainetx merged commit 41191b0 into main Jun 18, 2026
21 checks passed
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