Skip to content

CI test add token - #17260

Closed
myf-bee wants to merge 3 commits into
infiniflow:mainfrom
myf-bee:fix-ci-lefthook
Closed

myf-bee wants to merge 3 commits into
infiniflow:mainfrom
myf-bee:fix-ci-lefthook

Conversation

@myf-bee

@myf-bee myf-bee commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

CI test add token

@myf-bee myf-bee added the ci Continue Integration label Jul 22, 2026
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The nightly Infinity and Elasticsearch builds now pass GITEE_TOKEN to Docker through BuildKit secrets. With NEED_MIRROR=1, the Dockerfile uses the token for authenticated Gitee resource cloning and otherwise falls back to anonymous cloning.

Changes

Authenticated nightly builds

Layer / File(s) Summary
Nightly build secret wiring
.github/workflows/sep-tests.yml, .github/workflows/tests.yml
Infinity and Elasticsearch build steps create temporary token files, pass them as Docker BuildKit secrets, use the mirrored build path where applicable, and remove the files afterward.
Authenticated mirrored resource clone
Dockerfile
The NEED_MIRROR=1 resource download mounts gitee_token and uses authenticated Gitee cloning when a token is present.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: yuzhichang, wangq8, 6ba3i

Poem

I’m a rabbit with a token to share,
BuildKit carries it with care.
Gitee resources hop inside,
Mirrored builds run side by side.
CI cleans the trail behind—
A tidy burrow, neatly signed.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description only repeats the title and lacks the required purpose/background context from the template. Expand the Summary with what problem this solves and any relevant background so reviewers understand why the CI token change is needed.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and reflects the CI token-handling changes in the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/sep-tests.yml:
- Around line 346-351: Remove all raw GITEE_TOKEN value logging and duplicate
debug lines at .github/workflows/sep-tests.yml:346-351 and
.github/workflows/sep-tests.yml:930-935; retain only non-sensitive diagnostics
such as token length if still needed, and ensure no command prints the token
itself.

In @.github/workflows/tests.yml:
- Around line 226-229: Ensure the temporary Gitee token file is removed even
when Docker builds fail by installing an EXIT cleanup trap immediately after
each mktemp assignment. Apply this change at .github/workflows/tests.yml lines
226-229 and 674-677, and .github/workflows/sep-tests.yml lines 352-360 and
936-944; retain the existing explicit cleanup where present.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 25dd9181-0e9b-4ae9-993a-9e57f5c78767

📥 Commits

Reviewing files that changed from the base of the PR and between 28b6926 and d192013.

📒 Files selected for processing (3)
  • .github/workflows/sep-tests.yml
  • .github/workflows/tests.yml
  • Dockerfile

Comment on lines +346 to +351
echo "DEBUG gitee token length: ${#GITEE_TOKEN}"
echo "DEBUG gitee token value: ${GITEE_TOKEN}"
echo "DEBUG gitee token length: ${#GITEE_TOKEN}"
echo "DEBUG gitee token value: ${GITEE_TOKEN}"
echo "DEBUG gitee token length: ${#GITEE_TOKEN}"
echo "DEBUG gitee token value: ${GITEE_TOKEN}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Remove raw token logging. These commands send the Gitee PAT to CI logs; log redaction is not a security boundary. Remove the value and duplicate debug lines.

  • .github/workflows/sep-tests.yml#L346-L351: remove the GITEE_TOKEN value logs.
  • .github/workflows/sep-tests.yml#L930-L935: remove the GITEE_TOKEN value logs.
📍 Affects 1 file
  • .github/workflows/sep-tests.yml#L346-L351 (this comment)
  • .github/workflows/sep-tests.yml#L930-L935
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/sep-tests.yml around lines 346 - 351, Remove all raw
GITEE_TOKEN value logging and duplicate debug lines at
.github/workflows/sep-tests.yml:346-351 and
.github/workflows/sep-tests.yml:930-935; retain only non-sensitive diagnostics
such as token length if still needed, and ensure no command prints the token
itself.

Comment on lines +226 to +229
_gitee_secret=$(mktemp)
printf '%s' "${GITEE_TOKEN}" > "${_gitee_secret}"
sudo DOCKER_BUILDKIT=1 docker build --secret id=gitee_token,src="${_gitee_secret}" --build-arg NEED_MIRROR=1 --build-arg HTTPS_PROXY=${HTTPS_PROXY} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile -t ${RAGFLOW_IMAGE} .
rm -f "${_gitee_secret}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Clean up the token file on build failure. A failing docker build triggers set -e before rm -f, leaving the PAT on the self-hosted runner. Install an EXIT trap immediately after mktemp.

  • .github/workflows/tests.yml#L226-L229: add an EXIT cleanup trap for _gitee_secret.
  • .github/workflows/tests.yml#L674-L677: add the same cleanup trap.
  • .github/workflows/sep-tests.yml#L352-L360: add the same cleanup trap.
  • .github/workflows/sep-tests.yml#L936-L944: add the same cleanup trap.
📍 Affects 2 files
  • .github/workflows/tests.yml#L226-L229 (this comment)
  • .github/workflows/tests.yml#L674-L677
  • .github/workflows/sep-tests.yml#L352-L360
  • .github/workflows/sep-tests.yml#L936-L944
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/tests.yml around lines 226 - 229, Ensure the temporary
Gitee token file is removed even when Docker builds fail by installing an EXIT
cleanup trap immediately after each mktemp assignment. Apply this change at
.github/workflows/tests.yml lines 226-229 and 674-677, and
.github/workflows/sep-tests.yml lines 352-360 and 936-944; retain the existing
explicit cleanup where present.

This was referenced Jul 23, 2026
@myf-bee myf-bee closed this Jul 23, 2026
@myf-bee
myf-bee deleted the fix-ci-lefthook branch August 5, 2026 05:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant