Releases: tag each healthy deploy vMAJOR.MINOR.PATCH; /health and node checkin report versions (node-26#49)
Build & Deploy / Build & push images (push) Successful in 4m35s
Build & Deploy / Deploy Firestore rules & indexes (push) Successful in 1m34s
Build & Deploy / Deploy to VM (push) Successful in 1m54s
Build & Deploy / Report a failed deploy (push) Skipped
Build & Deploy / Tag release (push) Successful in 5s
Build & Deploy / Build & push images (push) Successful in 4m35s
Build & Deploy / Deploy Firestore rules & indexes (push) Successful in 1m34s
Build & Deploy / Deploy to VM (push) Successful in 1m54s
Build & Deploy / Report a failed deploy (push) Skipped
Build & Deploy / Tag release (push) Successful in 5s
VERSION holds MAJOR.MINOR (1.1). The build job works out the next patch (scripts/next-version.sh, integer count) and stamps it into c2-core as DRB_VERSION, which /health returns. The new "Tag release" job tags the commit only after the deploy job succeeds, so a failed deploy's number is reused. Node checkins carry `version`, stored on the node doc. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5cdde85d55
commit
b7cdb4452f
@@ -0,0 +1,24 @@
|
||||
"""node-26#49 — releases are visible: /health reports the server's, checkin carries the node's."""
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from app.internal.mqtt_handler import MQTTHandler
|
||||
from app.main import app
|
||||
|
||||
|
||||
def test_health_reports_the_release():
|
||||
with patch("app.main._VERSION", "1.1.4"):
|
||||
body = TestClient(app).get("/health").json()
|
||||
assert body["version"] == "1.1.4"
|
||||
assert "git_sha" in body
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_checkin_stores_the_node_release():
|
||||
with patch("app.internal.mqtt_handler.fstore") as fs:
|
||||
fs.doc_get = AsyncMock(return_value=None)
|
||||
fs.doc_set = AsyncMock()
|
||||
await MQTTHandler()._handle_checkin("n1", {"name": "Pi", "version": "1.1.10"})
|
||||
assert fs.doc_set.call_args[0][2]["version"] == "1.1.10"
|
||||
Reference in New Issue
Block a user