Skip to content

fix(menu): remove the dead Reports menu item by its link alone (#2136) - #2139

Merged
renemadsen merged 1 commit into
stablefrom
fix/2136-dead-reports-link-any-e2eid
Oct 7, 2026
Merged

renemadsen merged 1 commit into
stablefrom
fix/2136-dead-reports-link-any-e2eid

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Summary

Follow-up to #2137. The dead "Reports" menu item (/plugins/items-planning-pn/reports) can exist with a different E2E id (e.g. advanced) and no menu template, because an earlier menu save re-created it. #2137 only removed rows matching both Link and E2EId, so this shape survived.

DeadReportsMenuCleaner now matches:

  • menu items on the dead link alone (exact, also tolerating a trailing slash), whatever their E2E id and with or without a template;
  • menu templates on the dead DefaultLink alone (a superset of the previous DefaultLink + E2EId match).

Translations and security groups/permissions are removed as before; items still pointing at a removed template are detached; a second start changes nothing; removed ids are logged.

Note: a menu item a user created by hand with exactly this link is removed too — intentionally, since no route answers that link.

Tests

DeadReportsMenuCleanupTests.PluginStart_RemovesTheDeadLink_WhateverItsE2EIdAndWithoutATemplate: the "E2E id advanced, no template" shape, a trailing-slash variant, a template on the dead link with another E2E id — all removed with their child rows; a user item at /plugins/items-planning-pn/reports-archive (E2E id advanced) stays untouched; second start is a no-op.

Not verified locally

Tests run in CI only; locally dotnet build of the test project succeeded.

Refs #2136

🤖 Generated with Claude Code

The dead "Reports" item can carry another E2E id and no template after a
menu save re-created it, so the Link + E2EId match from the first fix left
it behind. Menu items and templates are now matched on the dead link alone
(with or without a trailing slash); child rows go with them, items hanging
on a removed template are detached, and a second start is a no-op.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 7, 2026 09:47

Copilot AI left a comment

Copy link
Copy Markdown

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

The broadened permission cleanup and template detachment paths lack coverage for alternate E2E IDs.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Broadens startup cleanup of the obsolete Reports menu route.

Changes:

  • Matches dead items/templates by link, including a trailing slash.
  • Adds integration coverage for alternate E2E IDs and link lookalikes.
File Description
DeadReportsMenuCleaner.cs Broadens dead-link cleanup criteria.
DeadReportsMenuCleanupTests.cs Tests expanded cleanup behavior.

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

Comment on lines +214 to +218
var renamedTemplate = new MenuTemplate
{
Name = "Reports",
E2EId = "example-reports-template",
DefaultLink = DeadReportsMenuCleaner.Link,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Considered, not acted on: this is a coverage suggestion, not a correctness defect. The permission-removal and detachment queries use the same link-only predicate as the item/template queries this test does pin down, and both relationships are already exercised end-to-end (with permission and detached item) by PluginStart_RemovesTheDeadReportsEntry_AndASecondStartIsANoOp.

@renemadsen
renemadsen merged commit a6508be into stable Oct 7, 2026
8 of 9 checks passed
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