Skip to content

Conversation

@MintsInc
Copy link
Member

@MintsInc MintsInc commented Sep 5, 2025

Context

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

Reusable Workflows

  • Modular design: Core testing logic isolated in reusable-ruby-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 changed the title AAWF-562: Make Ruby test workflow reusable Convert Ruby testing workflow to reusable workflow Sep 5, 2025
@MintsInc MintsInc marked this pull request as ready for review September 5, 2025 14:50
@MintsInc MintsInc requested review from a team as code owners September 5, 2025 14:50
jack-edmonds-dd
jack-edmonds-dd previously approved these changes Sep 8, 2025
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-ruby-test-workflow-reusable branch from 30b04f0 to 1e5e958 Compare September 16, 2025 09:59
Copy link
Member Author

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

@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-ruby-test-workflow-reusable branch 2 times, most recently from 643f806 to 7c936e8 Compare September 16, 2025 14:18
@MintsInc MintsInc dismissed jack-edmonds-dd’s stale review September 16, 2025 14:20

Big changes since review

@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-ruby-test-workflow-reusable branch 4 times, most recently from 3e07dbd to e9001f9 Compare September 18, 2025 09:20
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-ruby-test-workflow-reusable branch from e9001f9 to e10575f Compare September 19, 2025 11:13
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-ruby-test-workflow-reusable branch from e10575f to 7918fd7 Compare September 19, 2025 13:02
@MintsInc MintsInc merged commit f5656e8 into master Sep 19, 2025
15 checks passed
@MintsInc MintsInc deleted the ulysse.mavrocordatos/AAWF-562/make-ruby-test-workflow-reusable branch September 19, 2025 13:08
github-actions bot pushed a commit that referenced this pull request Sep 19, 2025
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.

4 participants