Skip to content

Conversation

MintsInc
Copy link
Member

@MintsInc MintsInc commented Sep 5, 2025

Context

This PR implements the CI workflow modernization for the java client by converting all CI jobs to reusable workflows. This aligns the java 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, javadoc, shading, 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
    • `.github/workflows/reusable-javadoc.yml`: Javadoc generation validation
    • `.github/workflows/reusable-shading.yml`: Dependency shading verification

Modified Files

  • .github/workflows/test.yml: Refactored to call individual reusable workflows (maintains familiar structure)
  • .github/workflows/reusable-java-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, javadoc, shading, 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: Javadoc generation, dependency shading, multi-version testing (Java 8, 16, 18, 19) maintained exactly

Reusable Workflows

  • Modular design: Core testing logic isolated in reusable-java-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 Java test workflow reusable Convert Java 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 added the changelog/no-changelog Changes don't appear in changelog label Sep 8, 2025
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-java-test-workflow-reusable branch from 7536ee5 to 63fd050 Compare September 16, 2025 09:34
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-java-test-workflow-reusable branch 3 times, most recently from b0d691a to 8850011 Compare September 16, 2025 14:19
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-java-test-workflow-reusable branch 3 times, most recently from 752f4ae to ce0f803 Compare September 18, 2025 08:28
@MintsInc MintsInc force-pushed the ulysse.mavrocordatos/AAWF-562/make-java-test-workflow-reusable branch from ce0f803 to 4215089 Compare September 19, 2025 11:13
@MintsInc MintsInc merged commit be2058a into master Sep 19, 2025
14 checks passed
@MintsInc MintsInc deleted the ulysse.mavrocordatos/AAWF-562/make-java-test-workflow-reusable branch September 19, 2025 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog Changes don't appear in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants