Skip to content

Fix sync-content workflow for apache/pulsar gradle build#1148

Open
lhotari wants to merge 4 commits into
mainfrom
lh-fix-sync-content
Open

Fix sync-content workflow for apache/pulsar gradle build#1148
lhotari wants to merge 4 commits into
mainfrom
lh-fix-sync-content

Conversation

@lhotari
Copy link
Copy Markdown
Member

@lhotari lhotari commented May 18, 2026

Summary

  • apache/pulsar master switched to a Gradle build, breaking the sync-content composite action which still ran mvn install. Maintenance branches still use Maven and reuse the same Python entry points at release time.
  • Add a pulsar_build helper that detects gradle vs maven from the pulsar checkout layout, exposes build-system-specific classpath / swagger paths, and runs ./gradlew assemble :distribution:pulsar-server-distribution:exportClasspath :distribution:pulsar-shell-distribution:exportClasspath on a fresh gradle checkout.
  • Route all five reference/CLI doc generators and swagger_generator through the detector so the same scripts work on master (gradle) and on maintenance branches (maven, behavior unchanged). swagger_generator skips with a warning on gradle since apache/pulsar master has no swagger task yet; the mvn -Pswagger path is preserved for maven.
  • Make site_uploader.execute()'s head_sha optional. site-updater.py had stopped passing it after the .publish-ref change, which left the sync workflow latently broken; head_sha=None now skips the .publish-ref write that is only meaningful for asf-site-next.
  • Rewrite .github/actions/sync-content/action.yml to use gradle/actions/setup-gradle@v5 and ./gradlew assemble exportClasspath instead of mvn install.
  • Drop PULSARBOT_TOKEN from .github/workflows/ci-sync-content.yml and grant the default GITHUB_TOKEN contents: write so the scheduled workflow can push to main.

Test plan

  • Trigger CI - Synchronize Content via workflow_dispatch and confirm the gradle build + doc generators complete, that swagger generation skips with the expected warning, and that the resulting commit pushes to main using the default GITHUB_TOKEN.
  • Run bin/reference-doc-generator.py --master-path=<maintenance-branch-checkout> locally against a maven branch and confirm behavior is unchanged (classpath read from target/, mvn -Pswagger fallback intact for rest-apidoc-generator.py).
  • Run the same generators against an apache/pulsar master checkout and confirm pulsar_build.ensure_built() produces the gradle classpath/jars and the reference + CLI docs generate.

lhotari added 4 commits May 18, 2026 10:32
apache/pulsar master switched to a Gradle build, so the previous Maven
install in the sync-content composite action no longer produces the jars,
classpath, and bin scripts that the docs generators need. Maintenance
branches still ship Maven, and the same Python entry points are reused
for release-time doc generation there.

- Add a pulsar_build helper that detects gradle vs maven from the
  pulsar checkout layout, exposes the build-system-specific classpath
  and swagger output dirs, and runs gradle assemble +
  :distribution:pulsar-{server,shell}-distribution:exportClasspath when
  the artifacts are missing on a gradle checkout.
- Route all five reference/CLI doc generators and swagger_generator
  through the detector so the same scripts work on master (gradle) and
  maintenance branches (maven, unchanged).
- swagger_generator skips with a warning on gradle since apache/pulsar
  master has no swagger task yet; the maven mvn -Pswagger fallback is
  preserved for maintenance branches.
- Make site_uploader.execute()'s head_sha optional. site-updater.py
  never passed it after the .publish-ref change, which left the sync
  workflow latently broken; head_sha=None now skips the .publish-ref
  marker that is only meaningful for the asf-site-next branch.
- Rewrite .github/actions/sync-content/action.yml to use
  gradle/actions/setup-gradle and ./gradlew assemble exportClasspath
  in place of the old mvn install step.
- Drop PULSARBOT_TOKEN from .github/workflows/ci-sync-content.yml and
  grant the default GITHUB_TOKEN contents:write so the workflow can
  push to main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant