Fix sync-content workflow for apache/pulsar gradle build#1148
Open
lhotari wants to merge 4 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mvn install. Maintenance branches still use Maven and reuse the same Python entry points at release time.pulsar_buildhelper 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:exportClasspathon a fresh gradle checkout.swagger_generatorthrough the detector so the same scripts work on master (gradle) and on maintenance branches (maven, behavior unchanged).swagger_generatorskips with a warning on gradle since apache/pulsar master has no swagger task yet; themvn -Pswaggerpath is preserved for maven.site_uploader.execute()'shead_shaoptional.site-updater.pyhad stopped passing it after the.publish-refchange, which left the sync workflow latently broken;head_sha=Nonenow skips the.publish-refwrite that is only meaningful forasf-site-next..github/actions/sync-content/action.ymlto usegradle/actions/setup-gradle@v5and./gradlew assemble exportClasspathinstead ofmvn install.PULSARBOT_TOKENfrom.github/workflows/ci-sync-content.ymland grant the defaultGITHUB_TOKENcontents: writeso the scheduled workflow can push tomain.Test plan
CI - Synchronize Contentviaworkflow_dispatchand confirm the gradle build + doc generators complete, that swagger generation skips with the expected warning, and that the resulting commit pushes tomainusing the defaultGITHUB_TOKEN.bin/reference-doc-generator.py --master-path=<maintenance-branch-checkout>locally against a maven branch and confirm behavior is unchanged (classpath read fromtarget/,mvn -Pswaggerfallback intact forrest-apidoc-generator.py).pulsar_build.ensure_built()produces the gradle classpath/jars and the reference + CLI docs generate.