Skip to content

Conversation

MintsInc
Copy link
Member

@MintsInc MintsInc commented Sep 16, 2025

Context

This PR implements the CI workflow modernization for the typescript client by converting all CI jobs to reusable workflows. This aligns the typescript client with the established pattern from the Go clients (see PR) and enables centralized CI management for the datadog-api-spec repository.

This work enables:

  • Complete CI reusability: The datadog-api-spec repo can now call a single reusable workflow and get the full CI pipeline (pre-commit, unit tests, examples, integration tests)
  • MergeQueue compatibility: Centralizing all CI jobs in reusable workflows is essential for enabling the MergeQueue functionality
  • Consistent local development: The local test.yml maintains the familiar individual job structure while leveraging reusable components
  • Cross-repository validation: Generated code from datadog-api-spec can be validated with the same comprehensive test suite

Changes

New Files

  • .github/workflows/reusable-ci.yml: Complete CI workflow that orchestrates all validation steps - the single entry point for external repos
  • .github/workflows/reusable-pre-commit.yml: Pre-commit checks with configurable auto-commit behavior and fork handling
  • .github/workflows/reusable-examples.yml: Example code validation workflow

Modified Files

  • .github/workflows/test.yml: Refactored to call individual reusable workflows (maintains familiar structure)
  • .github/workflows/reusable-typescript-test.yml: Stripped to contain only core testing logic, enhanced with target-branch support

Key Design Decisions

  • Dual architecture: Local repo uses individual job calls for clarity; external repos use single reusable-ci.yml for simplicity
  • Target branch control: Centralized branch checkout logic with fallbacks for cross-repo usage
  • Behavioral preservation: All original CI conditions, triggers, and logic maintained exactly
  • Modular workflows: Each workflow component has single responsibility and can be called independently
  • Status reporting: No reporting on the reusable CI as it is called by the spec PR directly

Tests

This PR maintains 100% functional equivalence with the original CI behavior:

Local Repository (test.yml)

  • Individual job visibility: Each job appears separately in PR status checks as before (pre-commit, test, examples, report)
  • Identical triggers: Same conditions for draft PRs, ci/skip labels, and scheduled runs
  • Auto-commit behavior: Pre-commit fixes are automatically committed as before
  • All original functionality: Multi-version Node.js testing (16, 18), Yarn caching maintained exactly

Reusable Workflows

  • Modular design: Core testing logic isolated in reusable-typescript-test.yml
  • Cross-repo compatibility: All workflows can be called from datadog-api-spec with proper secrets
  • Fork handling: Pre-commit workflow handles external contributors correctly
  • Branch flexibility: Supports testing arbitrary branches from external repos

After merging, this will be tested end-to-end by calling the reusable workflows from the datadog-api-spec repository to validate generated client code, ensuring full MergeQueue compatibility.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@MintsInc MintsInc changed the title Make the typescript CI in a reusable workflow Convert TypeScript testing workflow to reusable workflow Sep 16, 2025
@MintsInc MintsInc marked this pull request as ready for review September 16, 2025 14:18
@MintsInc MintsInc requested review from a team as code owners September 16, 2025 14:18
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-typescript-test-workflow-reusable branch 3 times, most recently from 1513159 to c882886 Compare September 18, 2025 09:20
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-typescript-test-workflow-reusable branch from c882886 to f09aece Compare September 19, 2025 11:15
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-typescript-test-workflow-reusable branch from f09aece to 6a83898 Compare September 19, 2025 13:17
@MintsInc MintsInc merged commit 2e6b2d7 into master Sep 19, 2025
12 checks passed
@MintsInc MintsInc deleted the ulysse.mavrocordatos/AAWF-562/make-typescript-test-workflow-reusable branch September 19, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants