Skip to content

Conversation

@MehulBatra
Copy link

Build Javadoc github action to trigger build_javadoc.sh file and added copy step in website_deploy to deploy javadoc on website.

@MehulBatra
Copy link
Author

SH script PR: apache/fluss#1724

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this TODO comment or replace it with proper documentation explaining the workflow trigger conditions.

Suggested change
# discuss with Jark
# This workflow is triggered manually via the GitHub Actions UI.

Copilot uses AI. Check for mistakes.
echo "Copying javadocs for version: $version"
git checkout "$branch"
mkdir -p "../javadoc/$version"
cp -r * "../javadoc/$version/" 2>/dev/null || true
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
cp -r * "../javadoc/$version/" 2>/dev/null || true
cp -r . "../javadoc/$version/" 2>/dev/null || true

Copilot uses AI. Check for mistakes.
fi
# Copy javadocs directly to root of javadoc branch
cp -r "../website/static/javadoc/$VERSION"/* ./ 2>/dev/null || true
Copy link

Copilot AI Sep 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
cp -r "../website/static/javadoc/$VERSION"/* ./ 2>/dev/null || true
cp -r "../website/static/javadoc/$VERSION"/. ./ 2>/dev/null || true

Copilot uses AI. Check for mistakes.
- 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 corresponding javadoc_<version> branches.
  • exit 1 if 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

2 participants