🧪 增加VpnLogRedaction测试 - #180
01luyicheng wants to merge 2 commits into
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
PR Summary by QodoAdd unit tests for VPN log redaction helpers
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTo customize comments, go to the Qodo configuration screen, or learn more in the docs. |
Qodo FixerNo findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR. |
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
📝 WalkthroughSummary by CodeRabbit
Walkthrough本次变更更新 CI 依赖审查、Android 构建超时和 Go 工具链版本,统一六个 Go 模块的版本声明,并新增 VPN 日志 IP 与连接键脱敏测试。 ChangesCI 与模块版本及日志校验
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
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/ci.yml:
- Around line 17-26: Update the dependency-review job to declare job-level
permissions with only contents: read, and configure its actions/checkout@v4 step
with persist-credentials: false.
In `@server/shared/httpclient/go.mod`:
- Line 3: Update the Docker build images in server/api/Dockerfile,
server/socks5-proxy/Dockerfile, and server/tunnel/Dockerfile from
golang:1.22-alpine to Go 1.25 or newer, matching the module requirements. The
go.mod sites server/shared/httpclient/go.mod, server/shared/ratelimit/go.mod,
server/shared/recovery/go.mod, server/shared/stringutil/go.mod,
server/socks5-proxy/go.mod, and server/tunnel/go.mod require no direct changes;
they establish the required Go version.
🪄 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: c9e03281-9787-4718-a37d-69ef3df7096e
📒 Files selected for processing (8)
.github/workflows/ci.ymlandroid/app/src/test/java/com/netproxy/gateway/vpn/VpnLogRedactionTest.ktserver/shared/httpclient/go.modserver/shared/ratelimit/go.modserver/shared/recovery/go.modserver/shared/stringutil/go.modserver/socks5-proxy/go.modserver/tunnel/go.mod
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
- GitHub Check: Go Server Build (api)
- GitHub Check: Android Build & Test
🧰 Additional context used
📓 Path-based instructions (4)
android/app/src/test/**/*.kt
📄 CodeRabbit inference engine (CLAUDE.md)
android/app/src/test/**/*.kt: Tests are located inandroid/app/src/test/. Verify all changes with unit tests.
Unit test validation gate:make android-testmust pass.
Files:
android/app/src/test/java/com/netproxy/gateway/vpn/VpnLogRedactionTest.kt
**/*.{kt,go}
📄 CodeRabbit inference engine (CLAUDE.md)
Critical defect: connection pool cleanup race condition - connection state may change between read and write locks. See docs/ISSUES.md H5.
Files:
android/app/src/test/java/com/netproxy/gateway/vpn/VpnLogRedactionTest.kt
android/**
📄 CodeRabbit inference engine (CLAUDE.md)
Build validation gate:
make android-buildmust pass.
Files:
android/app/src/test/java/com/netproxy/gateway/vpn/VpnLogRedactionTest.kt
android/app/src/test/**
📄 CodeRabbit inference engine (CLAUDE.md)
Before starting work, verify
make android-testpasses. If main branch tests fail, address with explicit blocking issue statement.
Files:
android/app/src/test/java/com/netproxy/gateway/vpn/VpnLogRedactionTest.kt
🪛 zizmor (1.28.0)
.github/workflows/ci.yml
[warning] 21-22: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 17-26: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🔇 Additional comments (4)
android/app/src/test/java/com/netproxy/gateway/vpn/VpnLogRedactionTest.kt (1)
8-48: 📐 Maintainability & Code Quality在具备
make的环境中执行 Android 验证门禁。
Makefile定义了android-test和android-build。当前环境缺少make,无法确认门禁结果。合并前必须运行并通过这两个目标。.github/workflows/ci.yml (3)
28-31: LGTM!
140-140: LGTM!
17-26: 🎯 Functional Correctness保留当前
dependency-review触发配置。该 workflow 仅由
pull_request事件触发,且已限定目标分支和事件类型。无需额外限制该 job。> Likely an incorrect or invalid review comment.
| dependency-review: | ||
| name: Dependency Review | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
| - name: Dependency Review | ||
| uses: actions/dependency-review-action@v4 | ||
| with: | ||
| fail-on-severity: high |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- workflow structure ---'
sed -n '1,90p' .github/workflows/ci.yml
printf '%s\n' '--- permissions and dependency-review references ---'
rg -n -C 3 '^(permissions:|[[:space:]]+permissions:|contents:|pull-requests:|dependency-review|checkout@)' .github/workflows .github 2>/dev/null || true
printf '%s\n' '--- repository guidance ---'
find .. -name AGENTS.md -o -name CONTRIBUTING.md -o -name SECURITY.md | sortRepository: 01luyicheng/NetProxyGateway
Length of output: 2701
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- repository guidance ---'
cat ../git/AGENTS.md
printf '%s\n' '--- workflow metadata and all permission declarations ---'
rg -n -C 5 'permissions|dependency-review|checkout@|pull_request' .github/workflows/ci.yml .github 2>/dev/null || trueRepository: 01luyicheng/NetProxyGateway
Length of output: 10500
🌐 Web query:
GitHub Actions dependency-review-action v4 required permissions contents read checkout persist-credentials official documentation
💡 Result:
The official documentation and repository examples for the GitHub Actions dependency-review-action v4 specify that the workflow requires the following permission [1][2][3]: permissions: contents: read If you wish to enable the feature that reports the review summary as a comment on the pull request, you must add the following additional permission [1][3][4]: pull-requests: write Regarding your mention of persist-credentials, while it is not explicitly required by the dependency-review-action itself, it is a common configuration used within the actions/checkout step that precedes it [1][2][4]. Standard usage involves the following structure: - name: Checkout Repository uses: actions/checkout@v4 with: persist-credentials: false # Optional, often used for security best practices - name: Dependency Review uses: actions/dependency-review-action@v4 The dependency-review-action v4 requires a GitHub Advanced Security license for use on private repositories; it is available for all public repositories [1][3].
Citations:
- 1: https://github.com/actions/dependency-review-action/blob/v4.1.2/README.md
- 2: https://docs.github.com/en/code-security/how-tos/secure-your-supply-chain/manage-your-dependency-security/configure-dependency-review-action
- 3: https://github.com/actions/dependency-review-action/tree/v4.3.0
- 4: https://github.com/actions/dependency-review-action/blob/05fcfa49e06531bf7891999c4379b68e6c3f9b2f/docs/examples.md
🌐 Web query:
site:github.com/actions/dependency-review-action v4 checkout step required dependency review action
💡 Result:
The actions/checkout@v4 step is commonly used in conjunction with the actions/dependency-review-action@v4 to set up the repository environment before the review process takes place [1][2][3]. However, the actions/checkout step is not a "required dependency" for the Dependency Review action in the sense that the review action depends on it to function internally; rather, it is a standard practice in GitHub Actions workflows to checkout the repository code so that the environment is populated with the files necessary for the workflow to operate [4][3]. It is important to note the following regarding the relationship and configuration: - Workflow Structure: Official documentation and examples consistently show a checkout step followed immediately by the dependency-review-action step within the same job [1][4][3]. This ensures the workflow has access to the repository's files to perform its analysis. - Blocking Merges: The Dependency Review action itself is not automatically required. To make it a mandatory step that blocks pull request merges, a repository owner must explicitly configure branch protection settings to require this specific status check to pass before merging [2][4]. In summary, while you should include the checkout step in your workflow to ensure the dependency review action has access to the repository, the checkout step is a fundamental component of GitHub Actions workflows, not a specific dependency for the dependency review action itself [4][3].
Citations:
- 1: https://github.com/actions/dependency-review-action/blob/a1258f2a2e9da1b71aaab672cbae6b864b138aa2/docs/examples.md
- 2: https://github.com/actions/dependency-review-action/tree/v4.3.0
- 3: https://github.com/actions/dependency-review-action/blob/v4.3.1/README.md
- 4: https://github.com/actions/dependency-review-action/blob/67d4f4bd7a9b17a0db54d2a7519187c65e339de8/README.md
为 dependency-review 作业设置最小权限并关闭凭据持久化。
当前作业未声明 permissions。actions/dependency-review-action@v4 只需 contents: read,但当前令牌权限取决于仓库或组织默认设置。actions/checkout@v4 默认会持久化令牌。
添加 job 级别的 permissions: contents: read,并设置 persist-credentials: false。
🧰 Tools
🪛 zizmor (1.28.0)
[warning] 21-22: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[warning] 17-26: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block
(excessive-permissions)
🤖 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/ci.yml around lines 17 - 26, Update the dependency-review
job to declare job-level permissions with only contents: read, and configure its
actions/checkout@v4 step with persist-credentials: false.
Source: Linters/SAST tools
| module github.com/netproxy/shared/httpclient | ||
|
|
||
| go 1.22 | ||
| go 1.25.0 |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# 查找模块和可能声明 Go 版本的配置文件。
fd --hidden --exclude .git --type f \
'go\.mod$|go\.work$|Dockerfile.*|Makefile.*|\.go-version$|\.tool-versions$' . | sort
rg -n --hidden \
-g 'go.mod' -g 'go.work' -g 'Dockerfile*' -g 'Makefile*' \
-g '*.yml' -g '*.yaml' -g '.go-version' -g '.tool-versions' \
'go-version:|^[[:space:]]*go[[:space:]]+1\.|golang:1\.|GO_VERSION=|GOTOOLCHAIN=' . || trueRepository: 01luyicheng/NetProxyGateway
Length of output: 1009
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf '%s\n' '--- Dockerfiles ---'
for f in $(fd --type f 'Dockerfile.*' server | sort); do
echo "### $f"
cat -n "$f"
done
printf '%s\n' '--- Makefile ---'
cat -n Makefile
printf '%s\n' '--- CI toolchain and build references ---'
rg -n -C 4 --hidden \
-g '.github/workflows/*' -g 'Makefile*' -g 'Dockerfile*' \
'go-version|docker build|docker compose|make |go build|go test|GO_VERSION|golang:' .
printf '%s\n' '--- All module directives ---'
for f in $(fd --type f 'go.mod' server | sort); do
echo "### $f"
sed -n '1,12p' "$f"
doneRepository: 01luyicheng/NetProxyGateway
Length of output: 11311
将 Docker 构建镜像升级到 Go 1.25 或更高版本。
server/api/Dockerfile、server/socks5-proxy/Dockerfile 和 server/tunnel/Dockerfile 仍使用 golang:1.22-alpine,与各模块的 go 1.25.0 要求不一致。请同步更新这些构建入口;CI 已使用 Go 1.25。
📍 Affects 6 files
server/shared/httpclient/go.mod#L3-L3(this comment)server/shared/ratelimit/go.mod#L3-L3server/shared/recovery/go.mod#L3-L3server/shared/stringutil/go.mod#L3-L3server/socks5-proxy/go.mod#L3-L3server/tunnel/go.mod#L3-L3
🤖 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 `@server/shared/httpclient/go.mod` at line 3, Update the Docker build images in
server/api/Dockerfile, server/socks5-proxy/Dockerfile, and
server/tunnel/Dockerfile from golang:1.22-alpine to Go 1.25 or newer, matching
the module requirements. The go.mod sites server/shared/httpclient/go.mod,
server/shared/ratelimit/go.mod, server/shared/recovery/go.mod,
server/shared/stringutil/go.mod, server/socks5-proxy/go.mod, and
server/tunnel/go.mod require no direct changes; they establish the required Go
version.
|
独立复核结论:测试本身正确,但 REQUEST CHANGES——范围漂移 + Dockerfile/CI 一致性问题需处理。 测试本身(正确)
测试侧 nit(非阻断):
阻断项
只读复核,未修改任何文件;不涉及合并/关闭。 |
提交后审查(2026-08-01)结论:测试本身良好,但本 PR 混入了 3 个不相关变更,且 Go 版本 bump 与 #184 冲突,建议拆分。 1. 测试(良好)
2. CI dependency-review job(正面)新增 3. Go 版本 bump(
|
Co-authored-by: 01luyicheng <172185967+01luyicheng@users.noreply.github.com>
Co-authored-by: 01luyicheng <172185967+01luyicheng@users.noreply.github.com>
e51dbd1 to
e37b5f1
Compare
|
提交后正确性审查(自动)— PR #180 VpnLogRedaction 测试 结论:CLEAN,无 secret 明文泄露缺口。
|
5 similar comments
|
提交后正确性审查(自动)— PR #180 VpnLogRedaction 测试 结论:CLEAN,无 secret 明文泄露缺口。
|
|
提交后正确性审查(自动)— PR #180 VpnLogRedaction 测试 结论:CLEAN,无 secret 明文泄露缺口。
|
|
提交后正确性审查(自动)— PR #180 VpnLogRedaction 测试 结论:CLEAN,无 secret 明文泄露缺口。
|
|
提交后正确性审查(自动)— PR #180 VpnLogRedaction 测试 结论:CLEAN,无 secret 明文泄露缺口。
|
|
提交后正确性审查(自动)— PR #180 VpnLogRedaction 测试 结论:CLEAN,无 secret 明文泄露缺口。
|
🎯 What: 增加了对
VpnLogRedaction.kt中redactIp和redactConnectionKey方法的单元测试。📊 Coverage:
redactConnectionKey成功解析和格式无效时的脱敏表现。✨ Result: 显著提高了 VPN 日志脱敏逻辑的测试覆盖率,确保了后续代码重构和功能修改时的安全性与可靠性。
PR created automatically by Jules for task 2964390214397271083 started by @01luyicheng