Skip to content

feature(workflow): added Kmeshctl doc syncing workflow#1498

Merged
kmesh-bot merged 3 commits intokmesh-net:mainfrom
yashisrani:kmeshctl-syncing-tool
Sep 15, 2025
Merged

feature(workflow): added Kmeshctl doc syncing workflow#1498
kmesh-bot merged 3 commits intokmesh-net:mainfrom
yashisrani:kmeshctl-syncing-tool

Conversation

@yashisrani
Copy link
Contributor

What type of PR is this?

/kind enhancement
/kind documentation
/kind feature

What this PR does / why we need it:

  • This PR updates the Sync kmeshctl Docs to Website GitHub Actions workflow to improve the synchronization of documentation between the kmesh-net/kmesh and kmesh-net/website repositories.
  • It ensures that the website/docs/kmeshctl directory is created if missing and populated with all files from kmesh/docs/ctl. Additionally, it enhances the workflow to detect and sync new changes (content modifications, added files, and deleted files) using rsync with checksum comparison, addressing previous issues where changes were not recognized.
  • This is necessary to maintain consistent and up-to-date documentation across repositories.
  • Workflow will create PR for any changes.
  • Emojis are used for better readability and visual scanning of logs

Which issue(s) this PR fixes:
Fixes #1412

Setup Instructions:
Step 1: Create a Fine-Grained Personal Access Token (PAT)

Go to: [GitHub Settings → Tokens (Fine-grained)](https://github.com/settings/tokens)
Click "Generate new token"
Configure:
    Name: kmesh-to-website-sync
    Repository access: Select kmesh-net/website
    Permissions:
        Contents → Read and write
        Pull Request → Read and write
Copy the token (you can't see it again)

Step 2: Add Secret to kmesh Repository

Go to: https://github.com/kmesh-net/kmesh/settings/secrets/actions
Click "New repository secret"
    Name: WEBSITE_PAT
    Value: Paste your PAT

Special notes for your reviewer:

  • Please verify that the WEBSITE_PAT secret is correctly configured in the kmesh-net/kmesh repository with write access to kmesh-net/website.
  • Note that the workflow uses absolute paths (/github/workspace/) and a git reset --hard step to ensure the Git index reflects rsynced changes; this may overwrite local uncommitted changes in the website repo during execution.

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: GitHub Action <action@github.com>
@gemini-code-assist
Copy link

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@kmesh-bot kmesh-bot added the kind/enhancement New feature or request label Sep 4, 2025
@kmesh-bot
Copy link
Collaborator

@yashisrani: The label(s) kind/documentation cannot be applied, because the repository doesn't have them.

Details

In response to this:

What type of PR is this?

/kind enhancement
/kind documentation
/kind feature

What this PR does / why we need it:

  • This PR updates the Sync kmeshctl Docs to Website GitHub Actions workflow to improve the synchronization of documentation between the kmesh-net/kmesh and kmesh-net/website repositories.
  • It ensures that the website/docs/kmeshctl directory is created if missing and populated with all files from kmesh/docs/ctl. Additionally, it enhances the workflow to detect and sync new changes (content modifications, added files, and deleted files) using rsync with checksum comparison, addressing previous issues where changes were not recognized.
  • This is necessary to maintain consistent and up-to-date documentation across repositories.
  • Workflow will create PR for any changes.
  • Emojis are used for better readability and visual scanning of logs

Which issue(s) this PR fixes:
Fixes #1412

Setup Instructions:
Step 1: Create a Fine-Grained Personal Access Token (PAT)

Go to: GitHub Settings → Tokens (Fine-grained)
Click "Generate new token"
Configure:
Name: kmesh-to-website-sync
Repository access: Select kmesh-net/website
Permissions:
Contents → Read and write
Pull Request → Read and write
Copy the token (you can't see it again)

Step 2: Add Secret to kmesh Repository

Go to: https://github.com/kmesh-net/kmesh/settings/secrets/actions
Click "New repository secret"
Name: WEBSITE_PAT
Value: Paste your PAT

Special notes for your reviewer:

  • Please verify that the WEBSITE_PAT secret is correctly configured in the kmesh-net/kmesh repository with write access to kmesh-net/website.
  • Note that the workflow uses absolute paths (/github/workspace/) and a git reset --hard step to ensure the Git index reflects rsynced changes; this may overwrite local uncommitted changes in the website repo during execution.

Does this PR introduce a user-facing change?:

NONE

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@codecov
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.26%. Comparing base (bf64ca4) to head (6fd6a3a).
⚠️ Report is 35 commits behind head on main.
see 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7193230...6fd6a3a. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

BTW, can you show how it works in your own repo

- name: 🤝 Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.WEBSITE_PAT }}
Copy link
Member

Choose a reason for hiding this comment

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

we donot need to use a non exist token

Copy link
Contributor Author

@yashisrani yashisrani Sep 5, 2025

Choose a reason for hiding this comment

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

here, we use ${{ secrets.GITHUB_TOKEN }}, but The GITHUB_TOKEN is limited to the repository’s scope, with restricted permissions, no organization-level access, and limitations in forks, often requiring a custom PAT for broader or cross-repository actions.

we want to create a PR for website repo, then we want to use PAT, and if we want to create PR for this same repo (kmesh), then we can use GITHUB_TOKEN

Copy link
Member

Choose a reason for hiding this comment

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

I can create the WEBSITE_PAT with the @kmesh-bot token, but first let me check if there exists one

Copy link
Member

Choose a reason for hiding this comment

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

please use secrets.GH_PAT, then we can have a try

# Use timestamp for a guaranteed unique branch name
branch-suffix: timestamp
base: main
title: "docs: sync latest kmeshctl documentation"
Copy link
Member

Choose a reason for hiding this comment

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

add the PR number that triggered it

Copy link
Contributor Author

@yashisrani yashisrani Sep 5, 2025

Choose a reason for hiding this comment

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

The workflow uses a push trigger, so ${{ github.event.number }} isn’t available (only for pull_request). I can add the commit SHA (${{ github.sha }}) for traceability or switch to a pull_request trigger. It successfully syncs kmesh/docs/ctl to kmesh-net/website.

Copy link
Member

Choose a reason for hiding this comment

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

OK, i think github.sha looks good, we need a unique id to trace

@yashisrani
Copy link
Contributor Author

yashisrani commented Sep 5, 2025

BTW, can you show how it works in your own repo

i shared private repo pr links one week ago on slack channel, you approved as well.

this workflow will first check on website, that kmeshctl folder available or not, if not then it will copy ctl folder from kmesh and create a pr for kmesh-website.

if kmeshctl folder is availble in website, then it will see the kmeshctl doc content changes, if changes are detected then it will create a pr for new changes in website.

@yashisrani yashisrani changed the title feature(workflow): added Kmeshctl doc sycing workflow feature(workflow): added Kmeshctl doc syncing workflow Sep 5, 2025
base: main
title: "docs: sync latest kmeshctl documentation"
body: |
This PR syncs the latest changes from [kmesh/docs/ctl](https://github.com/yashisrani/kmesh/tree/main/docs/ctl).
Copy link
Member

Choose a reason for hiding this comment

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

Please update

Signed-off-by: GitHub Action <action@github.com>
Signed-off-by: GitHub Action <action@github.com>
@hzxuzhonghu
Copy link
Member

/lgtm
/approve

@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmesh-bot kmesh-bot merged commit fa9c947 into kmesh-net:main Sep 15, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OSPP 2025] Kmesh website automation capacity building and documentation optimization

4 participants