GRI-2081: install.sh client upgrade installs the new build and restarts the player #217
No reviewers
Labels
No labels
Area/Backend
Area/Database
Area/Docs
Area/Frontend
Area/Infra
Area/Security
Area/Tests
Area/Tooling
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Lang/Python
Lang/Rust
Lang/Shell
Lang/SQL
Lang/TypeScript
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Routing
Auto
Routing
Hold
Routing
Human
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grimoirix/grimoire-of-digital-signage!217
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/GRI-2081-client-upgrade-reinstall"
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?
Closes #206 (board GRI-2081).
Cause
Every client build was packaged as
0.1.0.install.shranapt-get install -y "$deb", and apt skips a.debwhose version is already installed, with exit 0, while its output went to/dev/null. Soinstall.sh upgrade clientprintedinstalled grimoirix-signage-client_0.1.0_amd64.deband left the old binary in/usr/bin.Reproduced with the real apt-get and dpkg against a private dpkg database (no root):
Change (both options from the issue, plus the restart)
scripts/package-client-deb.sh: each build gets its own version,<workspace version>+git<UTC commit time>.<short sha>, e.g.0.1.0+git20261115014326.71a482fb. The commit time comes first, so a newer commit sorts as a newer version, anddpkg -l grimoirix-signage-clientshows which build a device runs.SIGNAGE_DEB_VERSIONoverrides it. Outside a git checkout the bare workspace version is kept.install.sh:built:line, not the newest.debfound byls -t;apt-get install --reinstall --allow-downgrades, which keeps dependency resolution. A rebuild of the same commit (upgrade --force) applies, and so does an olderSCRYGLASS_REF;.deb's version, and the sha256 of/usr/bin/grimoirix-signage-clientmust equal the one inside the.deb. Otherwise it stops with an error and does not print "installed". It prints the installed version and the binary's sha;/proc/PID/exeends in(deleted)) is stopped and started again as the same user, with the same environment, working directory and arguments, so it comes back in the same desktop session. Its output goes to the journal throughsystemd-catwhen journald is running. When no player is running, the script says that the next login starts the new build. When a player cannot be started again, it says plainly to log out or restart the device. Running it a second time leaves a player that is already on the new build alone.scripts/tests/install-client-upgrade-test.sh(18 assertions): real apt-get and dpkg against a private database, with a copy ofsleep(1)as the packaged binary, so/proc/PID/exebehaves as it does for the real player. It covers a fresh install, a same-version rebuild, a newer and an older commit, an upgrade from the bare0.1.0, the guard catching a silent skip (old command without--reinstall), and the restart: the old process is gone, exactly one new one runs the new binary with the same arguments and working directory, and a second run leaves it alone. It is wired intolocal-gates.shand added as CI jobinstaller, which is in theneedsofCIand ofnotify-gate-failed.Verified
scripts/local-gates.sh --rust-only --frontend-only(the shell gates: hooks, pre-push test, this test): every gate passed. No Rust or front-end file is changed, so the Rust and front-end gates were not run locally. CI runs them.0.1.0+git20261115014326.71a482fb(HEAD71a482f, committed 01:43:26 UTC); withSIGNAGE_DEB_VERSION=1.2.3→1.2.3; outside a git checkout →0.1.0.Not verified here
.debwas not built: the build host was at load 14 of 16 threads. Only the version string and the file name change in that script, and the test builds.debs with versions in the new format.runuserinto a graphical session, X11 or Wayland) cannot be run on the build host. The test runs that code path as the same user. The acceptance run on the test client from GRI-2051 is still owed:install.sh upgrade clienton two different commits, then check that/usr/bin/grimoirix-signage-clientis the second build, the printed version matchesdpkg -l, and the player on screen came back.Not merging yet: the new
install.sh client upgradejob that this PR adds is red on7613c535. It is not a required context, but it is the test for this exact fix, so a red here means the fix is not shown to work. I updated the branch on dev (#215 merged); please make that job green on the new head. I will also make it a required context on dev once this lands.