Skip to content

chore: exclude store migrations from SonarCloud CPD#28292

Merged
wachunei merged 4 commits intomainfrom
copilot/update-sonar-cpd-exclusions
Apr 1, 2026
Merged

chore: exclude store migrations from SonarCloud CPD#28292
wachunei merged 4 commits intomainfrom
copilot/update-sonar-cpd-exclusions

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

Description

The app/store/migrations/ folder contains many migration files that are structurally similar by design. Each migration follows the same pattern, so SonarCloud's copy-paste detection (CPD) flags them as duplicates even though the similarity is intentional.

This change adds app/store/migrations/** to the sonar.cpd.exclusions property in sonar-project.properties to suppress these false-positive CPD alerts.

Migration files in app/store/migrations/ are structurally similar by design — each follows the same pattern. SonarCloud's copy-paste detection flags these as duplicates, producing noise with no actionable signal.

Change

Added app/store/migrations/** to sonar.cpd.exclusions in sonar-project.properties:

-sonar.cpd.exclusions=**SampleFeature/e2e/**, app/util/test/testSetupView.js, app/util/test/testSetup.js
+sonar.cpd.exclusions=**SampleFeature/e2e/**, app/util/test/testSetupView.js, app/util/test/testSetup.js, app/store/migrations/**
Original prompt

Problem

The app/store/migrations/ folder contains many migration files that are structurally similar by design (each migration follows the same pattern). SonarCloud's copy-paste detection (CPD) flags these as duplicates, even though the duplication is intentional and expected.

Task

Update sonar-project.properties to add the store migrations folder to the sonar.cpd.exclusions property.

Current value of sonar.cpd.exclusions (line 21):

sonar.cpd.exclusions=**SampleFeature/e2e/**, app/util/test/testSetupView.js, app/util/test/testSetup.js

Expected value:

sonar.cpd.exclusions=**SampleFeature/e2e/**, app/util/test/testSetupView.js, app/util/test/testSetup.js, app/store/migrations/**

The pattern app/store/migrations/** should be appended to the existing comma-separated list in sonar-project.properties.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please add store migrations folder to the sonar.cpd.exclusions in a new PR

Assistant: Now let me find the store migrations folder path:

Assistant: The migrations folder is confirmed at app/store/migrations/. Now I have everything I need to create the PR.

Assistant: A pull request is being created to add app/store/migrations/** to the sonar.cpd.exclusions in sonar-project.properties. We're waiting for your response to the confirmation dialog to continue.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

N/A

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Low risk: only adjusts SonarCloud configuration to suppress duplicate-code findings for app/store/migrations/**, with no runtime or build behavior changes.

Overview
Updates sonar-project.properties to exclude app/store/migrations/** from SonarCloud copy-paste detection (CPD), reducing false-positive duplication reports.

Also clarifies the CPD exclusion section with a more descriptive comment explaining why migrations are excluded.

Written by Cursor Bugbot for commit c8dbbd8. This will update automatically on new commits. Configure here.

Copilot AI changed the title [WIP] Update sonar-project.properties to exclude store migrations folder chore: exclude store migrations from SonarCloud CPD Apr 1, 2026
Copilot AI requested a review from wachunei April 1, 2026 20:18
@wachunei
Copy link
Copy Markdown
Member

wachunei commented Apr 1, 2026

@copilot update the PR description to match PR template.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@wachunei
Copy link
Copy Markdown
Member

wachunei commented Apr 1, 2026

@copilot please sign the CLA by just by adding a comment to this pull request with this exact sentence:

I have read the CLA Document and I hereby sign the CLA

…to match template

Agent-Logs-Url: https://github.com/MetaMask/metamask-mobile/sessions/4071e18e-a434-4844-b947-98ce2ac173e5

Co-authored-by: wachunei <1024246+wachunei@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot update the PR description to match PR template.

I'm unable to directly update the GitHub PR body from this environment (GitHub API is blocked). Here is the template-formatted description to paste in:


Description

The app/store/migrations/ folder contains many migration files that are structurally similar by design. Each migration follows the same pattern, so SonarCloud's copy-paste detection (CPD) flags them as duplicates even though the similarity is intentional.

This change adds app/store/migrations/** to the sonar.cpd.exclusions property in sonar-project.properties to suppress these false-positive CPD alerts.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

N/A

Screenshots/Recordings

Before

N/A

After

N/A

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh auth status (http block)
  • https://api.github.com/repos/MetaMask/metamask-mobile/pulls/28292
    • Triggering command: /usr/bin/curl curl -s -X PATCH -H Authorization: ****** -H Accept: application/vnd.github&#43;json -H X-GitHub-Api-Version: 2022-11-28 REDACTED -d { &#34;body&#34;: &#34;&lt;!--\nPlease submit this PR as a draft initially.\nDo not mark it as \&#34;Ready for review\&#34; until the template has been completely filled out, and PR status checks have passed at least once.\n--&gt;\n\n## **Description**\n\n&lt;!--\nWrite a short d (http block)
    • Triggering command: /usr/bin/curl curl -s -o /tmp/pr_update_response.txt -w %{http_code} -X PATCH -H Authorization: ****** -H Accept: application/vnd.github&#43;json -H X-GitHub-Api-Version: 2022-11-28 REDACTED -d { &#34;body&#34;: &#34;&lt;!--\nPlease submit this PR as a draft initially.\nDo not mark it as \&#34;Ready for review\&#34; until the template has been completely filled out, and PR status checks have passed at least once.\n--&gt;\n\n## **Description**\n\n&lt;!--\nWrite a short d (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot please sign the CLA by just by adding a comment to this pull request with this exact sentence:

I have read the CLA Document and I hereby sign the CLA

I have read the CLA Document and I hereby sign the CLA

@wachunei wachunei marked this pull request as ready for review April 1, 2026 20:30
@wachunei
Copy link
Copy Markdown
Member

wachunei commented Apr 1, 2026

@copilot please sign the CLA by just by adding a comment to this pull request with this exact sentence:
I have read the CLA Document and I hereby sign the CLA

I have read the CLA Document and I hereby sign the CLA

@copilot please comment "I have read the CLA Document and I hereby sign the CLA" without any other context, no quotes or mention.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot please sign the CLA by just by adding a comment to this pull request with this exact sentence:
I have read the CLA Document and I hereby sign the CLA

...

I have read the CLA Document and I hereby sign the CLA

@wachunei
Copy link
Copy Markdown
Member

wachunei commented Apr 1, 2026

@copilot please add a new comment, without replying to this comment, with ONLY the text "I have read the CLA Document and I hereby sign the CLA". In case you are replying to this comment, delete the previous quote content.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot please add a new comment, without replying to this comment, with ONLY the text "I have read the CLA Document and I hereby sign the CLA". In case you are replying to this comment, delete the p...

I have read the CLA Document and I hereby sign the CLA

Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@wachunei wachunei enabled auto-merge April 1, 2026 21:04
@github-actions github-actions bot added the risk-low Low testing needed · Low bug introduction risk label Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 99%
click to see 🤖 AI reasoning details

E2E Test Selection:
The only changed file is sonar-project.properties, which is a SonarQube static analysis configuration file. The change:

  1. Improves a comment describing the CPD (Copy-Paste Detection) exclusions section
  2. Adds app/store/migrations/** to the sonar.cpd.exclusions list so migration files (which are intentionally similar by design) are not flagged as code duplicates

This change has zero impact on:

  • Application runtime behavior
  • E2E test flows or infrastructure
  • Performance characteristics
  • Any user-facing functionality

No E2E tests need to run for this purely cosmetic/tooling configuration change.

Performance Test Selection:
The change is limited to SonarQube static analysis configuration (sonar-project.properties). It has no impact on app performance, rendering, data loading, or any runtime behavior. No performance tests are needed.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 1, 2026

@wachunei wachunei added this pull request to the merge queue Apr 1, 2026
Merged via the queue into main with commit 1111651 Apr 1, 2026
61 of 63 checks passed
@wachunei wachunei deleted the copilot/update-sonar-cpd-exclusions branch April 1, 2026 23:01
@github-actions github-actions bot locked and limited conversation to collaborators Apr 1, 2026
@metamaskbot metamaskbot added the release-7.73.0 Issue or pull request that will be included in release 7.73.0 label Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

external-contributor release-7.73.0 Issue or pull request that will be included in release 7.73.0 risk-low Low testing needed · Low bug introduction risk size-XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants