fix: un-deprecate extensions removed from the extension-control file by netomi · Pull Request #2261 · eclipse-openvsx/openvsx · GitHub
Skip to content

fix: un-deprecate extensions removed from the extension-control file - #2261

Merged
netomi merged 3 commits into
mainfrom
fix/extension-control-deprecation-reconcile
Sep 29, 2026
Merged

netomi merged 3 commits into
mainfrom
fix/extension-control-deprecation-reconcile

Conversation

@netomi

@netomi netomi commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #2260.

ExtensionControlJobRequestHandler.processDeprecatedExtensions only ever applied the entries the daily job's freshly fetched extensions.json still lists. If an entry flips from true to false (or the object form drops disallowInstall), that key is still present and updateExtension correctly un-deprecates it. But an entry removed from the file entirely — the more natural way to say "this is no longer deprecated" — was never seen by that loop at all: nothing else ever calls extension.setDeprecated(false), and there is no admin API to toggle it by hand either. So the extension stayed deprecated forever.

Fix

After applying every entry the control file lists, reconcile: load every extension currently marked deprecated = true in the database, and un-deprecate any of them that no longer appear in the file (updateExtension(id, false, null, true), the same call an explicit false entry already takes).

Matching is done case-insensitively, consistent with every other namespace/extension lookup in the codebase (ExtensionRepository#findByNameIgnoreCaseAndNamespaceNameIgnoreCase), so a casing difference alone between the file and the stored extension is never mistaken for a removal.

Changes

  • ExtensionRepository.findByDeprecatedTrue() / RepositoryService.findDeprecatedExtensions(): fetch the extensions currently marked deprecated.
  • ExtensionControlJobRequestHandler.processDeprecatedExtensions: tracks the ids seen in the control file, then reconciles against the database afterward.

Tests

ExtensionControlJobRequestHandlerTest:

  • unDeprecatesExtensionNoLongerListedInControlFile — a deprecated extension absent from the file gets un-deprecated.
  • doesNotUnDeprecateExtensionStillListedInControlFile — an extension still listed (even as true) is left alone by the reconciliation pass.
  • matchesControlFileEntriesCaseInsensitively — a casing difference between the file and the stored extension is not treated as a removal.

Confirmed these fail (in fact don't compile, since findDeprecatedExtensions doesn't exist yet) without the fix.

./gradlew spotlessCheck passes for every touched file. Full extension_control package suite (24 tests) is green. ./gradlew test couldn't be run in full in this environment — no Docker daemon available for the Testcontainers-backed integration tests — so say so rather than claiming a full green run.

🤖 Generated with Claude Code

processDeprecatedExtensions only ever applied entries the daily
extension-control job's fetched extensions.json still lists. An entry
removed from the file entirely, rather than flipped to false, was
never seen by that loop, so extension.deprecated stayed true forever
- nothing else ever clears it. Reconcile instead: after applying every
entry the file lists, un-deprecate any extension the database still
has marked deprecated but that no longer appears in the file. Fixes #2260.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

Un-deprecation leaves any existing replacement persisted and exposed.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Reconciles database deprecation state with the extension-control file so removed entries become active again.

Changes:

  • Adds repository lookup for deprecated extensions.
  • Reconciles missing entries case-insensitively.
  • Adds regression tests for removal and casing behavior.
File Description
ExtensionControlJobRequestHandler.java Adds deprecation reconciliation.
ExtensionRepository.java Adds deprecated-extension query.
RepositoryService.java Exposes the query.
ExtensionControlJobRequestHandlerTest.java Tests reconciliation behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

netomi and others added 2 commits September 29, 2026 05:52
RepositoryService already had findDeprecatedExtensions(Extension) -
extensions deprecated in favor of a given replacement - which is
unrelated to the new no-arg query. Reusing the name meant
RepositoryServiceSmokeTest's assertAll only ever exercised the
existing overload, so its "did we call every public method" check at
the end failed for the new one. Renamed to findAllDeprecatedExtensions
(matching findAllActiveExtensions right above it) and added it to the
smoke test.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
updateExtension only changed extension.replacement when replacementId
was non-null, so un-deprecating (an explicit false entry, or the
reconciliation pass just added) left a stale replacement in place -
still surfaced by LocalRegistryService#toReplacementJson regardless of
the deprecated flag. Clear it unconditionally once deprecated is
false.

Addresses a Copilot review comment on PR #2261.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Copilot AI left a comment

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.

Copilot review overview

🟢 Approval recommended

The reconciliation behavior is complete, safely handles malformed top-level data, and has focused regression coverage.

Review effort: Balanced
Findings: None

Resolved since last review (1)

@netomi
netomi requested a review from cstamas September 29, 2026 06:07
@netomi
netomi merged commit ac518b9 into main Sep 29, 2026
6 checks passed
@netomi
netomi deleted the fix/extension-control-deprecation-reconcile branch September 29, 2026 07:22
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.

Extension control: removing a deprecated entry from extensions.json does not un-deprecate it

3 participants