Skip to content

Group repeated App Doctor findings without losing occurrences - #8561

Open
jplhomer wants to merge 2 commits into
mainfrom
joshlarson/app-doctor-group-findings
Open

jplhomer wants to merge 2 commits into
mainfrom
joshlarson/app-doctor-group-findings

Conversation

@jplhomer

@jplhomer jplhomer commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

WHY are these changes introduced?

Repeated App Doctor findings can overwhelm the terminal report and bury unrelated, actionable issues. Collapsing the underlying records would instead lose the file/line evidence agents need and the occurrences used to compare runs.

WHAT is this pull request doing?

Group only the human-readable report by rule, optional pattern, and severity, showing occurrence/file counts and up to three sample paths. --verbose expands every occurrence. JSON, traces, scoring, and check counts still keep one record per finding.

No public changeset: App Doctor remains a hidden early-access command.

How to manually test your changes?

pnpm shopify app doctor --path /path/to/app --skip-instructions
pnpm shopify app doctor --path /path/to/app --skip-instructions --verbose
pnpm shopify app doctor --path /path/to/app --json
pnpm shopify app doctor --path /path/to/app --findings /path/to/app/.shopify/app-doctor/findings.json

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

@github-actions github-actions Bot added the no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users. label Sep 15, 2026
@jplhomer

Copy link
Copy Markdown
Contributor Author

/snapit

@github-actions

Copy link
Copy Markdown
Contributor

🫰✨ Thanks @jplhomer! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260916180830

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

Collapse the terminal report by rule, optional pattern, and severity.
JSON, traces, scoring, and check counts still keep every occurrence.

Co-authored-by: AI (Pi/Grok 4.6) <noreply@pi.dev>
@jplhomer
jplhomer force-pushed the joshlarson/app-doctor-group-findings branch from 9132dea to e633fc3 Compare September 17, 2026 18:02
@jplhomer

Copy link
Copy Markdown
Contributor Author

/snapit

Co-authored-by: AI (Pi/Grok 4.6) <noreply@pi.dev>
@jplhomer

Copy link
Copy Markdown
Contributor Author

/snapit

@jplhomer
jplhomer marked this pull request as ready for review September 18, 2026 13:46
@jplhomer
jplhomer requested a review from a team as a code owner September 18, 2026 13:46
Copilot AI lite review requested due to automatic review settings September 18, 2026 13:46

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

Remove found_by from presentation grouping and use efficient per-group file tracking to avoid incorrect grouping and quadratic behavior.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR groups repeated App Doctor findings in human-readable reports while preserving full occurrence data for verbose and machine-readable outputs.

Changes:

  • Groups findings by rule, pattern, and severity.
  • Adds occurrence/file counts and sample paths.
  • Adds pattern metadata for secret and Liquid findings.
  • Adds coverage for grouping and output behavior.
File summaries
File Description
packages/app/src/cli/services/doctor-output.ts Renders grouped and verbose reports.
packages/app/src/cli/services/doctor-output.test.ts Tests report grouping and formatting.
packages/app/src/cli/services/app-doctor-engine/types.ts Adds optional pattern identifiers.
packages/app/src/cli/services/app-doctor-engine/tests/secret-safety.test.ts Verifies secret pattern metadata.
packages/app/src/cli/services/app-doctor-engine/rules/secret-rules.ts Assigns secret finding patterns.
packages/app/src/cli/services/app-doctor-engine/rules/liquid-rules.ts Assigns Liquid finding patterns.
packages/app/src/cli/services/app-doctor-engine/output/group-issues.ts Implements presentation grouping.
packages/app/src/cli/services/app-doctor-engine/output/group-issues.test.ts Tests grouping semantics and immutability.
packages/app/src/cli/services/app-doctor-engine/index.ts Exports grouping functionality.
Review details

Suppressed comments (1)

packages/app/src/cli/services/app-doctor-engine/output/group-issues.ts:32

  • For a repeated rule with N distinct files, group.files.includes(...) scans the accumulated file list for every occurrence, making grouping O(N²). This is especially costly for the large finding sets this change is intended to collapse; track per-group files with a Set/Map while grouping and materialize the array for the report.
      if (!group.files.includes(issue.location.file)) group.files.push(issue.location.file)
  • Files reviewed: 9/9 changed files
  • Comments generated: 1
  • Review effort level: Lite

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

@jplhomer
jplhomer requested a review from dmerand September 18, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog This PR doesn't include a changeset entry. Is an internal only change not relevant to end users.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants