feat(harmonyos): prepare API 26 follow-ups#40
Conversation
|
Warning Review limit reached
More reviews will be available in 11 minutes and 13 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough本 PR 新增 HarmonyOS API 26 的 CI SDK 规范化映射与 ChangesAPI 26 SDK 支持与 NetworkBoost 数据流
全局 UI 形状 Circle → Ellipse 替换
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@entry/src/main/ets/service/network/NetworkBoostService.ets`:
- Around line 222-227: The setDataFlowDesc method is missing cleanup of any
previously active flow before setting a new one, which can leave stale state on
the NetworkBoost side when called repeatedly. Before calling
setDataFlowDescApi26 to establish the new flow, first add logic to properly
release the old flow (such as sending a LEAVE command or calling an appropriate
cleanup method). This ensures that when a session repeatedly calls
setDataFlowDesc with different flows, each old flow is explicitly left before
the new one is entered, preventing descriptor residue from lingering on the
NetworkBoost side.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: dbab9053-07f4-4507-8e07-7518c8f14499
📒 Files selected for processing (21)
README.mdci/normalize-sdk.shci/patch-sdk.shci/sdk-stubs/kit.NetworkBoostKit.d.tsci/sdk-stubs/kit.NetworkBoostKit.jsonci/sdk-stubs/networkboost-dataflow-patch.d.tsci/sdk-stubs/ohos.networkBoost.netBoost.d.tsci/sdk-stubs/ohos.networkBoost.netQuality.d.tsentry/src/main/ets/components/AppCard.etsentry/src/main/ets/components/AppListItem.etsentry/src/main/ets/components/ComputerCard.etsentry/src/main/ets/components/PcListTitleBar.etsentry/src/main/ets/components/test/GameControllerTestView.etsentry/src/main/ets/components/test/SensorTestView.etsentry/src/main/ets/components/test/UsbControllerTestView.etsentry/src/main/ets/components/virtual/AnalogStick.etsentry/src/main/ets/components/virtual/InvisibleJoystick.etsentry/src/main/ets/components/virtual/VirtualJoystick.etsentry/src/main/ets/pages/AddPcPageV2.etsentry/src/main/ets/pages/ControllerTestPage.etsentry/src/main/ets/service/network/NetworkBoostService.ets
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ci/patch-sdk.sh (1)
76-85: ⚡ Quick win建议在替换后校验命中次数,避免静默未生效。
Line 76-85 当前直接
re.sub后写回;若build-profile.json5结构未来变化,可能 0 命中但仍显示已修补。建议用re.subn校验至少命中一次,否则直接失败,避免 CI 在错误 SDK 配置下继续执行。建议修改
-text = re.sub( +text, compile_hits = re.subn( r'("compileSdkVersion"\s*:\s*")[^"]+(")', rf'\g<1>{compile_version}\2', text, ) -text = re.sub( +text, target_hits = re.subn( r'("targetSdkVersion"\s*:\s*")[^"]+(")', rf'\g<1>{target_version}\2', text, ) +if compile_hits == 0 or target_hits == 0: + raise SystemExit( + f'build-profile.json5 patch failed: compile_hits={compile_hits}, target_hits={target_hits}' + )🤖 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 `@ci/patch-sdk.sh` around lines 76 - 85, The re.sub calls for compileSdkVersion and targetSdkVersion replacements do not verify whether they actually matched and replaced any occurrences. If the build-profile.json5 structure changes, these patterns might fail to match but the code will silently continue without detecting the failure. Replace both re.sub calls with re.subn instead, which returns a tuple containing the modified text and the count of substitutions made. After each re.subn call, check that the substitution count is at least 1, and if not, raise an error or exit the script to prevent CI from continuing with an unmodified SDK configuration.
🤖 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.
Nitpick comments:
In `@ci/patch-sdk.sh`:
- Around line 76-85: The re.sub calls for compileSdkVersion and targetSdkVersion
replacements do not verify whether they actually matched and replaced any
occurrences. If the build-profile.json5 structure changes, these patterns might
fail to match but the code will silently continue without detecting the failure.
Replace both re.sub calls with re.subn instead, which returns a tuple containing
the modified text and the count of substitutions made. After each re.subn call,
check that the substitution count is at least 1, and if not, raise an error or
exit the script to prevent CI from continuing with an unmodified SDK
configuration.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: db8bc64b-3784-4f4b-b90b-92cc24b740e5
📒 Files selected for processing (1)
ci/patch-sdk.sh
9c776a9 to
e9987b7
Compare
e9987b7 to
95ed0e6
Compare
改了啥呀
netBooststub,并在NetworkBoostService里预埋 API 26setDataFlowDesc可选入口Circle().fill()/stroke()装饰圆点改成Ellipse(),减少最新 SDK 下的兼容噪音为啥要改
targetSdkVersion,避免一次性打开新的 ArkUI/权限/系统行为门控setDataFlowDesc对串流场景很香,先把接口和 CI 声明准备好,后面 native 暴露 socket fd 后就能接入验证
bash -n ci/normalize-sdk.shbash -n ci/patch-sdk.shJAVA_HOME=/Applications/DevEco-Studio.app/Contents/jbr/Contents/Home PATH="/Applications/DevEco-Studio.app/Contents/jbr/Contents/Home/bin:$PATH" DEVECO_SDK_HOME=/Applications/DevEco-Studio.app/Contents/sdk NODE_PATH="$PWD/node_modules:$PWD/hvigor/node_modules" node hvigorw.js assembleHap --mode module -p module=entry@default -p product=default --no-daemonSummary by CodeRabbit
发布说明
新特性
改进
开发环境