Skip to content

[SL-ONLY] MATTER-6651: Validate APIs in CI (#1087) (#1127) - #1169

Open
Michael Duggan (miduggan24) wants to merge 1 commit into
release_2.10-1.6.1from
validate_api_2.10
Open

[SL-ONLY] MATTER-6651: Validate APIs in CI (#1087) (#1127)#1169
Michael Duggan (miduggan24) wants to merge 1 commit into
release_2.10-1.6.1from
validate_api_2.10

Conversation

@miduggan24

Copy link
Copy Markdown
Contributor

Summary

cherry-pick of #1087
note that workflow is currently disabled as all app refactor changes need to be in otherwise CI will fail

Add CI validation for CRTP APIs so API contract changes require explicit manifest update in the same PR.

Add the following files:

  • silabs-crtp-apis.yaml
    • manifest file holding each apps public APIs and signatures
    • used to map against AppTaskImpl.h APIs in validate_crtp_apis.py
    • generated using --bootstrap arg on first setup
    • CI will fail if this is not updated along with API updates
  • silabs-validate-apis.yaml
    • CI workflow to run API validation check
    • calls validate_crtp_apis.py
    • runs on PRs that touch *Impl.h
  • validate_crtp_apis.py
    • script to compare AppTaskImpl.h (and ClosureManager) APIs against manifest file
    • parses public methods from AppTaskImpl.h (and ClosureManagerImpl.h)
    • compares these against methods in the manifest file
    • fails on missing, extra, or mismatch API signature

Related issues

MATTER-6651

Testing

locally test script against:

  • adding new api that is not in manifest
  • deleting api that exists in manifest
  • changing method signature compared to manifest

temporary testing of each of the above in CI as well
https://github.com/SiliconLabsSoftware/matter_sdk/actions/runs/29934630457/job/88972898365

* [SL-ONLY] MATTER-6651: Validate APIs in CI (#1087)

* initial commit api validation

* add testign in ci

* produce some ci failures

* Revert "add testign in ci"

This reverts commit dd3f8f5.

* Revert "produce some ci failures"

This reverts commit b6d5b66.

* update versions

* Fix three preprocessing and error message bugs in validate_crtp_apis.py

- Fix ifdef/ifndef directive parsing by handling them before generic #if
- Fix error message to correctly indicate missing APIs are from header not manifest
- Strip comments before processing preprocessor directives to avoid false matches

Applied via @cursor push command

* fix yr

* remove crtp refs

* add doxygen brief

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@miduggan24
Michael Duggan (miduggan24) requested a review from a team as a code owner August 26, 2026 14:34
@cursor

cursor Bot commented Aug 26, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Adds CI and manifest tooling only; no runtime or firmware behavior changes. Risk is mainly process friction if headers and manifest drift until related refactors land.

Overview
Adds CI enforcement so changes to Silabs example override headers must stay in sync with a checked-in API manifest.

Introduces .github/silabs-apis.yaml as the baseline of public methods (names and signatures) for each app’s AppTaskImpl.h, plus ClosureManagerImpl.h for closure-app, including optional ifdef metadata for conditionally compiled APIs. The new scripts/tools/silabs/validate_apis.py parses those headers and fails on missing, extra, or signature-mismatched APIs; --bootstrap regenerates the manifest from current headers.

A Validate Silabs APIs GitHub Actions workflow runs on PRs to main / release_* when *Impl.h, the manifest, or the validator script changes, installing PyYAML and running the validator.

Reviewed by Cursor Bugbot for commit e3e44ad. Bugbot is set up for automated code reviews on this repo. Configure here.

@silabs-matter-ci-bot silabs-matter-ci-bot Bot added the sl-only This TAG indicates that this commit is a silabs-specific commit that cannot be upstreamed to CSA. label Aug 26, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Workflow enabled despite missing apps
    • Added 'if: false' to the validate-apis job to disable the workflow until all app refactors with AppTaskImpl.h headers are complete.

Create PR

Or push these changes by commenting:

@cursor push 294e9d7517
Preview (294e9d7517)
diff --git a/.github/workflows/silabs-validate-apis.yaml b/.github/workflows/silabs-validate-apis.yaml
--- a/.github/workflows/silabs-validate-apis.yaml
+++ b/.github/workflows/silabs-validate-apis.yaml
@@ -22,6 +22,7 @@
     validate-apis:
         name: Validate APIs
         runs-on: ubuntu-latest
+        if: false
         steps:
             - name: Checkout repository
               uses: actions/checkout@v7

You can send follow-ups to the cloud agent here.

Reviewed by Cursor Bugbot for commit e3e44ad. Configure here.

Comment thread .github/workflows/silabs-validate-apis.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sl-only This TAG indicates that this commit is a silabs-specific commit that cannot be upstreamed to CSA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants