Conversation
|
SH script PR: apache/fluss#1724 |
There was a problem hiding this comment.
Pull Request Overview
This PR implements a CI/CD pipeline for building and deploying Javadoc documentation. It adds automated Javadoc generation from source branches and integrates the generated documentation into the website deployment process.
- Added a new GitHub Actions workflow to build Javadocs from multiple branches
- Extended the website deployment workflow to copy Javadocs from dedicated branches
- Implemented branch-specific Javadoc generation with version filtering
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| .github/workflows/build_javadoc.yml | New workflow that builds Javadocs from source branches and pushes them to dedicated javadoc branches |
| .github/workflows/website-deploy.yaml | Added step to copy Javadocs from javadoc branches into the website build |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| on: | ||
| workflow_dispatch: | ||
| # discuss with Jark |
There was a problem hiding this comment.
Remove this TODO comment or replace it with proper documentation explaining the workflow trigger conditions.
| # discuss with Jark | |
| # This workflow is triggered manually via the GitHub Actions UI. |
| echo "Copying javadocs for version: $version" | ||
| git checkout "$branch" | ||
| mkdir -p "../javadoc/$version" | ||
| cp -r * "../javadoc/$version/" 2>/dev/null || true |
There was a problem hiding this comment.
Using cp -r * can be unreliable with hidden files and may cause issues if the directory is empty. Consider using cp -r . "../javadoc/$version/" or check if the directory has contents before copying.
| cp -r * "../javadoc/$version/" 2>/dev/null || true | |
| cp -r . "../javadoc/$version/" 2>/dev/null || true |
| fi | ||
|
|
||
| # Copy javadocs directly to root of javadoc branch | ||
| cp -r "../website/static/javadoc/$VERSION"/* ./ 2>/dev/null || true |
There was a problem hiding this comment.
Using cp -r */ can be unreliable with hidden files and may fail if the directory is empty. Consider using cp -r "../website/static/javadoc/$VERSION/." ./ or add a check for directory contents before copying.
| cp -r "../website/static/javadoc/$VERSION"/* ./ 2>/dev/null || true | |
| cp -r "../website/static/javadoc/$VERSION"/. ./ 2>/dev/null || true |
| - name: Build javadocs for specific branches | ||
| run: | | ||
| # Get branches to process (exclude release-0.7 and earlier) | ||
| BRANCHES=$(git branch -r | grep -E "(origin/main|origin/release-[0-9]+\.[0-9]+)$" | sed 's|origin/||' | grep -v -E "release-0\.[0-7]$" | sort) |
There was a problem hiding this comment.
Can we move the shell script into .sh file for better maintenance?
I think maybe we can create 2 script files, the first is check_javadoc_branches.sh, the second is push_javadoc_branches.sh.
check_javadoc_branches.sh: checks what branches need to build, if no branches to build, then skip the second step.push_javadoc_branches.sh: accept branches to build as parameters, and build javadocs & push the changes to the correspondingjavadoc_<version>branches.exit 1if there is any errors
This makes the action results more visible for skipped branches and errors.
|
|
||
| - name: Build javadocs for specific branches | ||
| run: | | ||
| # Get branches to process (exclude release-0.7 and earlier) |
There was a problem hiding this comment.
should checkout apache/fluss first?
| git add . | ||
| if ! git diff --staged --quiet; then | ||
| git commit -m "Update javadocs for $VERSION" | ||
| git push origin "$JAVADOC_BRANCH" |
There was a problem hiding this comment.
I think we can make it simple to just force push the branch without checking changes. This can avoid some potential bugs or performance issues as the javadocs change is huge.
Build Javadoc github action to trigger build_javadoc.sh file and added copy step in website_deploy to deploy javadoc on website.