Repository navigation
Conversation
Starting from default.target can launch the UI before display settings are ready and does not restart it on subsequent graphical logins. Start both services after the graphical session is active and stop them when it ends. Replace old user-install links, migrate enabled Debian services while preserving disabled states and first-install presets, and cover installation and upgrade behavior with regression checks.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: hualet The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's GuideThe PR moves EchoFlow autostart from user boot to the graphical-session lifecycle, updates source-install and Debian upgrade paths to migrate legacy links without overriding disabled or preset policy, and adds documentation plus isolated regression checks for installation and upgrade behavior. Sequence diagram for graphical-session service lifecyclesequenceDiagram
participant Session as GraphicalSession
participant Systemd as systemd_user
participant EchoFlow as echoflow.service
participant UI as echoflow_ui.service
Session->>Systemd: graphical-session.target starts
Systemd->>EchoFlow: start echoflow.service
Systemd->>UI: start echoflow-ui.service
Session->>Systemd: graphical-session.target stops
Systemd->>EchoFlow: stop echoflow.service
Systemd->>UI: stop echoflow-ui.service
Flow diagram for migrating EchoFlow autostart linksflowchart TD
Install[Source install or Debian upgrade] --> Reload[systemctl user daemon-reload]
Reload --> Reenable[Reenable EchoFlow services]
Reenable --> Session[graphical-session.target]
Session --> Start[Start services after graphical session is ready]
Session --> Stop[Stop services when session ends]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/spec/test_onboarding_install.sh" line_range="98" />
<code_context>
default_output="$(run_install "$DEFAULT_HOME")"
assert_logged "systemctl --user daemon-reload"
-assert_logged "systemctl --user enable echoflow.service echoflow-ui.service"
+assert_logged "systemctl --user reenable echoflow.service echoflow-ui.service"
assert_logged "systemctl --user restart echoflow.service echoflow-ui.service"
assert_logged "fcitx5 -rd"
</code_context>
<issue_to_address>
**User link migration goes unverified**
When the fake `systemctl` is used for the user-install migration check, `test_onboarding_install.sh` accepts the logged `reenable` command at line 98 as migration success; its fake `systemctl` at lines 41–48 only logs arguments and always exits zero, so the test passes with the old `default.target` link unchanged.
Assert the resulting link state using an isolated systemd-compatible helper, or make the fake model `reenable` and verify that it replaces the old link.
</issue_to_address>| default_output="$(run_install "$DEFAULT_HOME")" | ||
| assert_logged "systemctl --user daemon-reload" | ||
| assert_logged "systemctl --user enable echoflow.service echoflow-ui.service" | ||
| assert_logged "systemctl --user reenable echoflow.service echoflow-ui.service" |
There was a problem hiding this comment.
🟡 Medium · User link migration goes unverified
When the fake systemctl is used for the user-install migration check, test_onboarding_install.sh accepts the logged reenable command at line 98 as migration success; its fake systemctl at lines 41–48 only logs arguments and always exits zero, so the test passes with the old default.target link unchanged.
Assert the resulting link state using an isolated systemd-compatible helper, or make the fake model reenable and verify that it replaces the old link.
Prompt for AI agents
In `tests/spec/test_onboarding_install.sh` at line 98:
**User link migration goes unverified**
When the fake `systemctl` is used for the user-install migration check, `test_onboarding_install.sh` accepts the logged `reenable` command at line 98 as migration success; its fake `systemctl` at lines 41–48 only logs arguments and always exits zero, so the test passes with the old `default.target` link unchanged.
Assert the resulting link state using an isolated systemd-compatible helper, or make the fake model `reenable` and verify that it replaces the old link.
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['无语法逻辑问题'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['在 test_systemd_upgrade.sh 第 38 行和第 47 行各添加一行注释,说明先写旧版单元文件用于创建 default.target.wants 链接、再覆盖为新版以模拟升级后状态'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: ['无性能问题'] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: ['建议在 test_systemd_upgrade.sh 的 wrapper 脚本中添加 💡 改进建议代码示例# tests/spec/test_systemd_upgrade.sh — 防御性加固建议(非必须修复)
# 在 wrapper 脚本中添加空值守卫:
cat > "$TEST_ROOT/bin/deb-systemd-helper" <<'EOF'
#!/bin/sh
[ -n "$TEST_PACKAGE_ROOT" ] || { echo 'REFUSE - TEST_PACKAGE_ROOT is empty' >&2; exit 1; }
DPKG_ROOT="$TEST_PACKAGE_ROOT" exec "$HELPER" "$@"
EOF
# 在 systemctl 符号链接创建前添加可用性检查:
if ! command -v systemctl >/dev/null 2>&1; then
echo 'SKIP - systemctl is not installed'
exit 0
fi
ln -s "$(command -v systemctl)" "$TEST_PACKAGE_ROOT/usr/bin/systemctl"本报告由 AI 代码审查工具自动生成 |
EchoFlow could start before the desktop display settings were ready, causing incorrect UI scaling, and did not reliably start again after logout and login. Both services now start with the graphical session and stop when it ends.
graphical-session.target, with session stop propagation.default.targetlinks in user installs and Debian upgrades, preserving disabled services and first-install preset policy.Validation
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfocmake --build build -j 8ctest --test-dir build --output-on-failure: 28/28 passed.git diff --checkpassed.Existing installations need the updated service units and migrated enablement links. Source installs can rerun
./install-user.sh; package upgrades migrate system-wide links through the maintainer script. Existing per-user units continue to override packaged units, as documented.Summary by Sourcery
Bind EchoFlow autostart to the graphical session and migrate existing installations without changing service enablement policy.
Bug Fixes:
Enhancements:
Deployment:
Documentation:
Tests: