chore: update workflow for 🚧 stage#32
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Walkthrough在 GitHub Actions 工作流中新增顶层作业 Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant GH as GitHub Actions
participant Struct as Job: struct
participant PD as Job: pd
participant Store as Job: store
participant HStore as Job: hstore
participant Maven as Maven Repo(s)
GH->>Struct: 启动 struct (JDK11, cache, checkout, stage settings)
Struct->>Struct: 解析并设置 REVISION
alt 有 hugegraph-struct/pom.xml
Struct->>Maven: 本地构建并安装 hugegraph-struct
else 无 pom.xml
Struct->>Maven: mvn dependency:get hugegraph-struct:${REVISION}
end
Struct->>GH: 导出 REVISION 到环境
GH->>PD: 在 struct 完成后启动 (needs)
GH->>Store: 在 struct 完成后启动 (needs, USE_STAGE=true)
GH->>HStore: 在 struct 完成后启动 (needs, USE_STAGE=true, checkout@v3 depth=2)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches🧪 Generate unit tests
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. Comment |
|
@codecov-ai-reviewer review |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@codecov-ai-reviewer review |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/pd-store-ci.yml (2)
85-89: cp 可能因原始 settings.xml 不存在而失败,需容错在 pd/store/hstore 中,cp 未加容错,与 struct 的“|| true”不一致;在全新 runner 上会直接失败。
- cp $HOME/.m2/settings.xml /tmp/settings.xml + cp $HOME/.m2/settings.xml /tmp/settings.xml || trueAlso applies to: 149-154, 222-227
116-120: 升级 Codecov Action 至 v4 并使用正确参数建议将 Codecov 上传步骤改为:
- uses: codecov/[email protected] - with: - file: ${{ env.REPORT_DIR }}/*.xml + uses: codecov/codecov-action@v4 + with: + files: ${{ env.REPORT_DIR }}/*.xml + fail_ci_if_error: true请确认已在仓库中设置好上传认证:要么提供
CODECOV_TOKEN(或在with中使用use_oidc: true并在 workflow/permissions 中开启id-token: write),以满足 v4 的认证要求。
也请对 188–192 行和 258–262 行同步更新。
🧹 Nitpick comments (3)
.github/workflows/pd-store-ci.yml (3)
217-221: 统一 checkout fetch-depth,避免覆盖率与基线差异计算异常部分覆盖率/变更基线工具需要完整历史。建议在 PR 上将 fetch-depth 设为 0(或至少保证包含 merge-base)。
- with: - fetch-depth: 2 + with: + fetch-depth: 0
228-236: 可读性/稳定性小优化:Maven 批处理与显式日志参数建议对所有 mvn 命令添加 -B(batch-mode),并在打包/测试中统一使用 -ntp,减少日志噪音、避免交互提示。
- mvn clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true -ntp + mvn -B -ntp clean package -U -Dmaven.javadoc.skip=true -Dmaven.test.skip=true同理于各处 mvn test 命令可加 -B -ntp。
Also applies to: 100-107, 159-163
248-251: 确认 hstore 的 Raft 测试条件是否符合预期BACKEND 固定为 hstore,条件 if: ${{ env.BACKEND == 'rocksdb' }} 始终为假,Raft 测试永远跳过。若这是预期行为请忽略;若需要 hstore 也覆盖 Raft 测试,请调整条件或 BACKEND。
Also applies to: 200-201
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/pd-store-ci.yml(3 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/pd-store-ci.yml
19-19: the runner of "actions/setup-java@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
25-25: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
| - name: Resolve project revision | ||
| run: echo "REVISION=$(mvn -q -DforceStdout help:evaluate -Dexpression=revision -f pom.xml)" >> $GITHUB_ENV | ||
|
|
There was a problem hiding this comment.
🛠️ Refactor suggestion
提升 REVISION 解析与回退健壮性,防止取到空值或字面占位符
mvn 解析 revision 失败时常返回空或字面“${revision}”。建议加入对 project.version 的回退与占位符检测,失败即退出。
- - name: Resolve project revision
- run: echo "REVISION=$(mvn -q -DforceStdout help:evaluate -Dexpression=revision -f pom.xml)" >> $GITHUB_ENV
+ - name: Resolve project revision
+ run: |
+ REVISION="$(mvn -q -DforceStdout help:evaluate -Dexpression=revision -f pom.xml || true)"
+ if [ -z "$REVISION" ] || [[ "$REVISION" == *'$'{*}* ]]; then
+ REVISION="$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version -f pom.xml)"
+ fi
+ if [ -z "$REVISION" ] || [[ "$REVISION" == *'$'{*}* ]]; then
+ echo "[ERROR] failed to resolve project revision"; exit 1
+ fi
+ echo "REVISION=$REVISION" >> "$GITHUB_ENV"
@@
- mvn -U -ntp dependency:get -Dartifact=org.apache.hugegraph:hugegraph-struct:$REVISION
+ mvn -U -ntp dependency:get -Dartifact=org.apache.hugegraph:hugegraph-struct:$REVISION -Dtransitive=falseAlso applies to: 44-53
🤖 Prompt for AI Agents
.github/workflows/pd-store-ci.yml around lines 41-43 (also apply same change to
44-53): the current step captures REVISION from mvn help:evaluate but can yield
empty string or the literal placeholder "${revision}"; update the step to detect
empty or placeholder values, attempt a fallback evaluation using
project.version, and if both evaluations are empty or placeholders exit
non-zero; implement checks that treat values matching /^\s*$/ or /^\$\{.*\}$/ as
invalid, log clear error messages when fallbacks fail, and ensure the job fails
immediately on unresolved revision.
|
@codecov-ai-reviewer review |
This comment has been minimized.
This comment has been minimized.
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (6)
.github/workflows/pd-store-ci.yml (6)
217-221: hstore 作业 checkout 仍为 @V3,统一到 @v4与其它作业保持一致,减少行为差异。
- - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v4 with: fetch-depth: 2
36-40: struct 作业的“stage settings”建议受 USE_STAGE 控制,保持语义一致当前 USE_STAGE='true' 行为正确,但为一致性与可配置性,建议加 if 条件。
- - name: Use staged maven repo settings - run: | + - name: Use staged maven repo settings + if: ${{ env.USE_STAGE == 'true' }} + run: | cp $HOME/.m2/settings.xml /tmp/settings.xml || true mv -vf .github/configs/settings.xml $HOME/.m2/settings.xml
18-23: 升级 setup-java 到 v4 并改用 Temurin,修复 actionlint 报错与兼容性问题按 actionlint 提示,v3 过旧。建议同步到 v4,distribution 使用 temurin。
- - name: Install JDK 11 - uses: actions/setup-java@v3 + - name: Install JDK 11 + uses: actions/setup-java@v4 with: java-version: '11' - distribution: 'zulu' + distribution: 'temurin'Also applies to: 66-71, 131-136, 204-209
24-29: actions/cache 升级到 v4;仅缓存仓库目录保持不变已很好地仅缓存 ~/.m2/repository,继续保持;同时将 v3 → v4 以避免运行时问题。
- - name: Cache Maven packages - uses: actions/cache@v3 + - name: Cache Maven packages + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2Also applies to: 72-78, 137-143, 210-216
41-43: 增强 REVISION 解析的鲁棒性(占位符/空值回退到 project.version)避免拿到空或字面
${revision}导致后续 dependency:get 失败。- - name: Resolve project revision - run: echo "REVISION=$(mvn -q -DforceStdout help:evaluate -Dexpression=revision -f pom.xml)" >> $GITHUB_ENV + - name: Resolve project revision + run: | + REVISION="$(mvn -q -DforceStdout help:evaluate -Dexpression=revision -f pom.xml || true)" + if [ -z "$REVISION" ] || [[ "$REVISION" == *'$'{*}* ]]; then + REVISION="$(mvn -q -DforceStdout help:evaluate -Dexpression=project.version -f pom.xml || true)" + fi + if [ -z "$REVISION" ] || [[ "$REVISION" == *'$'{*}* ]]; then + echo "[ERROR] failed to resolve project revision"; exit 1 + fi + echo "REVISION=$REVISION" >> "$GITHUB_ENV"
44-53: 获取/构建 hugegraph-struct:加严格错误处理并避免传递下载为减少不必要的传递依赖拉取,建议加
-Dtransitive=false;并使用严格 shell 选项快速失败。- - name: Build or fetch hugegraph-struct - run: | + - name: Build or fetch hugegraph-struct + run: | + set -euo pipefail if [ -f hugegraph-struct/pom.xml ]; then echo "[INFO] Found hugegraph-struct source, building from source" mvn -U -ntp -DskipTests -pl hugegraph-struct -am install else echo "[INFO] hugegraph-struct source not found, fetching artifact $REVISION" if [ -z "$REVISION" ]; then echo "[ERROR] revision not resolved"; exit 1; fi - mvn -U -ntp dependency:get -Dartifact=org.apache.hugegraph:hugegraph-struct:$REVISION + mvn -U -ntp dependency:get -Dartifact=org.apache.hugegraph:hugegraph-struct:$REVISION -Dtransitive=false fi
🧹 Nitpick comments (2)
.github/workflows/pd-store-ci.yml (2)
116-119: 考虑将 Codecov Action 升级到 v4(注意需要 Token)v4 带来更好的安全模型,但通常需要
CODECOV_TOKEN。若组织允许,建议升级;否则保持 v3 亦可。- - name: Upload coverage to Codecov - uses: codecov/[email protected] + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 with: file: ${{ env.REPORT_DIR }}/*.xml + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}Also applies to: 188-191, 258-261
24-29: 确认跨作业 Maven 缓存可命中(同一 key)struct 首个生成缓存,后续作业应命中相同 key。建议在步骤上加 id 并检查 cache-hit,便于后续诊断。
- - name: Cache Maven packages - uses: actions/cache@v4 + - name: Cache Maven packages + id: m2cache + uses: actions/cache@v4 with: path: ~/.m2/repository key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ runner.os }}-m2 + - name: Debug cache hit + run: echo "m2 cache hit? ${{ steps.m2cache.outputs.cache-hit }}"Also applies to: 72-78, 137-143, 210-216
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
.github/workflows/pd-store-ci.yml(6 hunks)
🧰 Additional context used
🪛 actionlint (1.7.7)
.github/workflows/pd-store-ci.yml
19-19: the runner of "actions/setup-java@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
25-25: the runner of "actions/cache@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Analyze (java)
- GitHub Check: build-server (hbase, 11)
- GitHub Check: struct
🔇 Additional comments (1)
.github/workflows/pd-store-ci.yml (1)
125-126: 启用 store/hstore 的阶段仓库设置与 struct 对齐该改动与目标一致,有助于构建一致性。
Also applies to: 197-198
* update: update workflow * fix: update workflow * update: change USE_STAGE param & add maven package param * update: add todo tag * Update check-dependencies.yml --------- Co-authored-by: imbajin <[email protected]>
* update: update workflow * fix: update workflow * update: change USE_STAGE param & add maven package param * update: add todo tag * Update check-dependencies.yml --------- Co-authored-by: imbajin <[email protected]>
* update: update workflow * fix: update workflow * update: change USE_STAGE param & add maven package param * update: add todo tag * Update check-dependencies.yml --------- Co-authored-by: imbajin <[email protected]>
* update: update workflow * fix: update workflow * update: change USE_STAGE param & add maven package param * update: add todo tag * Update check-dependencies.yml --------- Co-authored-by: imbajin <[email protected]>
Purpose of the PR
update workflow, build struct module before store & pd
Main Changes
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No NeedSummary by CodeRabbit