Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generation issues with respect to template category #1318

Conversation

brdandu
Copy link
Collaborator

@brdandu brdandu commented May 6, 2024

  • Add more device type information in selectAllEndpointTypes query such as category and package id
  • Update user_endpoints query to consider categories such that templates are only generated for their corresponding queries
  • Update helpers to use selectAllEndpointTypes instead of exportEndpointTypes to only include endpoints based on the correct category. If category is not specified then generate for everything.
  • Fix ensureTemplatePackageId to also check for this.global.genTemplatePackageId

@brdandu brdandu requested review from tecimovic and paulr34 May 6, 2024 18:57
Copy link
Collaborator

@tecimovic tecimovic left a comment

Choose a reason for hiding this comment

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

There are few comments in the code that should be addressed, but if someone is being blocked, feel free to merge and then address later.

@@ -206,6 +206,8 @@ async function ensureZclPackageIds(context) {
async function ensureTemplatePackageId(context) {
if ('templatePackageId' in context.global) {
return context.global.templatePackageId
} else if ('genTemplatePackageId' in context.global) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm confused by this. Why are we returning one or the other?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am not seeing templatePackageId under context.global. My guess is this somehow got changed to genTemplatePackageId somewhere down the line. So I thought keep templatePackageId for backwards compatibility just in case and capture the missing genTemplatePackageId here.

- Add more device type information in selectAllEndpointTypes query such as category and package id
- Update user_endpoints query to consider categories such that templates are only generated for their corresponding queries
- Update helpers to use selectAllEndpointTypes instead of exportEndpointTypes to only include endpoints based on the correct category. If category is not specified then generate for everything.
- Fix ensureTemplatePackageId to also check for this.global.genTemplatePackageId
@brdandu brdandu force-pushed the bug/fixCategoryBasedGenerationForHelpers branch from b51567e to c58b163 Compare May 6, 2024 19:55
@brdandu brdandu merged commit ed628b8 into project-chip:master May 6, 2024
13 checks passed
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.

None yet

3 participants