Skip to content

Regenerate the codebase using swagger 2026-05-07#320

Merged
carlosmmatos merged 2 commits into
CrowdStrike:mainfrom
alhumaw:dev
May 8, 2026
Merged

Regenerate the codebase using swagger 2026-05-07#320
carlosmmatos merged 2 commits into
CrowdStrike:mainfrom
alhumaw:dev

Conversation

@alhumaw

@alhumaw alhumaw commented May 7, 2026

Copy link
Copy Markdown
Contributor

New API Services

  • CloudSecurityRisks
  • FederatedConnections
  • KnowledgeBaseAuditEvents, KnowledgeBaseFiles, KnowledgeBases
  • NetworkScanGlobalConfigs, NetworkScanNetworks, NetworkScanScanners, NetworkScanScanRunReports, NetworkScanScanRuns, NetworkScanScans, NetworkScanTemplates, NetworkScanZones
  • ServerlessExports

Tooling

  • Automate client.ts generation in rebuild.sh via scripts/generate_client.py

@carlosmmatos

Copy link
Copy Markdown
Contributor

Hey @alhumaw — good to see the client.ts automation finally landing. That TODO has been there for a minute and we already have a live sync bug on main where ServerlessExportsApi is in apis/index.ts but missing from client.ts. So yeah, this is overdue.

Few things before merging:

  • scripts/print_apis_for_client.py still exists and does the same job via copy-paste. Delete it here or someone will use the wrong one.

  • str.removesuffix() requires Python 3.9+. The check in rebuild.sh just tests that python3 exists, so anyone on 3.8 gets a cryptic AttributeError. Either gate the version or just use api[:-3] like the old script did — same result, works everywhere.

  • The shared // @generated:end marker worries me a bit. All three sections close with the same tag, so a stray duplicate silently eats content. Paired markers like // @generated:imports:start / // @generated:imports:end would remove that ambiguity.

  • There's no error handling in the script. Missing markers produce silent garbage, missing file produces a raw traceback mid-build. Worth adding: count the markers, assert they balance, print "Updated client.ts: N APIs" so there's visible confirmation in the output.

On the PR scope - I get why the tooling and regen are bundled (markers need to exist for the script to work), but 20k lines of generated code makes the interesting part invisible — GitHub can't even render this diff. If you could split it (tooling + markers first on the existing API list, then regen as a follow-up). Not blocking on this though, just a preference.

Minor note...since Node is already a hard requirement for this repo, a 30-line .mjs script would avoid adding Python as a build dependency. Not a dealbreaker.

Let me know what you think

@alhumaw

alhumaw commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Fantastic feedback @carlosmmatos. Made the changes, here's a summary:

print_apis_for_client.py: deleted.

Shared end marker: updated to paired unique markers (// @generated:imports:end, etc.) in both the script and client.ts.

Error handling: script now exits with a clear message if any marker is missing, and prints Updated client.ts: N APIs on success.

On splitting the PR: Agreed. Will handle future PRs differently if not blocking.

.mjs: Makes sense to me. Converted generate_client.py to generate_client.mjs.

@carlosmmatos carlosmmatos merged commit e9d6dd0 into CrowdStrike:main May 8, 2026
3 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.

2 participants