You are viewing a plain text version of this content. The canonical link for it is here.
Posted to custos@airavata.apache.org by "yasithdev (via GitHub)" <gi...@apache.org> on 2026/10/12 20:18:02 UTC

[PR] strict-type the web portal against the Go models [airavata-custos]

yasithdev opened a new pull request, #630:
URL: https://github.com/apache/airavata-custos/pull/630

   - The portal's API types came from swagger annotations alone, so fields the Go structs always send were optional, several annotations disagreed with the handlers, and the code filled the gaps with 226 `as` casts and hand-written shapes.
   - Repro: `pnpm typecheck` passes on master while responses are cast, not checked; a Go `null` list or a 204 reply throws at runtime.
   
   This PR:
   - generates types and zod from the specs with field presence taken from the Go structs (`scripts/go-presence.mts`) and spec corrections checked against the handlers (`scripts/spec-supplement.mts`); adds the Analytics client;
   - parses every API response with its generated schema and types request bodies from the generated types, replacing duplicated hand-written schemas;
   - removes every type escape (`as`, `as unknown as`, `!`, `any`, ts-ignore) from `src`, `tests` and `scripts`, and turns on `exactOptionalPropertyTypes`, `noImplicitOverride`, `noPropertyAccessFromIndexSignature`, and biome `noNonNullAssertion` / `useImportType` as errors;
   - type-forced changes only: a project member update returns nothing (master answers 204), the member "Virtual" badge is gone (never sent), nullable Go lists become `[]`, fixtures gain the fields the Go structs require.
   
   tsc, biome lint, vitest (520) and next build pass. The 11 Playwright failures and the biome format failures in untouched files are the same on master.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: custos-unsubscribe@airavata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] strict-type the web portal against the generated API [airavata-custos]

Posted by "lahirujayathilake (via GitHub)" <gi...@apache.org>.
lahirujayathilake merged PR #630:
URL: https://github.com/apache/airavata-custos/pull/630


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: custos-unsubscribe@airavata.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org