fix(market): quote @-prefixed patch row ids to avoid invalid YAML - #288
Closed
ump45nose wants to merge 1 commit into
Closed
fix(market): quote @-prefixed patch row ids to avoid invalid YAML#288ump45nose wants to merge 1 commit into
ump45nose wants to merge 1 commit into
Conversation
`rowBlock` wrote `- id: ${rowId}` verbatim. Loader entry ids may be
npm package names such as `@scope/name`; a leading `@` is a reserved
YAML indicator, so `- id: @scope/name` is not valid YAML and the
profile overlay fails to parse, which stops the Harness from booting.
The previous `ROW_ID_RE` guard merely refused to write such ids, which
silently broke disabling scoped plugins.
Serialize non-plain ids as double-quoted YAML scalars and teach the
line scanner to read them back, so scoped plugins can be disabled
correctly.
Fixes dataelement#241.
Contributor
|
Thanks for the PR! After testing enabling and disabling plugins (including scoped packages), we could not reproduce the issue. Specifically:
Closing this PR accordingly. Thank you again for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Disabling a
@scope/nameplugin through the market wrote- id: @scope/name(unquoted) intocordis.patch.yml. Because@is a reserved YAML indicator, the overlay fails to parse and the profile refuses to boot (issue #241). The existingROW_ID_REcheck only refused the write, which turned disabling scoped plugins into a silent no-op.This change serializes a non-plain row id as a double-quoted YAML scalar (
"@scope/name") and teaches the line scanner to read quoted ids back, so the disable round-trips and the written overlay stays valid YAML.Changes
packages/dshmarket/src/patch.ts(and its compiledlib/patch.js):rowBlockquotes ids that are not plain scalars via a newyamlRowIdhelper.readUserPatchStateparses both plain and double-quoted ids.disableRow/enableRowno longer refuse@-scoped ids.Validation
@dhicoc/dsh-reverse-skill→ written as- id: "@dhicoc/dsh-reverse-skill"and read back as the same id; plain ids (foo,a.b-c_d) stay unquoted;include:fooand@scope/pkg/subare quoted.node --checkpasses onlib/patch.js.Fixes #241