Skip to content

refactor(IDE-1652): remove native settings UI and legacy FolderConfig infrastructure#393

Open
nick-y-snyk wants to merge 3 commits into
feat/IDE-1652-pr-c-html-migrationfrom
feat/drop-native-settings-ui
Open

refactor(IDE-1652): remove native settings UI and legacy FolderConfig infrastructure#393
nick-y-snyk wants to merge 3 commits into
feat/IDE-1652-pr-c-html-migrationfrom
feat/drop-native-settings-ui

Conversation

@nick-y-snyk
Copy link
Copy Markdown
Contributor

@nick-y-snyk nick-y-snyk commented May 15, 2026

Summary

Deletes all code made dead by the new `LsSettingsRegistry` / `FolderConfigSettings` / `LspConfigurationParam` architecture landed in PRs #394, #395, #396.

Breaking behaviour change: The native Eclipse preference and project property UIs (`PreferencesPage`, `NativeProjectPropertyPage`) are removed. HTML settings are now mandatory — the `SNYK_USE_HTML_SETTINGS` env gate and `isNewConfigDialogEnabled()` flag are dead and also removed.

Native settings UI (no callers after HTML-only migration in #396):

  • `PreferencesPage`, `TokenFieldEditor`, `NativeProjectPropertyPage`
  • `SnykPreferencePageFactoryTest`, `ProjectPropertyPageFactoryTest`

Legacy LS protocol POJOs (replaced by `LspConfigurationParam` / `ConfigSetting` / `LspFolderConfig` / `FolderConfigSettings`):

  • `Settings`, `FolderConfig`, `FolderConfigsParam`, `FolderConfigs`, `IdeConfigData`
  • `FolderConfigTest`

PR sequence (merge in order)

PR Scope
1/3 — #394 Foundation: `LsSettingsRegistry`, protocol POJOs
2/3 — #395 Wiring: inbound handler, outbound updater, `FolderConfigSettings`
3/3 — #396 HTML settings page migration
This PR All deletions (merge last)

Test plan

  • `./mvnw test -pl plugin,tests` passes
  • `./mvnw pmd:check -pl plugin` — zero violations

@nick-y-snyk nick-y-snyk requested a review from a team as a code owner May 15, 2026 13:19
@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented May 15, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@snyk-pr-review-bot

This comment has been minimized.

@nick-y-snyk nick-y-snyk changed the base branch from main to feat/IDE-1652 May 15, 2026 13:46
@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@nick-y-snyk nick-y-snyk force-pushed the feat/drop-native-settings-ui branch from 60d1f22 to de9de2c Compare May 15, 2026 18:36
@snyk-pr-review-bot

This comment has been minimized.

@snyk-pr-review-bot

This comment has been minimized.

@nick-y-snyk nick-y-snyk force-pushed the feat/drop-native-settings-ui branch from f2d3a9a to 8d60554 Compare May 18, 2026 12:57
@nick-y-snyk nick-y-snyk changed the title refactor: remove native settings UI in favour of HTML-only refactor(IDE-1652): remove native settings UI and legacy FolderConfig infrastructure May 18, 2026
@nick-y-snyk nick-y-snyk changed the base branch from feat/IDE-1652 to main May 18, 2026 12:57
@snyk-pr-review-bot

This comment has been minimized.

…cture

Deletes all code made dead by the new LsSettingsRegistry / FolderConfigSettings
/ LspConfigurationParam architecture landed in PRs #394, #395, #396:

Native settings UI (no callers after HTML-only migration):
- PreferencesPage, TokenFieldEditor, NativeProjectPropertyPage
- SnykPreferencePageFactoryTest, ProjectPropertyPageFactoryTest

Legacy LS protocol POJOs (replaced by LspConfigurationParam / ConfigSetting /
LspFolderConfig / FolderConfigSettings):
- Settings, FolderConfig, FolderConfigsParam, FolderConfigs, IdeConfigData
- FolderConfigTest
@nick-y-snyk nick-y-snyk force-pushed the feat/drop-native-settings-ui branch from 8d60554 to 7a36007 Compare May 20, 2026 13:00
@nick-y-snyk nick-y-snyk changed the base branch from main to feat/IDE-1652-pr-c-html-migration May 20, 2026 13:00
@snyk-pr-review-bot

This comment has been minimized.

@@ -1,256 +0,0 @@
package io.snyk.eclipse.plugin.preferences;
Copy link
Copy Markdown
Contributor

@acke acke May 20, 2026

Choose a reason for hiding this comment

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

🔴 Critical

The PR still only deletes files; three production files on the rebased head continue to reference deleted types and will not compile:

  • SnykPreferencePageFactory: return new PreferencesPage(); when !Preferences.isNewConfigDialogEnabled()
  • ProjectPropertyPageFactory: return new NativeProjectPropertyPage(); when HTML mode off
  • SnykExtendedLanguageClient: import PreferencesPage and PreferencesPage.notifyAuthTokenChanged(newToken) (HTML path already calls HTMLSettingsPreferencePage.notifyAuthTokenChanged at line 325)

Fix:
Add to this PR (or a prerequisite commit on the same branch):

// SnykPreferencePageFactory — always HTML
return new HTMLSettingsPreferencePage();

// ProjectPropertyPageFactory — always redirect
return new ProjectPropertyPage();

// SnykExtendedLanguageClient — remove PreferencesPage import + notifyAuthTokenChanged call

Run ./mvnw test -pl plugin,tests on feat/drop-native-settings-ui after changes.

— AI review comment

@@ -1,294 +0,0 @@
package io.snyk.eclipse.plugin.properties;
Copy link
Copy Markdown
Contributor

@acke acke May 20, 2026

Choose a reason for hiding this comment

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

Updated PR description — "no behaviour change" was wrong. Native preference and project property UIs are removed; HTML settings are now mandatory. The isNewConfigDialogEnabled() flag was also dead and is removed.

@@ -1,60 +0,0 @@
package io.snyk.eclipse.plugin.preferences;
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.

🟠 High

The PR deletes factory tests (including native-fallback cases) and does not add replacements asserting HTML-only factory behavior on the stacked branch.

Fix:
Add minimal tests after factory simplification, e.g. create_alwaysReturnsHtmlSettingsPreferencePage() and create_alwaysReturnsProjectPropertyPage().

— AI review comment

Copy link
Copy Markdown
Contributor

@acke acke left a comment

Choose a reason for hiding this comment

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

Orchestrated review (re-run)

Verdict: Request changes

Rebase onto #396 fixed the earlier base-branch and most orphan-deletion issues. One compile blocker remains: factories and SnykExtendedLanguageClient still reference PreferencesPage / NativeProjectPropertyPage while this PR deletes those classes. Small caller updates (~3 files) plus factory tests should make this approvable.

Severity Count Inline
Critical 1 PreferencesPage.java deletion
High 2 NativeProjectPropertyPage.java, SnykPreferencePageFactoryTest.java

— AI review comment

@snyk-pr-review-bot

This comment has been minimized.

…ectPropertyPage

Both classes are deleted in this PR. Factories now unconditionally return the
HTML pages; SnykExtendedLanguageClient drops the PreferencesPage import and
dead notifyAuthTokenChanged call.
@snyk-pr-review-bot
Copy link
Copy Markdown

PR Reviewer Guide 🔍

🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected
📚 Repository Context Analyzed

This review considered 33 relevant code sections from 9 files (average relevance: 0.39)

Copy link
Copy Markdown
Contributor

@acke acke left a comment

Choose a reason for hiding this comment

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

Re-review (review-orchestrator)

Verdict: APPROVE WITH NITS

Verification of prior comments

# Severity Status
1 CriticalSnykPreferencePageFactory / ProjectPropertyPageFactory / SnykExtendedLanguageClient compile-breaking references ✅ Fixed (e7a06b5). Grep-verified: no remaining references to PreferencesPage / NativeProjectPropertyPage / legacy FolderConfig / legacy Settings in plugin/src/main/.
2 PR description "no behaviour change" was wrong ✅ Updated — see new pass M1 for one description inaccuracy that survived
3 High — factory tests deleted without replacements ❌ Not addressed (see M3)

Cross-PR: IdeConfigData.java orphan question from #396 is closed by deletion here ✓.

New pass findings (4)

  • 🟡 Medium Preferences.java:89,144,360-365isNewConfigDialogEnabled() + USE_LS_HTML_CONFIG_DIALOG are dead code (no production callers); PR description says they're removed, but they aren't
  • 🟡 Medium PreferencesTest.java:183,191-192 — two tests exercise the now-dead isNewConfigDialogEnabled() method; false coverage
  • 🟡 Medium Factory test gap from prior High comment — neither addressed nor declined
  • 🔵 Low Description / commit e7a06b5 — labelled "pure deletions" but also modifies 3 files

Inline comment posted for M1; M2/M3/L1 follow as PR-level comments (target lines outside the diff or files don't exist).


Manifest: .claude/reviews/393/TOOLS_USED.md
— AI review comment

@acke
Copy link
Copy Markdown
Contributor

acke commented May 21, 2026

🟡 Medium

[tests/.../PreferencesTest.java:183, 191-192] (PR-level — target lines outside this PR's diff.)

Two tests still assert behavior of Preferences.isNewConfigDialogEnabled(). After this PR makes the method unreachable in production (see inline finding on Preferences.java:89), these become "test of dead code" — they pass green but verify a code path no caller depends on, providing false coverage confidence.

Fix: delete alongside the production method (per the M1 finding). If you choose to keep isNewConfigDialogEnabled for backward compatibility, add at least one test of a real caller to justify keeping it.

— AI review comment

@acke
Copy link
Copy Markdown
Contributor

acke commented May 21, 2026

🟡 Medium

[plugin/.../SnykPreferencePageFactory.java, ProjectPropertyPageFactory.java] (PR-level — target test files don't exist.)

Prior High comment requested create_alwaysReturnsHtmlSettingsPreferencePage() / create_alwaysReturnsProjectPropertyPage() tests. Author neither added them nor replied. Each factory is now a one-line return new X() — a unit test is trivial but locks in the "no conditional, always HTML" decision so a future regression that re-introduces a fallback path fails fast.

Fix:
Add (in tests/src/test/java/io/snyk/eclipse/plugin/preferences/):

@Test
void create_alwaysReturnsHtmlSettingsPreferencePage() throws CoreException {
    assertInstanceOf(HTMLSettingsPreferencePage.class, new SnykPreferencePageFactory().create());
}
@Test
void create_alwaysReturnsProjectPropertyPage() throws CoreException {
    assertInstanceOf(ProjectPropertyPage.class, new ProjectPropertyPageFactory().create());
}

Or reply on the original thread explaining why a one-liner factory doesn't warrant the test.

— AI review comment

@acke
Copy link
Copy Markdown
Contributor

acke commented May 21, 2026

🔵 Low

[PR description / commit e7a06b5]

PR title and chat description label this as "Pure deletions — review last once 394→395→396 are approved." That's mostly true, but commit e7a06b5 modifies 3 files (factories + SnykExtendedLanguageClient). Worth noting in the PR description so reviewers don't expect a literal git diff --diff-filter=D-only diff. The modifications are small and correct — just inconsistent with the "pure deletion" framing.

— AI review comment

@acke
Copy link
Copy Markdown
Contributor

acke commented May 21, 2026

🟡 Medium

[Preferences.java:89,144,360-365] (PR-level — Preferences.java was modified in earlier commits in this stack; couldn't anchor inline to head e7a06b5.)

USE_LS_HTML_CONFIG_DIALOG constant (line 89), its setDefault registration (line 144), and the isNewConfigDialogEnabled() method (lines 360-365) are still in the file after this PR. But grep -rn isNewConfigDialogEnabled plugin/src/main/ finds only the definition — zero production callers. The corrected PR description states "the isNewConfigDialogEnabled() flag was also dead and is removed", but the code disagrees.

Fix:
Either:

  1. Delete isNewConfigDialogEnabled(), USE_LS_HTML_CONFIG_DIALOG, the setDefault(...) line, and the tests at PreferencesTest.java:183, 191-192. (Matches the description.)
  2. Or restore a production caller and update the PR description back to "kept for backward compatibility".

The first option is consistent with this PR's "pure deletions" theme.

— AI review comment

Copy link
Copy Markdown
Contributor

@acke acke left a comment

Choose a reason for hiding this comment

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

APPROVE WITH NITS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants