Skip to content

Add support for errata to introduce extra commands, attributes, and ...#47

Merged
AryaHassanli merged 7 commits intomainfrom
errata-support-extra-commands-attributes-features
Mar 3, 2026
Merged

Add support for errata to introduce extra commands, attributes, and ...#47
AryaHassanli merged 7 commits intomainfrom
errata-support-extra-commands-attributes-features

Conversation

@AryaHassanli
Copy link
Copy Markdown
Contributor

To close the gap between spec and SDK, errata needs to support the following modifications:

  1. Append Commands
  2. Append Attributes
  3. Append Feature Bits

This PR aims at adding the above features to errata.

Spec PR adding the support: https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/12734

@AryaHassanli AryaHassanli requested a review from a team as a code owner February 26, 2026 22:37
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the errata mechanism by enabling the dynamic addition of commands, attributes, and feature bits to the SDK definitions. This change bridges the gap between specification and SDK by allowing errata to introduce new elements that were previously only supported for modification or override. The update involves extending core data structures and implementing new processing logic to parse and apply these additional elements, ensuring better alignment and flexibility in SDK generation.

Highlights

  • Errata SDKType Extension: Extended the SDKType structure in errata/sdk.go to include new fields for ExtraFields, Code, Direction, Attributes, and Commands, enabling more comprehensive errata definitions.
  • Bitmap Interface Update: Modified the matter.Bit interface to include a SetParent method and updated matter.Bitmap.AddBit to use this interface, improving flexibility for bitmap bit management.
  • Dynamic Bitmap Bit Addition: Implemented logic in sdk/bitmap.go to dynamically add new bitmap bits and features based on ExtraFields defined in errata, allowing for the introduction of new feature bits.
  • Dynamic Attribute and Command Addition: Introduced new functions addExtraAttributes and addExtraCommands in zap/errata.go to process and append additional attributes and commands to clusters based on errata definitions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • errata/sdk.go
    • Added ExtraFields, Code, Direction, Attributes, and Commands fields to the SDKType struct.
  • matter/bitmap.go
    • Changed AddBit method to accept a Bit interface instead of *BitmapBit.
    • Added SetParent method to the Bit interface.
  • sdk/bitmap.go
    • Imported conformance package.
    • Refactored bitmap override logic into a new applyBitmapOverride function.
    • Implemented support for adding ExtraFields as new bitmap bits or features.
  • sdk/cluster.go
    • Updated applyErrataToCluster to use the new applyBitmapOverride function for feature processing.
  • zap/errata.go
    • Imported conformance and spec packages.
    • Added addExtraAttributes function to append new attributes to clusters based on errata.
    • Added addExtraCommands function to append new commands to clusters based on errata.
    • Integrated calls to addExtraAttributes and addExtraCommands within addExtraTypesForCluster.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for errata to introduce extra commands, attributes, and feature bits, which helps align the SDK with the specification. The changes involve extending the SDKType struct and implementing logic to apply these new errata types. My review focuses on improving performance and robustness in the new logic for applying these errata. I've suggested optimizing loops by using maps for faster lookups and adding more robust error handling for parsing errata files.

- Support arg in extra commands
- Support apiMaturity for commands and attributes
- Fix conformance rendering for extra entities
@AryaHassanli
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds significant new capabilities to the errata system, allowing for the addition of commands, attributes, and feature bits to close gaps with the specification. The changes are well-structured, with good refactoring that improves code clarity and reuse, particularly in sdk/bitmap.go and sdk/cluster.go. However, I've identified a critical bug in sdk/extra.go where Default values from errata will incorrectly overwrite Fallback values. I've also noted a medium-severity issue where invalid access control strings in errata would fail to parse silently. I've provided detailed comments and suggestions to address these points.

@AryaHassanli AryaHassanli merged commit 3629322 into main Mar 3, 2026
3 checks passed
@AryaHassanli AryaHassanli deleted the errata-support-extra-commands-attributes-features branch March 18, 2026 18:10
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