mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6917] [MERGED] ci: run the PostgreSQL suites that never ran, and lint the shell, the workflows and the docs spec #6520
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6520
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6917
Author: @muditagrawal2007
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @MHSanaei
Base:
main← Head:ci/close-coverage-gaps📝 Commits (6)
26574f6style(x-ui): compare the argument count numerically2f24d2cci: run the PostgreSQL suites that never ran8b80ef3ci: lint the shell, pin the linter and check the docs specc23a376ci: keep the workflow lint focused on real findingsbd2a88cci: count only top-level passes in the durable-first step36edc37Merge remote-tracking branch 'origin/main' into pr/6917📊 Changes
6 files changed (+123 additions, -15 deletions)
View changed files
📝
.github/workflows/ci.yml(+86 -8)📝
.github/workflows/docs-ci.yml(+17 -0)📝
CLAUDE.md(+4 -3)📝
Makefile(+13 -2)📝
frontend/package.json(+1 -0)📝
x-ui.sh(+2 -2)📄 Description
Summary
Four gaps in the gates the repository could not enforce, closed. No product code changes — this PR is about CI, the local gate, and one shell bug the new lint found.
XUI_TEST_PG_DSN, which no workflow set)actionlinton every workflow,shellcheckon the scriptsversion: latest— the same commit could pass today and fail tomorrowv2.15.0make verify, along with the generated API referenceWhy
1 · Four PostgreSQL tests had never run in CI
internal/database/migrate_data_test.go(3 tests) andinternal/database/client_hwid_schema_test.gogate onXUI_TEST_PG_DSN:No workflow set that variable, so every CI run skipped them — including the PostgreSQL job. They are the tests that cover the SQLite→Postgres data migration (a composite-key table larger than the batch size, false-defaulted columns, and a failed copy leaving the destination untouched).
They write and drop their own tables, so they cannot share the durable database the panel tests use; the new
postgres-migrationjob gives them a scratch database of their own:The durable-first job also named only two of the six PostgreSQL-gated tests. The rest are named explicitly now, and the step counts the passes — a renamed test prints "no tests to run" and exits 0, which would otherwise leave the step green for nothing.
2 · The shell scripts and the workflows were never linted
~275 KB of shell (
install.sh,update.sh,x-ui.sh, the two Docker entrypoints) and nine workflows, with no linter. The newshell-lintjob runsactionlinton the workflows andshellcheckon the scripts: the ones that are clean today at every severity, the three legacy ones at error severity until their warning backlog (unquoted expansions, masked return codes) is worked off.It immediately found two real bugs in
x-ui.sh— the argument count was compared as a string:[[ $# > 1 ]]is false for ten or more arguments, because"10" > "1"compares lexicographically. Fixed in its own commit.3 · golangci-lint floated on
latestThe lint result could change between two runs of the same commit. It is pinned to
v2.15.0— the version this branch was verified against.4 · The docs OpenAPI spec was never compared with the panel's
The API reference the docs site publishes is generated from a copy of the panel's spec. The copy step was manual and unchecked, and the generated MDX was never regenerated. Now:
cmp frontend/public/openapi.json docs/public/openapi.jsonruns in thecodegenjob and inmake verify;docs-ci.ymlregenerates the API reference and fails if the committed MDX differs, and it now triggers onfrontend/public/openapi.jsonandfrontend/src/pages/api-docs/endpoints.tsas well as ondocs/**.The npm audit the frontend job already ran is now a script, so
make verifyruns the same command locally.Evidence — the skipped tests, and the bug the lint found
(The passing run was made against a real PostgreSQL 17, locally.)
Type of change
Areas affected
How was this tested?
Everything the new gates run was run locally:
The PostgreSQL job was exercised against a local PostgreSQL 17 with a scratch database, and all four previously-skipped tests pass there.
Notes for the reviewer
shell-lintjob needsshellcheck; the runner does not have it, so the job installs it.actionlintruns throughgo run(the Go toolchain is already set up by the other jobs).localmasking return codes). Fixing those in the installer is a change of its own — this PR does not touch them beyond the two real comparisons.make verifynow needs the network for the dependency audit. CI already did the audit; the local gate now does the same, so the two cannot drift.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.