Skip to content

Conversation

@josepmariapujol-unity
Copy link
Collaborator

Description

Please fill this section with a description what the pull request is trying to address and what changes were made.

Testing status & QA

Please describe the testing already done by you and what testing you request/recommend QA to execute. If you used or created any testing project please link them here too for QA.

Overall Product Risks

Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.

  • Complexity:
  • Halo Effect:

Comments to reviewers

Please describe any additional information such as what to focus on, or historical info for the reviewers.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@josepmariapujol-unity josepmariapujol-unity marked this pull request as ready for review January 7, 2026 15:41
@josepmariapujol-unity josepmariapujol-unity marked this pull request as draft January 7, 2026 15:41
@josepmariapujol-unity josepmariapujol-unity self-assigned this Jan 7, 2026
@u-pr-agent
Copy link
Contributor

u-pr-agent bot commented Jan 7, 2026

PR Reviewer Guide 🔍

(Review updated until commit 54ee663)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪

Small, mechanical rename across a few call sites, but it touches a public attribute API and needs compatibility verification.
🏅 Score: 84

The change is straightforward and consistent, but the API rename may break downstream code unless compatibility/migration and tests are addressed.
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

API Break

Renaming the attribute property from commonUsages to usages can break consumers compiling against the old property; consider keeping a deprecated alias or provide a clear migration path and ensure any reflection-based usage is updated.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "According to MSDN, this message can be ignored for attribute parameters, as there are no better alternatives.")]
public string[] usages { get; set; }

public string variants { get; set; }
Behavior Check

Validate that layoutAttribute.usages is always equivalent to the former commonUsages in terms of defaults/null-handling and that layout generation correctly populates m_CommonUsages in all expected scenarios.

if (layoutAttribute?.usages != null)
    layout.m_CommonUsages =
        ArrayHelpers.Select(layoutAttribute.usages, x => new InternedString(x));
Coverage

Ensure all [InputControlLayout(...)] usages across the package have been updated (including any non-XR devices and documentation/examples) so there are no remaining references to the removed property.

[InputControlLayout(usages = new[] { "LeftHand", "RightHand" }, isGenericTypeOfDevice = true, displayName = "XR Controller")]
public class XRController : TrackedDevice
  • Update review

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr-agent

@u-pr-agent
Copy link
Contributor

u-pr-agent bot commented Jan 7, 2026

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Preserve attribute argument compatibility

Renaming commonUsages to usages is a breaking change for any existing code using the
old attribute named argument and will fail compilation for consumers. Keep backwards
compatibility by restoring commonUsages and forwarding it to usages (or vice versa),
and optionally mark the old name as obsolete. This ensures both old and new call
sites keep working.

Packages/com.unity.inputsystem/InputSystem/Controls/InputControlLayoutAttribute.cs [52-54]

 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays", Justification = "According to MSDN, this message can be ignored for attribute parameters, as there are no better alternatives.")]
 public string[] usages { get; set; }
 
+[Obsolete("Use 'usages' instead.")]
+public string[] commonUsages
+{
+    get => usages;
+    set => usages = value;
+}
+
Suggestion importance[1-10]: 8

__

Why: Renaming the attribute named-argument property from commonUsages to usages will break any existing consumers using commonUsages = ... at compile time. Adding an [Obsolete] alias property that forwards to usages preserves backwards compatibility with minimal risk.

Medium
  • More suggestions

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr-agent

@codecov-github-com
Copy link

codecov-github-com bot commented Jan 7, 2026

Codecov Report

All modified and coverable lines are covered by tests ✅

@@           Coverage Diff            @@
##           develop    #2313   +/-   ##
========================================
  Coverage    77.95%   77.95%           
========================================
  Files          476      477    +1     
  Lines        97443    97460   +17     
========================================
+ Hits         75961    75977   +16     
- Misses       21482    21483    +1     
Files with missing lines Coverage Δ
Assets/Tests/InputSystem/CoreTests_Layouts.cs 91.39% <ø> (ø)
...tsystem/InputSystem/Controls/InputControlLayout.cs 88.32% <100.00%> (ø)
...nputSystem/Controls/InputControlLayoutAttribute.cs 84.61% <100.00%> (ø)
...tsystem/InputSystem/Plugins/XR/Devices/GoogleVR.cs 0.00% <ø> (ø)
...putsystem/InputSystem/Plugins/XR/Devices/Oculus.cs 0.00% <ø> (ø)
...putsystem/InputSystem/Plugins/XR/Devices/OpenVR.cs 0.00% <ø> (ø)
...system/InputSystem/Plugins/XR/Devices/WindowsMR.cs 0.00% <ø> (ø)
...utsystem/InputSystem/Plugins/XR/GenericXRDevice.cs 87.87% <ø> (ø)

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@josepmariapujol-unity josepmariapujol-unity changed the title Update InputControlLayoutAttribute.cs CHANGE: Rename commonUsages to usages Jan 8, 2026
@josepmariapujol-unity josepmariapujol-unity marked this pull request as ready for review January 8, 2026 17:26
@u-pr-agent
Copy link
Contributor

u-pr-agent bot commented Jan 8, 2026

Persistent review updated to latest commit 54ee663

@u-pr-agent
Copy link
Contributor

u-pr-agent bot commented Jan 8, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

@josepmariapujol-unity josepmariapujol-unity marked this pull request as draft January 9, 2026 09:08
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