Skip to content

Validate matrix patch compatibility as part of Java driver release workflow #145

Description

@nikagra

Problem

When a new Java driver version is released (e.g., 3.11.5.16), the matrix may not have a matching versions/scylla/3.11.5.16/ directory, or the existing patches (resolved via floor fallback to the nearest lower version) may fail to apply against the new source code.

Today this is only discovered after the tag is published and the Jenkins matrix CI runs — at which point the release is already on Maven Central and the tag is on GitHub. The releaser then has to scramble to update patches reactively.

Proposal

Add a pre-publish validation step that checks whether matrix patches apply cleanly to the about-to-be-released source, before artifacts are published to Maven Central and before the tag is pushed to GitHub.

Changes required

This repo (scylla-java-driver-matrix):

  • Add --patch-only mode to run.py / main.py that checks out the tag, applies patches, and exits — skipping build, tests, and email

Driver repo (scylladb/java-driver):

  • Add a "Validate matrix patches" step in .github/workflows/release.yml between release-prepare (creates tag locally) and release-perform (publishes to Maven Central)
  • Add matrix-branch workflow input (default: master) so releasers can validate with a non-merged matrix branch if patches need updating

Release flow with this change

1. mvn release:prepare          → creates tag locally (e.g., 3.11.5.16)
2. Validate matrix patches      → clone matrix repo, run --patch-only
   ├── patches apply cleanly    → continue to step 3
   └── patches FAIL             → release ABORTS (nothing published, no tag pushed)
3. mvn release:perform          → publish to Maven Central
4. git push --follow-tags       → push tag to GitHub

The existing dry-run mode (dry-run: true) also executes the validation step, providing a safe way to test.

Implementation details

Matrix repo: --patch-only mode

run.py:

  • Add patch_only=False parameter to Run.__init__()
  • In run(), return None after _apply_patch_files() when patch_only=True (skip mvn install, mvn integration-test)

main.py:

  • Add --patch-only CLI argument (store_true)
  • Pass through to Run() constructor
  • Handle None return from run() (no test report to process)
  • Skip email sending in patch-only mode

~20 lines of changes total.

Driver repo: release workflow step

.github/workflows/release.yml:

  • Add matrix-branch input (type: string, default: master)
  • Add step after "Prepare release" and before "Perform release":
    1. Extract tag from release.properties (scm.tag=X.Y.Z.W)
    2. Clone this matrix repo at the specified branch
    3. pip install PyYAML packaging jinja2
    4. Run python3 main.py . --versions {tag} --driver-type scylla --patch-only
    5. Fail the workflow if patches don't apply

~25 lines of changes total.

Why only --driver-type scylla

The release is for scylladb/java-driver (the Scylla fork). DataStax patches (versions/datastax/) target datastax/java-driver which is a different repository. Only scylla driver type patches are relevant to this release workflow.

Non-goals

  • Running integration tests (remains Jenkins' responsibility; if patches apply, running staging matrix jobs costs little additional effort)
  • Branch-based testing without tags (separate future work)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions