Skip to content

Avoid false duplicate-code reports for required AOT attributes - #11749

Merged
Amaury Levé (Evangelink) merged 2 commits into
mainfrom
copilot/duplicate-code-fix
Oct 5, 2026
Merged

Amaury Levé (Evangelink) merged 2 commits into
mainfrom
copilot/duplicate-code-fix

Conversation

Copilot AI commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

The repeated trimming and AOT attributes are intentional: compiler and linker diagnostics require the built-in attributes directly on every public overload, so a wrapper attribute or annotated helper would change caller behavior.

  • Document why the AreEquivalent/AreNotEquivalent declarations must remain repeated.
  • Require the duplicate-code workflow to prove a refactor preserves compiler, analyzer, linker, and runtime semantics.
  • Make the workflow inspect existing consistency tests and skip declaration-site metadata that tooling requires on every member.

Validation

  • gh aw compile duplicate-code-detector --strict — passed.
  • python .github\scripts\check_action_pins.py — passed (2,556 references).
  • .\build.cmd -projects test\UnitTests\TestFramework.UnitTests\TestFramework.UnitTests.csproj -bl — passed with 0 warnings and 0 errors.
  • Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.exe --filter-uid Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests.AssertTests.StructuralEquivalenceAssertions_DeclareTrimAndAotRequirements ... — passed (1/1).

Fixes #11745

Copilot AI balanced review requested due to automatic review settings October 5, 2026 06:34

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.

Copilot wasn't able to review any files in this pull request. Check if the Files changed in this pull request are included in default exclusions.

Copilot AI changed the title [WIP] Refactor duplicated AOT attribute pairs in Assert methods Assess AOT attribute duplication in equivalence assertions Oct 5, 2026
Copilot AI requested review from Amaury Levé (Evangelink) and a balanced review from Copilot October 5, 2026 06:42
@Evangelink Amaury Levé (Evangelink) changed the title Assess AOT attribute duplication in equivalence assertions Avoid false duplicate-code reports for required AOT attributes Oct 5, 2026
@Evangelink
Amaury Levé (Evangelink) marked this pull request as ready for review October 5, 2026 11:27
@github-actions github-actions Bot added the state/needs-review Awaiting review from the team. label Oct 5, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Oct 5, 2026

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.

Copilot review overview

🟢 Approval recommended

The changes consistently address the false positive without altering runtime or public API behavior.

Review effort: Balanced
Findings: None

@microsoft-github-policy-service microsoft-github-policy-service Bot added state/needs-review Awaiting review from the team. and removed state/needs-review Awaiting review from the team. labels Oct 5, 2026
@github-actions github-actions Bot added state/approved Proposal approved; ready for implementation. and removed state/needs-review Awaiting review from the team. labels Oct 5, 2026
@Evangelink
Amaury Levé (Evangelink) merged commit 92d9aa3 into main Oct 5, 2026
21 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the copilot/duplicate-code-fix branch October 5, 2026 12:48
@github-actions github-actions Bot removed the state/approved Proposal approved; ready for implementation. label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Final test-triage resolution — Azure Pipelines build 1623348

Build completed successfully (succeeded). PR head/merge SHAs verified to match the analyzed revision (head 0c40aac5...1cb04, merge 33266e19...443f12).

Finding: The only non-passed record in the full evidence set is PackagedWinUI.PackagedWinUITestCases.RetryTestMethod_PassesOnSecondAppContainerHost on the Windows_App_Model_Diagnostics leg. The first AppContainer host attempt is recorded as failed ("The first AppContainer host fails so Retry must activate a second host"), and the second attempt (and the final aggregated TRX) recorded passed.

This is not a defect: the test is an intentional integration-test asset (test/IntegrationTests/.../PackagedWinUITests.cs) that specifically verifies the AppContainer host-retry mechanism by design — the first host is expected to fail so the retry path can be exercised and validated. The final/aggregate outcome for this test is passed.

Historical correlation: checked the last 12 completed main builds in history.json — every one shows the identical fail-then-pass-then-pass sequence for this same test, with no deviation. This confirms stable, expected behavior rather than flakiness or regression.

Confidence: High. No code/test defect, no environmental flake, no recurrence pattern indicating regression.

Conclusion: No issue created — this is expected test design, not an actionable CI failure. No further action required for this build.

🤖 Automated content by GitHub Copilot. Generated by the Pipeline Test Triage workflow. · copilot · auto · 42.5 AIC · ⌖ 5.55 AIC · ⊞ 9.6K

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.

[duplicate-code] Duplicate Code: Repeated AOT Attribute Pairs Across AreEquivalent/AreNotEquivalent Overloads

4 participants