Skip to content

perf(ci): simplify CI and speed it up - #11226

Merged
Soulter merged 3 commits into
AstrBotDevs:masterfrom
Sha1rholder:simpler-smoke_test-ci
Nov 18, 2026
Merged

Soulter merged 3 commits into
AstrBotDevs:masterfrom
Sha1rholder:simpler-smoke_test-ci

Conversation

@Sha1rholder

@Sha1rholder Sha1rholder commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Modifications / 改动点

这是一个可能对开发者具有破坏性的变更,对用户没影响

Checklist / 检查清单

  • 😊 If there are new features added in the PR, I have discussed it with the authors through issues/emails, etc.
    / 如果 PR 中有新加入的功能,已经通过 Issue / 邮件等方式和作者讨论过。

  • 👀 My changes have been well-tested, and "Verification Steps" and "Screenshots" have been provided above.
    / 我的更改经过了良好的测试,并已在上方提供了“验证步骤”和“运行截图”。

  • 📚 I checked the affected WebUI instructions and screenshots in docs/zh and docs/en against the changed navigation, page structure, and labels, and updated them in this PR (or explained why no documentation update is needed). For renamed, moved, or merged entry points, I included an old entry → new entry mapping in the documentation and changelog.
    / 我已对照变化后的 WebUI 入口、页面结构和术语,核对并在本 PR 中更新 docs/zh 和 docs/en 的相关操作说明与截图(或说明无需更新文档的原因)。入口改名、移动或合并时,已在文档和 changelog 中补充 旧入口 → 新入口 对照。

  • 🤓 I have ensured that no new dependencies are introduced, OR if new dependencies are introduced, they have been added to the appropriate locations in requirements.txt and pyproject.toml.
    / 我确保没有引入新依赖库,或者引入了新依赖库的同时将其添加到 requirements.txt 和 pyproject.toml 文件相应位置。

  • 😮 My changes do not introduce malicious code.
    / 我的更改没有引入恶意代码。

Summary by Sourcery

Streamline CI workflows by standardizing uv usage, reducing redundant test and environment matrices, and tightening project-sync execution.

Bug Fixes:

  • Remove obsolete project-sync test coverage that expected the previous timeout and action-pinning behavior.

Enhancements:

  • Simplify CI workflows by standardizing on uv for tool setup and execution.
  • Reduce smoke-test coverage to one environment per operating system and streamline test execution.
  • Shorten project synchronization workflow timeouts and align its documentation with the updated workflow behavior.

CI:

  • Update formatting, unit-test, smoke-test, release, and project-sync workflows to use the shared uv setup action without bootstrapping Python and uv separately.

Documentation:

  • Update project-sync documentation with the new timeout, action versioning, and local validation commands.

Tests:

  • Adjust project-sync regression checks to match the streamlined test set and workflow configuration.

Chores:

  • Remove redundant dependency synchronization and CI setup steps.

@sourcery-ai sourcery-ai 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.

Hey - I've found 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/smoke_test.yml" line_range="35" />
<code_context>
-        run: |
-          python scripts/smoke_startup_check.py
-        timeout-minutes: 2
+        run: uv run scripts/smoke_startup_check.py
</code_context>
<issue_to_address>
**Smoke CI cannot resolve dependencies**

When the workflow runs against the dependency constraints currently declared in `pyproject.toml`, `uv run` syncs the project dependencies from `pyproject.toml` before launching the script, but the declared `certifi>=2026.10.19` is not available as of 2026-01-01, so dependency resolution fails and the smoke job never starts.

Correct the future dependency minimums in `pyproject.toml` or install the intended requirements file before running the smoke test.
</issue_to_address>

### Comment 2
<location path=".github/workflows/smoke_test.yml" line_range="32" />
<code_context>
-          uv pip install --system -r requirements.txt
-        timeout-minutes: 15
+      - name: Set up uv
+        uses: astral-sh/setup-uv@v10.3.3

       - name: Run smoke tests
</code_context>
<issue_to_address>
**Compromised action runs in CI**

When an attacker compromises the action or its release tag, the runner downloads and executes the action before running the smoke test, so a compromised or retargeted action can run arbitrary code in the job and access its available credentials and workspace.

Pin the action to a verified full-length commit SHA and set the job's minimum required token permissions.
</issue_to_address>

### Comment 3
<location path=".github/workflows/smoke_test.yml" line_range="35" />
<code_context>
-        run: |
-          python scripts/smoke_startup_check.py
-        timeout-minutes: 2
+        run: uv run scripts/smoke_startup_check.py
</code_context>
<issue_to_address>
**Smoke tests vary across runs**

When an upstream dependency publishes a newer release within a declared range, `uv run` resolves ranged dependencies from `pyproject.toml` on each fresh CI run without a committed lockfile, so the dependency set changes and an incompatible release makes a previously passing smoke test fail.

Commit and use a lockfile so each CI run installs the same dependency versions.
</issue_to_address>

Sourcery assessment

Approval pending. 3 findings to address first.

Blocking findings: .github/workflows/smoke_test.yml:35, .github/workflows/smoke_test.yml:32, .github/workflows/smoke_test.yml:35


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/smoke_test.yml Resolved
Comment thread .github/workflows/smoke_test.yml Resolved
Comment thread .github/workflows/smoke_test.yml Resolved
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Sha1rholder
Sha1rholder marked this pull request as draft November 18, 2026 02:53
@Sha1rholder Sha1rholder changed the title CI: Simplify Smoke Test CI Simplify CI and speed it up Nov 18, 2026
Reference actions by version tag and reduce the sync timeout from 120 to
10 minutes. Drop references to the deleted delivery test and remove
workflow security assertions.
@Sha1rholder
Sha1rholder marked this pull request as ready for review November 18, 2026 04:44
@Soulter Soulter changed the title Simplify CI and speed it up perf(ci): simplify CI and speed it up Nov 18, 2026
@Soulter
Soulter merged commit ab4ddd6 into AstrBotDevs:master Nov 18, 2026
11 checks passed
@Sha1rholder
Sha1rholder deleted the simpler-smoke_test-ci branch November 18, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants