Repository navigation
Commit f329b2f
* Start: vendored gem refusals name a remedy
Refs #2091. Empty commit that opens the draft pull request; the tests
and the fix follow.
Assisted-by: Claude Code:claude-fable-5-2
* Test that vendored gem refusals name a remedy
Refs #2091. The group-block, native-extension and platform-build
refusals must each name a mode that can patch the gem, and never one
that refuses it too. These fail until the next commit.
Assisted-by: Claude Code:claude-fable-5-2
* Name a remedy in vendored gem refusals
Vendored mode refuses a gem declared inside a block, a gem with native
extensions and a precompiled platform build. Each error gave the cause
and no next step, so a stock Rails Gemfile failed 5 of 7 gems with
nothing to act on.
Each refusal now names a mode that can patch the gem: hosted mode for a
block (with the top-level `group:` form when the block is a plain
`group … do`), hosted or agent mode for native extensions, and agent
mode alone for a platform build, which hosted mode refuses too.
Fixes #2091
Assisted-by: Claude Code:claude-fable-5-2
* Fit each gem refusal's remedy to its cause
Review of the first cut found remedies that could mislead:
- A gem inside a source, git, github or path block was sent to hosted
mode, which refuses it too. The enclosing blocks are now read with
formats::gem::ruby::block_stack and agent mode is named there.
- The suggested top-level line dropped the declaration's version and
options. The remedy now names only the group: option to add.
- A gem that is hosted already (the takeover and eject preflight) was
told to use hosted mode. It is now told it can stay there.
- `socket-patch scan --mode hosted` was quoted as the fix for one gem,
though a whole-project hosted scan moves the vendored patches of
other ecosystems. The remedies name the mode for the gem, as hosted
mode's own refusals do, and the docs say how to patch one gem.
Refs #2091
Assisted-by: Claude Code:claude-fable-5-2
* Drop needless borrows in gem remedies
clippy::needless_borrow on the four remedy calls.
Refs #2091
Assisted-by: Claude Code:claude-fable-5-2
* Word the hosted remedy for an eject too
The vendor eject of a hosted gem reaches the indented-declaration
refusal through the backend, not the takeover preflight, so the
preflight-only "keep it in hosted mode" wording missed it (the e2e
eject tests failed). One wording now serves every caller: "leave
<gem> to hosted mode (`--mode hosted`)", true whether or not the gem
is hosted already.
Refs #2091
Assisted-by: Claude Code:claude-fable-5-2
* Skip hosted in native remedy for source gems
Bugbot: the native-extension refusal is raised before the Gemfile
plan, so a native gem inside a source, git, github or path block, or
with one of the source options, was still sent to hosted mode, which
refuses it (redirect_gem_source_option). The remedy now names agent
mode alone for such a declaration.
Refs #2091
Assisted-by: Claude Code:claude-fable-5-2
* Read gem source options with the shared reader
declaration_selects_source kept its own list of source keys, which left
out `gitlab:` and custom `git_source` keys that hosted mode refuses
(redirect_gem_source_option). For such a gem with a native extension the
remedy named `--mode hosted`, a mode that refuses it as well. Use
gemfile::source_option, the reader hosted mode refuses with.
Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011f9aeNxATwEfTmV9fd2wYR
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 911bf16 commit f329b2f
3 files changed
Lines changed: 338 additions & 9 deletions
File tree
- crates
- socket-patch-cli/tests
- socket-patch-core/src/vendor
- docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3673 | 3673 | | |
3674 | 3674 | | |
3675 | 3675 | | |
| 3676 | + | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
3676 | 3685 | | |
3677 | 3686 | | |
3678 | 3687 | | |
| |||
0 commit comments