Test/test gates#1356
Draft
VulnShade wants to merge 12 commits into
Draft
Conversation
Make the per-folder "Reset overrides" button in the HTML config dialog
visible and functional end-to-end.
- Show the button (drop display:none) and move it into the folder
disclaimer banner, right-aligned, red.
- Fix JS reset bugs: key resets by folderPath instead of the compacted
folder index, and emit a reset-only folder even when it has no other
edits. Emit flat null for all 14 org-scope folder fields (now incl.
preferred_org); the IDE maps null -> {value:null, changed:true}.
- Make preferred_org resettable in applyPreferredOrg: a null reset Unsets
both user:folder:preferred_org and user:folder:org_set_by_user so the
folder reverts to its auto-determined / global org.
- Add JS folder-reset tests, a Go unit test for the org reset, and an
end-to-end UpdateSettings reset test.
- Document the folder-override reset contract in configuration.md and
configuration-dialog.md.
- Regenerate config dialog HTML fixtures.
…s [IDE-1945]
Two defects stopped 'Reset overrides' from working:
1. No-op in sandboxed webview. VSCode renders the settings dialog in a
sandboxed iframe without 'allow-modals', so window.confirm() is silently
ignored and returns false. Both reset handlers gated their work behind
confirm(), so the click bailed and nothing happened. Remove the confirm()
prompts (reset is reversible and the dialog shows a disclaimer banner).
2. Incomplete reset. additional_parameters, additional_environment and
scan_command_config are folder overrides editable in the dialog but were
never cleared: the JS omitted them from FOLDER_RESET_FIELDS, and on the LS
side they are processed by applyBasicFolderFields (marked handled), so the
generic null-reset loop skipped them while their own handlers ignored a
nil value -- making the reset unreachable. Add the three keys to
FOLDER_RESET_FIELDS and teach applyStringField / applyStringSliceField /
applyScanCommandConfig to Unset the override on {Changed:true, Value:nil}.
Extend the end-to-end reset test to cover the three non-scalar fields and
drop the dead win.confirm stubs / section-name formatter.
…derOverride Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- docs: update reset field count 14→17, add additional_parameters, additional_environment, scan_command_config to the reset field list - docs: correct incorrect claim that scan_command_config null-reset is a no-op; the LS handler now honours it via unsetFolderOverride - tests: mirror FOLDER_RESET_FIELDS in RESET_FIELDS (14→17 entries) - tests: remove AI-style bug annotation from test name - tests: update "14 nulls" count to "17 nulls" in DOM-driven test name - tests: rename test to say "auto-org" not "global org" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove the duplicate "clicking reset triggers a save even with no other edits" test (already covered by the DOM-driven no-edits test above it) and add a test asserting the dirty tracker returns to clean after a successful reset save. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After applyPreferredOrg unsets preferred_org and org_set_by_user,
updateFolderConfigOrg was calling SetPreferredOrgAndOrgSetByUser("",false)
which re-added both keys as {Value:""/false, Changed:true} — making
HasUserOverride return true even though the user had just reset the
overrides.
Add a guard: only normalise to empty/false when at least one of the
keys is still present (i.e. a non-reset transition). If both are
already absent the call is a no-op for resolution purposes but creates
a spurious active-override entry in the store.
Also add SettingIsLspInitialized=true and DepScanStateAggregator to the
end-to-end reset test so it exercises the production code path through
updateFolderOrgIfNeeded.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…figOrg
The else-if !currentSnap.OrgSetByUser branch was missing the same guard
added to the orgSetByUserJustChanged branch. After a reset clears both
overrides, a subsequent update changing only AutoDeterminedOrg would
trigger this branch and re-add preferred_org / org_set_by_user as
explicit {Value:""/false, Changed:true} entries, making HasUserOverride
return true again.
Apply the same guard: skip the normalisation call when both keys are
already absent. Add a regression test that seeds the exact scenario:
reset → AutoDeterminedOrg change → assert keys stay absent.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
VSCode sandboxed webviews block window.confirm() silently (no allow-modals). Add ideBridge.confirm(message, callback) that routes through the existing executeCommand bridge to snyk.showConfirmationDialog in VSCode, falling back to window.confirm() in IDEs with no bridge (JetBrains, Eclipse). Both reset handlers (section and folder override) now gate their work behind this callback. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Description
Troubleshooting error in enhanced gate
Checklist
make generate)make lint-fix)