pnp / pnp/cli-microsoft365

Bug: superseding rules works incorrectly

Open
#2,593 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted keep-open
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

Discussed in https://github.com/pnp/cli-microsoft365/discussions/2590

When upgrading SPFx project from 1.11 to 1.12, CLI won't suggest removing rush-stack-compiler 3.3. While the rule is there, it's superseded by installing rush-stack-compiler 3.7. The problem is, that currently superseding doesn't take into account the difference between installing and uninstalling the package. We need to think about how to handle it as currently superseding is handled centrally outside the rule.

One way could be to replace the array of superseded rule IDs with a method that takes a rule as an argument. That way, the rule could examine other rule's properties and return a bool true or false depending if the rule should be superseded or not.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with discussion 2590, then trace the central superseding logic outside the individual rules. Determine how install and uninstall rules should be distinguished, and consider the existing rule metadata before defining the behavior. Done means the SPFx 1.11-to-1.12 upgrade correctly handles both superseded package actions.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.