Skip to content

Conversation

MintsInc
Copy link
Member

@MintsInc MintsInc commented Sep 22, 2025

Context

This PR implements the CI workflow modernization for the typescript v2 client by converting all CI jobs to reusable workflows. This aligns the typescript v2 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

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.

@MintsInc MintsInc requested review from a team as code owners September 22, 2025 15:03
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-typescriptv2-test-workflow-reusable branch 2 times, most recently from e0df231 to fe8011b Compare September 23, 2025 12:20
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-typescriptv2-test-workflow-reusable branch from fe8011b to 3b2dc20 Compare September 23, 2025 14:45
@MintsInc MintsInc merged commit 51ee991 into v2 Sep 24, 2025
9 checks passed
@MintsInc MintsInc deleted the ulysse.mavrocordatos/AAWF-562/make-typescriptv2-test-workflow-reusable branch September 24, 2025 12:37
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