Skip to content

CHANGE: Add CI job to check Editor references in Runtime code#2413

Open
jfreire-unity wants to merge 7 commits intodevelopfrom
add-check-runtime-editor-refs-gha-workflow
Open

CHANGE: Add CI job to check Editor references in Runtime code#2413
jfreire-unity wants to merge 7 commits intodevelopfrom
add-check-runtime-editor-refs-gha-workflow

Conversation

@jfreire-unity
Copy link
Copy Markdown
Collaborator

@jfreire-unity jfreire-unity commented May 4, 2026

Description

Following #2321 we lack the way to validate that new code added to Runtime folder doesn't contain Editor references. This is because we don't have the code in 2 separate assemblies. There might be a better way of achieving this by creating a proper test or somekind of C# code analyzer.
But at this stage, having something is better than nothing.

A text based search using grep seems fast enough, and the script can potentially be added to run in a commit hook.

It runs and fails like this:

image

Logs:

image

Testing status & QA

PS: ⚠️ It's currently macOS only but can potentially be converted to a PowerShell script for Windows as well

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: 0
  • Halo Effect: 0

Comments to reviewers

The script was built with LLM help so let me know if something is not clear.

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.

Copy link
Copy Markdown
Contributor

@u-pr u-pr Bot left a comment

Choose a reason for hiding this comment

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

May require changes

The PR introduces a useful check script, but there is a critical issue where the check can silently pass if ripgrep is missing or fails. Several other minor improvements regarding script robustness and comment filtering were identified.

🤖 Helpful? 👍/👎

Comment thread check-runtime-editor-refs.sh Outdated
Comment thread check-runtime-editor-refs.sh Outdated
Comment thread check-runtime-editor-refs.sh Outdated
Comment thread check-runtime-editor-refs.sh
@codecov-proxy.fjygbaifeng.eu.org
Copy link
Copy Markdown

codecov-proxy.fjygbaifeng.eu.org Bot commented May 4, 2026

Codecov Report

All modified and coverable lines are covered by tests ✅

@@             Coverage Diff             @@
##           develop    #2413      +/-   ##
===========================================
+ Coverage    78.13%   78.71%   +0.58%     
===========================================
  Files          483      755     +272     
  Lines        98770   137571   +38801     
===========================================
+ Hits         77169   108294   +31125     
- Misses       21601    29277    +7676     
Flag Coverage Δ
inputsystem_MacOS_6000.0_project 77.29% <ø> (-0.01%) ⬇️
inputsystem_MacOS_6000.5_project 77.33% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 240 files with indirect coverage changes

ℹ️ Need help interpreting these results?

@jfreire-unity
Copy link
Copy Markdown
Collaborator Author

/crc

Copy link
Copy Markdown
Contributor

@u-pr u-pr Bot left a comment

Choose a reason for hiding this comment

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

Great

The review identified opportunities to optimize workflow triggers and improve the robustness of the reference checking script by ensuring word-boundary matching.

🤖 Helpful? 👍/👎

Comment thread .github/workflows/check-runtime-editor-refs.yml Outdated
Comment thread check-runtime-editor-refs.sh Outdated
jfreire-unity and others added 2 commits May 4, 2026 14:05
Co-authored-by: u-pr[bot] <205906871+u-pr[bot]@users.noreply.github.com>
Co-authored-by: u-pr[bot] <205906871+u-pr[bot]@users.noreply.github.com>
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.

1 participant