8000 fix(mctx): keep inline-table settings when adding deps by gominimal-aw-bot[bot] · Pull Request #2244 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(mctx): keep inline-table settings when adding deps - #2244

Merged
norrietaylor merged 3 commits into
mainfrom
inbox-patch/fix-mctx-inline-table-add-deps-6ac71f7a116af91e
Oct 18, 2026
Merged

norrietaylor merged 3 commits into
mainfrom
inbox-patch/fix-mctx-inline-table-add-deps-6ac71f7a116af91e

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Oct 17, 2026 •
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABX3vQAA

Problem

min add --session (and the stack/task variants) resolved its target
table with as_table_mut(), which returns None for TOML inline
tables. Consequences: an inline session = { ... } was replaced
wholesale by a fresh [session] containing only packages, silently
dropping vars, patches and lifecycle_hooks; inline [stack] and
tasks.<name> tables made the command fail with "could not find".

Change

Context::add_deps now uses as_table_like_mut(), which matches both
explicit and inline table forms, so a fresh [session] is only
inserted when the key is absent. The upsert helper's bound becomes
TableLike + ?Sized to accept the trait-object returns. All four
AddDepMode arms are covered.

Verification

  • cargo test --locked -p mctx add_deps failed on the unmodified tree
    with the inline-stack symptom (could not find [stack]), passes
    after the fix (behavioral red/green pin in add_deps_inline_tables,
    which asserts sibling keys — use, exec, vars.ANSWER — survive
    the write-back and re-parse into the config).
  • cargo fmt --all --check — clean.
  • cargo clippy --workspace --all-targets --locked -- -D warnings — clean.
  • cargo test --locked -p mctx — 47 passed, 0 failed.

Summary by CodeRabbit

  • Bug Fixes
    • Package updates now work with both inline and standard TOML tables, while preserving existing settings and remaining available after configuration reloads.

add_deps looked up [stack], tasks.<name> and [session] with
as_table_mut, which returns None for TOML inline tables. An
inline session = { ... } was therefore replaced wholesale by a
fresh [session] holding only packages, silently dropping vars,
patches and lifecycle hooks, while inline [stack] and task
tables made the command error out with "could not find".

Use as_table_like_mut so both explicit and inline table forms
are found, and only insert a fresh [session] when the key is
absent. The upsert helper takes ?Sized TableLike for the dyn
returns. Pinned by a test that adds deps through all inline
forms and asserts sibling keys survive the write-back.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner October 17, 2026 09:58
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Oct 17, 2026
@coderabbitai
coderabbitai Bot commented Oct 17, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

Or wait 2 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 50 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 0308f770-0503-4fad-b30e-4c5490098f3a
📥 Commits

Reviewing files that changed from the base of the PR and between 9068ff7 and 51ae830.

📒 Files selected for processing: 1
  • crates/mctx/src/lib.rs

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 32f8d377-33ba-41c6-97bd-15d6761d0971
📥 Commits

Reviewing files that changed from the base of the PR and between 21744cc and 9068ff7.

📒 Files selected for processing: 1
  • crates/mctx/src/lib.rs

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

Dependency updates now support package settings stored in TOML inline tables as well as standard tables. A test checks that existing sibling values remain intact and that updated session settings parse after reloading.

Changes: Inline TOML Table Support

Layer / File(s) Summary
TableLike dependency updates
crates/mctx/src/lib.rs
The package-list helper and build, runtime, task, and session package updates now accept TableLike values. A test checks that dependency additions preserve sibling settings and that session settings parse after reloading.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: bryan-minimal

Merge Risk: ⚪ Minimal · up to 9068f

No actionable issue is identified that would prevent merging after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files.
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.
Title check Passed The title is concise, follows the required Conventional Commit format, and clearly describes preserving inline-table settings when adding dependencies.
Description check Passed The description explains the problem, implementation, affected modes, and verification results. It provides the required summary and testing information, although it does not include the template's Ch…
Full details: Description check

Explanation

The description explains the problem, implementation, affected modes, and verification results. It provides the required summary and testing information, although it does not include the template's Checklist section.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks each table row
Inline settings join the flow
Sibling values stay in place
Session settings load with grace
Packages hop to their new home

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

@norrietaylor norrietaylor changed the title fix: fix(mctx): keep inline-table settings when adding deps fix(mctx): keep inline-table settings when adding deps Oct 17, 2026
The task and session checks matched the earlier build_packages
substring, so they passed without the fix. Parse the written TOML and
check each table's own key, that each table stays inline, the
RuntimePackages arm, and that a missing task still errors.
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch label Oct 17, 2026
@norrietaylor
Copy link
Copy Markdown
Member

/review

@minimal-foundry
minimal-foundry Bot commented Oct 18, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at 51ae8306c7ed.

Nothing to do.

Clobber: none: git log --oneline -8 -- crates/mctx/src/lib.rs shows only the fix and its follow-up test, no recent work reverted.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minimal-review — advisory review

Verdict COMMENT — No findings.

Panel: 1 of 3 personas ran (correctness); did not complete: security, supply-chain.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 18, 2026
@norrietaylor
Copy link
Copy Markdown
Member

/review

@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved on ARCH PASS at 51ae830.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 18, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved on ARCH PASS at 51ae830.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 18, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approved on ARCH PASS at 51ae830.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 18, 2026
Merged via the queue into main with commit 9c985f0 Oct 18, 2026
37 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/fix-mctx-inline-table-add-deps-6ac71f7a116af91e branch October 18, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:fix Agen 4F40 tic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0