Skip to content

fix: exclude packages in Upgrade panel - #943

Merged
marqode merged 3 commits into
mainfrom
fix/exclude-packages-from-upgrades
Oct 22, 2026
Merged

marqode merged 3 commits into
mainfrom
fix/exclude-packages-from-upgrades

Conversation

@marqode

@marqode marqode commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes packages excluded in the Packages tab of the legacy Upgrades form still being upgraded.

The form submits to POST /computers/upgrade-packages- exclude_packages matches installed package IDs. The Packages tab sent the IDs of the newer versions from packages:search-upgrades, which the server silently ignores, so those packages were upgraded anyway.

Changes:

  • PackagesPanel reports loaded packages through a new optional onPackagesLoad prop, and Upgrades keeps a map from those IDs to package names. The map survives switching tabs.
  • On submit, getExcludedPackagesWithNames replaces Packages-tab IDs with package names (excludePackageNames). IDs excluded in the Instances tab pass through unchanged.
  • The upgradeInstancesPackagesQuery mutation looks up the installed IDs for those names with packages:search. It merges them into each instance's exclude_packages and removes excludePackageNames before posting.

Behavior:

  • A package excluded in the Packages tab is not upgraded at all: every installed version of it is excluded on the instances where it was excluded.
  • The extra request only happens when the Packages tab has exclusions. Otherwise the request body is the same as before.
  • Exclusions still don't sync between the Instances and Packages tabs; that's out of scope.

Release Impact

Pick the target branch (see RELEASES.md for the full model):

  • dev — internal testing → publishes to ppa-build-dev
  • main — next beta → publishes to ppa-build
  • release/YY.MM — point release on a maintained cycle → publishes to ppa-build-YY.MM (and to ppa-build-stable if this is the currently-promoted branch). Specify cycle: release/____

Change type (tick one):

  • Patch (fix)
  • Minor (feature)
  • Major (breaking)

The change-type label is informational and only affects how the entry is rendered in the CHANGELOG. The actual version is computed from the branch and CalVer cycle — pnpm changeset's patch/minor choice does not influence it.

Checklist

  • Changeset added — I have run pnpm changeset (or pnpm changeset --empty if no CHANGELOG line is warranted) and committed the resulting .md file. Required for PRs targeting main and release/*; enforced by the Changeset check workflow.
  • UI verified — I have verified the changes locally.
  • Linting clean — No linting errors are present (especially in scripts/).

Docs

Changes that affect a documented workflow need a companion PR against landscape-documentation (see docs/DOCUMENTATION.md for when it's required and how to target branches). Tick one:

  • Docs PR opened — Link: ______
  • Docs PR needed, deferred — tracked in: ______
  • No docs needed — internal change, or user-facing but doesn't alter any documented workflow

Reviewer Setup

This section is intended to help reviewers find which pages of the UI were changed, and whether any special conditions are required to run the code.

MSW (Mock Service Worker)

  • MSW must be enabled (VITE_MSW_ENABLED=true in .env.local)
  • MSW not required
  • Not Applicable

Backend

  • A specific backend branch from Landscape server must be utilized locally — Branch: ______
  • No specific backend branch required
  • Not Applicable

Feature flags: package-search-rest-api on (for the Packages tab) and package-change-plans off (otherwise the newer upgrade form is shown instead).

Where to Find the UI Changes (if applicable)

Navigate to Instances → select one or more instances with upgrades (e.g. Application Server 2) → Operations → Upgrade → Packages tab.

Testing Instructions (optional)

  1. Open the browser devtools Network tab.
  2. In the Packages tab, untick two packages and click Upgrade.
  3. Check the packages:search request: it should have names set to the unticked packages and installed: "true".
  4. Check the computers/upgrade-packages request: every exclude_packages should contain only installed package IDs (they should match the packages:search response, not the packages:search-upgrades IDs).
  5. Check in Activities that the excluded packages aren't in the upgrade.
  6. Repeat using only the Instances tab: no packages:search request should be sent, and the unticked installed IDs should go through unchanged.

Automated tests in src/features/upgrades/components/Upgrades/Upgrades.test.tsx:

  • Packages tab: the request carries only the installed ID, not the newer version's ID, and no excludePackageNames field.
  • Instances tab: IDs pass through unchanged and no packages:search call is made.

Versioning Reminder

Important

Landscape UI uses CalVer (YY.MM.Point.Build). Version derivation by branch:

  • main / point/* → YY.MM.0.<run>-beta
  • dev → YY.MM.0.<run>-dev
  • release/YY.MM → YY.MM.1.<run> (cycle pinned by branch name)

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.

🟡 Changes recommended

A critical exclusion-source collision can misclassify Instances-tab exclusions and apply them incorrectly across instances.

1 open issue
What changed in this PR

This pull request fixes package exclusions in the legacy Upgrades form by resolving Packages-tab upgrade candidate IDs to installed package IDs before submission.

Changes:

  • Tracks package names loaded by the Packages tab across tab changes.
  • Resolves excluded package names through packages:search and submits installed IDs.
  • Preserves Instances-tab exclusions and removes internal fields from the API request.
  • Adds test coverage and a patch changeset.

Review finding: Exclusion origin is inferred from numeric IDs, so an Instances-tab exclusion can be misclassified when the same ID appears in the Packages-tab mapping. This may resolve and apply the exclusion incorrectly across instances.

File Description
src/​features/​upgrades/​components/​Upgrades/​Upgrades.tsx Stores package ID-to-name mappings and prepares exclusions for submission.
src/​features/​upgrades/​components/​Upgrades/​Upgrades.test.tsx Tests Packages-tab ID resolution and Instances-tab passthrough behavior.
src/​features/​upgrades/​components/​Upgrades/​helpers.ts Converts mapped package IDs into package-name exclusions.
src/​features/​upgrades/​components/​tabPanels/​packages/​PackagesPanel/​PackagesPanel.tsx Reports loaded package data to the parent form.
src/​features/​packages/​hooks/​usePackages.ts Resolves package names to installed IDs and builds the final upgrade request.
.changeset/​upgrades-exclude-installed-packages.md Records the patch release change.

Review effort: Lite

Comment thread src/features/upgrades/components/Upgrades/helpers.ts

@ethanashaw ethanashaw 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.

LGTM

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.

🟢 Approval recommended

No unresolved blocking issues were identified, and the reviewed changes include coverage for both exclusion paths.

No open issues 🎉

1 resolved since last review

Review effort: Lite

Copilot AI lite review requested due to automatic review settings October 22, 2026 14:39

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.

🟢 Approval recommended

The implementation and covered behavior are reviewed; the remaining pagination test request is a non-blocking nit.

No open issues 🎉

Review effort: Lite

@marqode
marqode added this pull request to the merge queue Oct 22, 2026
Merged via the queue into main with commit fcb74eb Oct 22, 2026
12 checks passed
@marqode
marqode deleted the fix/exclude-packages-from-upgrades branch October 22, 2026 15:57

@yurii-vasyliev yurii-vasyliev 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.

LGTM.

This branch was previously deployed

1 inactive deployment
dev — 6e670d4d Deployed Oct 22, 2026 by marqode via Vitest #2301
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.

4 participants