GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||
GeezerVison is showing github.com — Fix gem source-block detection for multi-line and brace openers (#1509) by mikolalysenko · Pull Request #1520 · SocketDev/socket-patch Conversation
|
| Issue shape | Test |
|---|---|
#1509 multi-line source(…) do |
source_block_detection, source_block_declaration_keeps_its_bang_through_restore, e2e gem_hosted_unwind_keeps_a_source_block_bang (ScanVexSourceBlockMultiLineOpener, rollback + remove) |
#1509 source(…) { } (! and indent) |
same unit tests, e2e ScanVexSourceBlockBraces (rollback + remove, lock and Gemfile byte-restored, frozen install) |
assertion failed: at("source(\n \"https://x\"\n) do …"), and the restore lost the !: rails (= 7.0.0) vs rails (= 7.0.0)!). The e2e test failed on Bundler 4.0.22 with rollback: the lock comes back byte for byte, ! included and DEPENDENCIES\n vuln-gem (= 1.0.0) without the !.cargo test -p socket-patch-core --all-features --lib -- gem: 357 passedcargo test -p socket-patch-cli --all-features --test e2e_redirect_gem_build -- --ignored (Ruby 3.3.6, Bundler 4.0.22): 30 passedcargo fmt --all -- --check and cargo clippy --workspace --all-features -- -D warnings: cleancargo test --workspace --all-features: couldn't finish locally: the session's disk allowance ran out linking every integration-test binary, so CI runs it. cargo test -p socket-patch-core --all-features --lib (all 6472) passes except 4 chmod-based permission tests (copy_tree::relax_loop_must_not_traverse_symlinked_root, vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry, pypi_poetry::wire_write_failure_…, pypi_requirements::wire_failure_rolls_back_…). Those can't fail as expected under uid 0 in this sandbox, and this diff doesn't touch them.No wrapper changes: npm/, pypi/ and gem/ only dispatch to the binary.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Hsu76uJiHbbPSV1iSeEukP
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
cb269c1 to
466f92c
Compare
Hosted rollback and remove dropped the `!` source pin from a gem
declared inside a `source(...)` block whose arguments span lines, or
inside a `source("...") { ... }` brace block. Bundler 4.0.19+ then
refused every frozen install of the restored Gemfile.lock, and the
brace form also came back with the gem at the wrong indent.
The Gemfile block scanner now keeps a statement open while a `(` or
`[` is unclosed, remembers that the statement began with `source`
until its `do` or `{`, and tracks `{ }` blocks alongside `do ... end`.
Fixes #1509
Assisted-by: Claude Code:claude-opus-5-5
A brace block now counts as the source's own block only right after
the `source(...)` argument list, so `source ENV.fetch(...) { ... } do`
keeps its `!` pin. Hash braces keep a statement open like parens, a
stray `}` no longer closes a `do` block, and `?(`-style character
literals are no longer read as brackets. A restored first gem in a
multi-line `source(` block no longer gets a blank line after the
opener. Only the end of an unfinished line is carried forward, so a
long open bracket no longer costs quadratic time.
Refs #1509
Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
An `if` at the start of a line inside an open `(`, `[` or hash was
read as a modifier, so it opened nothing while its `end` still closed
the enclosing `source` block, and the gem lost its `!` pin on
rollback or remove. A stabby lambda's `-> {` was read as a hash.
A line that leaves only a bracket open now starts a fresh expression
on the next line, `-> {` opens a block, and an open bracket carries
only a `source` statement on to its block, so a bracket the scanner
misses elsewhere no longer hides every later source block.
Refs #1509
Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 943ec44. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Hosted gemrollback / remove strip the DEPENDENCIES ! when the user's source block opener spans lines or uses braces, so frozen installs fail on Bundler 4.0.19+
There was an error while loading. Please reload this page.