TypeScript: CodeQL seems to hang after 44s and stops after 6h
Description of the issue
CodeQL was generally working great for @project-chip/matter.js, but now with adding much more auto-generated code (and yes getting a bit fancy on TypeScript edges) the processing hangs at after 44s ... and then stops after 6h
See: https://github.com/project-chip/matter.js/actions/runs/8195839329/job/22414867564?pr=715
Hi @Apollon77 👋
Thanks for reporting this. I can reproduce your problem locally. It seems that both in your workflow and locally, extraction gets stuck on packages/matter.js/src/node/ServerNode.ts and I can confirm that commenting out the contents of that file allows extraction to succeed again. Concretely, the problem seems to be with the following two definitions:
static async create<
This extends typeof ServerNode<any>,
T extends ServerNode.RootEndpoint = ServerNode.RootEndpoint,
>(this: This, type?: T, options?: Node.Options<T>): Promise<ServerNode<T>>;
static async create<
This extends typeof ServerNode<any>,
T extends ServerNode.RootEndpoint = ServerNode.RootEndpoint,
>(this: This, config: Partial<Node.Configuration<T>>): Promise<ServerNode<T>>;
If either one of these is commented out, then we can also analyse the file successfully. I will pass this on to our JavaScript team. In the meantime, the above might allow you to make some temporary adjustments to your code to allow CodeQL to successfully analyse your project.
You could also use a custom CodeQL configuration file to filter out the path of this file.
Thank you for reacting that fast, thats awesome. We will do the temporary exclusion I think
PS: seems that /home/runner/work/matter.js/matter.js/packages/matter.js/test/behavior/definitions/descriptor/DescriptorServerTest.ts also has comparable issue because it now hangs there when I exclude the above file. I have now excluded all test files as well (which makes sense anyway), but maybe something your JS guys want to look into for the reason
@mbg is there any news on this issue? We restructured our project and now interestingly we are faced with several more places where CodeQL just hangs :-( (basically likely still that one class .. but now also many places where the class is used)
https://github.com/project-chip/matter.js/pull/1189/files#diff-12783128521e452af0cfac94b99b8d250413c516ec71fe6d97dbea666ff7ba27R40
Hi @Apollon77, sorry about that. I have let the JS team know that this is still an issue.