Skip to content

refactor: use config from meta_core instead of local module - #14

Merged
mateodelnorte merged 4 commits into
mainfrom
refactor/move-config-to-meta-core
Feb 14, 2026
Merged

mateodelnorte merged 4 commits into
mainfrom
refactor/move-config-to-meta-core

Conversation

@mateodelnorte

@mateodelnorte mateodelnorte commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Replace local config module with re-export from meta_core
  • Move to_dependencies() into dependency_graph.rs as a From<ProjectInfo> impl to break circular dependency
  • Update all internal imports to use meta_core::config

Merge order

Merge after: gitkb/meta_core#3

Test plan

  • cargo build --workspace passes
  • cargo test --workspace passes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Centralized configuration into a shared implementation to simplify behavior and reduce duplication
    • Streamlined project-to-dependency conversion for more consistent dependency mapping and graph building
  • Chores

    • Simplified CI workflows to perform branch-aware repository clones with a fallback, using a consolidated loop

Replace local config module with re-export from meta_core. Move
to_dependencies() conversion into dependency_graph.rs as a From impl
to break the circular dependency between config and dependency_graph.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Feb 13, 2026 •

Copy link
Copy Markdown

Walkthrough

Public config implementation was replaced with a re-export from meta_core::config; imports updated to use meta_core::config; a From<ProjectInfo> for ProjectDependencies conversion was added; CI clone steps were consolidated into a branch-aware loop with fallback.

Changes

Cohort / File(s) Summary
Config re-export
src/config.rs
Removed local config implementation and added pub use meta_core::config::*; to expose config API from meta_core.
Imports & callsites
src/context.rs, src/main.rs
Updated imports to meta_core::config::{...} (replacing local/meta_cli paths). In src/context.rs, dependency construction changed from p.to_dependencies() to p.clone().into().
Type conversion
src/dependency_graph.rs
Added impl From<meta_core::config::ProjectInfo> for ProjectDependencies that maps name, path, repo, tags, provides, and depends_on.
CI workflows
.github/workflows/auto-format.yml, .github/workflows/ci.yml
Replaced individual git clone commands with a loop that tries a branch-specific clone (-b "$BRANCH") and falls back to a default clone; added BRANCH env and consolidated clone logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰
I hopped through lines and found a core,
configs now live where they roam no more,
ProjectInfo folds into dependency light,
clones loop tidy, morning to night,
a happy rabbit bounds off — encore!

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 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 objective of the PR: moving the config module from local implementation to using meta_core's config, which is the central theme across src/config.rs, src/context.rs, src/main.rs, and src/dependency_graph.rs changes.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/move-config-to-meta-core

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

@mateodelnorte

Copy link
Copy Markdown
Contributor Author

The docstring coverage warning (0%) is expected — this PR's diff contains only a From trait implementation and import changes. The From impl is a standard Rust conversion trait that is self-documenting via its type signature.

When coordinated changes span multiple repos, CI needs to clone
dependency repos from the same branch (not just main) to pick up
changes that haven't merged yet. Add smart branch cloning that tries
the PR branch name first before falling back to main.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/ci.yml (1)

26-53: 🧹 Nitpick | 🔵 Trivial

Consider extracting shared setup into a composite action.

The clone-dependencies, create-workspace, and create-VERSION steps are duplicated across all three jobs. A composite action could reduce this repetition and make future updates easier.

📁 Example composite action structure

Create .github/actions/setup-workspace/action.yml:

name: 'Setup Workspace'
description: 'Clone dependencies and create workspace'
runs:
  using: 'composite'
  steps:
    - name: Clone dependencies
      shell: bash
      run: |
        BRANCH="${{ github.head_ref || github.ref_name }}"
        for repo in meta_core meta_plugin_protocol loop_lib; do
          git clone --depth 1 -b "$BRANCH" "https://github.com/harmony-labs/${repo}.git" 2>/dev/null || \
          git clone --depth 1 "https://github.com/harmony-labs/${repo}.git"
        done

    - name: Create workspace Cargo.toml
      shell: bash
      run: |
        cat > Cargo.toml << 'EOF'
        [workspace]
        members = ["meta_cli", "meta_core", "meta_plugin_protocol", "loop_lib"]
        resolver = "2"
        # ... rest of config
        EOF

    - name: Create VERSION file
      shell: bash
      run: |
        grep '^version' meta_cli/Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/' > VERSION

Then in each job:

- uses: ./.github/actions/setup-workspace

- Move github.head_ref from inline shell interpolation to env: section
  to prevent command injection from malicious branch names
- Add clone failure handling (fail fast with ::error:: annotation)
- Add branch logging so CI shows which branch was used for each dep

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.github/workflows/ci.yml:
- Around line 31-40: Extract the repeated clone loop into a reusable composite
action named "clone-deps" and replace each duplicated loop with a single "uses"
step; the composite should accept inputs for BRANCH and repo list (defaulting to
"meta_core meta_plugin_protocol loop_lib"), perform the same logic (try depth-1
clone of https://github.com/harmony-labs/${repo}.git on BRANCH, fall back to
default branch, and fail with an error on total failure), and preserve the
existing echo messages and exit behavior so callers (the CI jobs currently
running the for repo ... clone logic) can simply call the action with the BRANCH
input.

Comment thread .github/workflows/ci.yml
@mateodelnorte
mateodelnorte merged commit 06d7122 into main Feb 14, 2026
7 checks passed
@mateodelnorte
mateodelnorte deleted the refactor/move-config-to-meta-core branch February 14, 2026 03:18
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