NASA-AMMOS / aerie

A software framework for modeling spacecraft.
https://nasa-ammos.github.io/aerie-docs/
MIT License
65 stars 17 forks source link

Expansion/Sequencing EDSL Dictionary Fails Typescript Linter/Transpiler #621

Open biqua opened 1 year ago

biqua commented 1 year ago

Related to Aerie QS ticket https://jira.jpl.nasa.gov/browse/AERIEQS-395, which has been marked as resolved. However, as of 1.0.2, this bug is not fixed. The following is mostly c/p'd from the QS ticket.


Affected Version: Observed in 0.13.2, 1.0.0, 1.0.2, last known working in 0.12.3

Behavior: TS7053 violation in downloaded command Typescript on lines which index accum[key] where key implicitly has type any (around lines 465~495) 

To Reproduce:

Upload Clipper R10.0.0.0 AMPCS Command Dictionary to an Aerie 1.0.2 instance (likely applies to any command dictionary, as far as I can tell)
Download EDSL Typescript via GraphQL `getCommandTypeScript` Hasura action
Run expansion logic using Node with strict Typescript enabled

Solution:

In function commandsWithTimeValue return statement, replace (accum, key) with (accum: any, key), or add @ts-ignore flags to the problematic lines.

To clarify, the use case is for local unit tests with mocked activity instances for Clipper's command expansion. These unit tests rely on the downloaded command Typescript file.

First reported by Carter Mak, reproduced by me (Emily Winner) and Carter since then, including in the newest 1.0.2 patch release after the Aerie QS ticket was marked as resolved.

cartermak commented 1 year ago

I'm bumping that this is still an issue and recent additions to the EDSL preface are causing an additional type error where the optional fields on arg are referenced without a typeguard.

cartermak commented 6 days ago

Documenting here where I'm still seeing issues -- I'm no TS/Node wizard, so this could be a discrepancy of configuration on our end vs. the sequencing server?

In any case, I see that all of these lambdas contain arguments which get "implicit any type` errors:

https://github.com/NASA-AMMOS/aerie/blob/d6fecb1701871e190054dcb44e6deffc2cc9449d/sequencing-server/src/lib/codegen/CommandEDSLPreface.ts#L590 https://github.com/NASA-AMMOS/aerie/blob/d6fecb1701871e190054dcb44e6deffc2cc9449d/sequencing-server/src/lib/codegen/CommandEDSLPreface.ts#L603 https://github.com/NASA-AMMOS/aerie/blob/d6fecb1701871e190054dcb44e6deffc2cc9449d/sequencing-server/src/lib/codegen/CommandEDSLPreface.ts#L3364 https://github.com/NASA-AMMOS/aerie/blob/d6fecb1701871e190054dcb44e6deffc2cc9449d/sequencing-server/src/lib/codegen/CommandEDSLPreface.ts#L3582