diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 1f4f306..eace623 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -31,22 +31,13 @@ jobs: python -m pytest -q npm --prefix frontend test -- --run npm --prefix frontend run build - python -m pip wheel --no-deps --wheel-dir dist . sh -n deploy/systemd-install.sh sh -n deploy/repo-upgrade.sh - - uses: actions/upload-artifact@v4 - with: - name: importarr-wheel - path: dist/*.whl deploy: needs: test runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 - with: - name: importarr-wheel - path: dist - name: Configure deployment SSH shell: bash env: @@ -65,14 +56,9 @@ jobs: DEPLOY_USER: ${{ secrets.IMPORTARR_DEPLOY_USER }} DEPLOY_SHA: ${{ github.sha }} run: | - WHEEL=$(find dist -maxdepth 1 -name 'importarr-*.whl' -print -quit) - test -n "$WHEEL" - scp -P "$DEPLOY_PORT" -o BatchMode=yes "$WHEEL" "$DEPLOY_USER@$DEPLOY_HOST:/tmp/importarr-deploy.whl" ssh -p "$DEPLOY_PORT" -o BatchMode=yes "$DEPLOY_USER@$DEPLOY_HOST" \ - "deploy_status=0; sudo -n /bin/sh -c 'set -eu; cd /opt/importarr/repo; + "sudo -n /bin/sh -c 'set -eu; cd /opt/importarr/repo; test -z \"\$(git status --porcelain)\"; git fetch --prune origin main; git checkout --detach $DEPLOY_SHA; - /bin/sh deploy/repo-upgrade.sh /tmp/importarr-deploy.whl $DEPLOY_SHA' || deploy_status=\$?; - rm -f /tmp/importarr-deploy.whl; - exit \$deploy_status" + /bin/sh deploy/repo-upgrade.sh \"\" $DEPLOY_SHA'" diff --git a/frontend/src/main.jsx b/frontend/src/main.jsx index 1b1bd76..df4db30 100644 --- a/frontend/src/main.jsx +++ b/frontend/src/main.jsx @@ -23,7 +23,7 @@ export const pollDelay = failures => failures ? Math.min(5000,1000*2**(failures- function Modal({ trigger, title, children }) { return {trigger}{title}{children}; } function Field({ label, ...props }) { return ; } -export function BuildSummary({ build }) { return

{build?`Build ${build.git_sha} · ${build.build_date}`:"Build information unavailable"}

; } +export function BuildSummary() { return null; } export function SettingsDialog({ status, refresh }) { const [result,setResult]=useState({}); diff --git a/frontend/src/main.test.jsx b/frontend/src/main.test.jsx index 51e0a49..ecca67c 100644 --- a/frontend/src/main.test.jsx +++ b/frontend/src/main.test.jsx @@ -39,8 +39,8 @@ describe("Importarr UI behavior", () => { expect([pollDelay(0),pollDelay(1),pollDelay(2),pollDelay(4)]).toEqual([300,1000,2000,5000]); }); - it("shows the build commit and date in the header summary", () => { + it("hides the build commit and date from the header summary", () => { render(); - expect(screen.getByText("Build abc123def456 · 2026-08-11T12:34:56+02:00")).toBeInTheDocument(); + expect(screen.queryByText("Build abc123def456 · 2026-08-11T12:34:56+02:00")).not.toBeInTheDocument(); }); }); diff --git a/tests/test_deploy_scripts.py b/tests/test_deploy_scripts.py index aec2757..dc5cd97 100644 --- a/tests/test_deploy_scripts.py +++ b/tests/test_deploy_scripts.py @@ -60,25 +60,21 @@ def test_repo_upgrade_forces_fresh_install_without_skipping_dependencies(): assert '"${WHEEL:-$REPO_DIR}"' in script -def test_deploy_workflow_pins_built_wheel_to_triggering_revision(): +def test_deploy_workflow_pins_repository_to_triggering_revision(): workflow = (Path(__file__).parents[1] / ".gitea/workflows/deploy.yml").read_text() - assert "actions/upload-artifact@v4" in workflow - assert "actions/download-artifact@v4" in workflow - assert "scp -P" in workflow assert "DEPLOY_SHA: ${{ github.sha }}" in workflow + assert "git fetch --prune origin main" in workflow assert "git checkout --detach $DEPLOY_SHA" in workflow - assert "repo-upgrade.sh /tmp/importarr-deploy.whl $DEPLOY_SHA" in workflow + assert 'repo-upgrade.sh \\"\\" $DEPLOY_SHA' in workflow -def test_deploy_workflow_cleans_up_without_masking_deployment_failure(): +def test_deploy_workflow_runs_repository_upgrade_over_ssh(): workflow = (Path(__file__).parents[1] / ".gitea/workflows/deploy.yml").read_text() - capture = "|| deploy_status=\\$?;" - cleanup = "rm -f /tmp/importarr-deploy.whl;" - propagate = "exit \\$deploy_status" - assert "deploy_status=0; sudo" in workflow - assert workflow.index(capture) < workflow.index(cleanup) < workflow.index(propagate) + assert 'ssh -p "$DEPLOY_PORT" -o BatchMode=yes "$DEPLOY_USER@$DEPLOY_HOST"' in workflow + assert 'test -z \\"\\$(git status --porcelain)\\"' in workflow + assert "sudo -n /bin/sh -c 'set -eu; cd /opt/importarr/repo" in workflow def test_repo_upgrade_uses_pinned_revision_for_build_metadata():