fix: Agent retries transient transport errors/proxy 5xx with backoff (classify, complete, fail); hide console behind the GUI wizard; 1.2.2
Found in the clean-Windows recovery test: a single TLS handshake failure mid-job failed a whole sync. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "gti-fiscal-agent"
|
name = "gti-fiscal-agent"
|
||||||
version = "1.2.1"
|
version = "1.2.2"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
dependencies = ["httpx>=0.27,<1"]
|
dependencies = ["httpx>=0.27,<1"]
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ class Config:
|
|||||||
self.poll_interval_seconds = float(env.get("POLL_INTERVAL_SECONDS", "5"))
|
self.poll_interval_seconds = float(env.get("POLL_INTERVAL_SECONDS", "5"))
|
||||||
# RTC auto-apply is a SEPARATE switch (default OFF): FIREBIRD_WRITES alone never lets the Agent fill cClassTrib.
|
# RTC auto-apply is a SEPARATE switch (default OFF): FIREBIRD_WRITES alone never lets the Agent fill cClassTrib.
|
||||||
self.rtc_auto_apply_max_per_job = int(env.get("RTC_AUTO_APPLY_MAX_PER_JOB", str(_rtc_apply.DEFAULT_MAX_PER_JOB)))
|
self.rtc_auto_apply_max_per_job = int(env.get("RTC_AUTO_APPLY_MAX_PER_JOB", str(_rtc_apply.DEFAULT_MAX_PER_JOB)))
|
||||||
self.agent_version = env.get("AGENT_VERSION", "1.2.1")
|
self.agent_version = env.get("AGENT_VERSION", "1.2.2")
|
||||||
self.schema_fingerprint = env.get("SCHEMA_FINGERPRINT", REFERENCE_SCHEMA_V1)
|
self.schema_fingerprint = env.get("SCHEMA_FINGERPRINT", REFERENCE_SCHEMA_V1)
|
||||||
self.state_db = env.get("AGENT_STATE_DB", str(AGENT_ROOT / "agent_state.sqlite"))
|
self.state_db = env.get("AGENT_STATE_DB", str(AGENT_ROOT / "agent_state.sqlite"))
|
||||||
# Pilot write authorization: both must be explicitly set by the installer for
|
# Pilot write authorization: both must be explicitly set by the installer for
|
||||||
@@ -348,7 +348,7 @@ def execute_job(job, config, executor, state, env):
|
|||||||
"fiscal_context": fiscal_context,
|
"fiscal_context": fiscal_context,
|
||||||
"rtc_auto_apply": rtc_apply,
|
"rtc_auto_apply": rtc_apply,
|
||||||
"fiscal_mode": getattr(config, "fiscal_mode", None),
|
"fiscal_mode": getattr(config, "fiscal_mode", None),
|
||||||
"release_version": env.get("AGENT_VERSION") or "1.2.1",
|
"release_version": env.get("AGENT_VERSION") or "1.2.2",
|
||||||
"products_total": len(products),
|
"products_total": len(products),
|
||||||
"products_changed": len(to_process),
|
"products_changed": len(to_process),
|
||||||
"products_processed": summary["processed"],
|
"products_processed": summary["processed"],
|
||||||
@@ -506,7 +506,7 @@ def run(config, env, *, max_iterations=None, stopper=None):
|
|||||||
def enforce_startup_preflight(env):
|
def enforce_startup_preflight(env):
|
||||||
"""Full read-only preflight at startup (Hub, auth, Firebird, capabilities, company context, guards). Fail closed."""
|
"""Full read-only preflight at startup (Hub, auth, Firebird, capabilities, company context, guards). Fail closed."""
|
||||||
from gti_fiscal_agent.preflight import run_preflight
|
from gti_fiscal_agent.preflight import run_preflight
|
||||||
report = run_preflight(env, agent_version=env.get("AGENT_VERSION") or "1.2.1")
|
report = run_preflight(env, agent_version=env.get("AGENT_VERSION") or "1.2.2")
|
||||||
logger.info("startup preflight: %s", json.dumps({k: report[k] for k in ("PREFLIGHT", "blockers", "fiscal_mode", "effective_firebird_writes")}, ensure_ascii=False))
|
logger.info("startup preflight: %s", json.dumps({k: report[k] for k in ("PREFLIGHT", "blockers", "fiscal_mode", "effective_firebird_writes")}, ensure_ascii=False))
|
||||||
print(json.dumps({"PREFLIGHT": report["PREFLIGHT"], "blockers": report["blockers"]}, ensure_ascii=False))
|
print(json.dumps({"PREFLIGHT": report["PREFLIGHT"], "blockers": report["blockers"]}, ensure_ascii=False))
|
||||||
if report["PREFLIGHT"] != "PASS":
|
if report["PREFLIGHT"] != "PASS":
|
||||||
|
|||||||
@@ -1,5 +1,29 @@
|
|||||||
|
import time
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
|
TRANSIENT_STATUS = (502, 503, 504) # reverse proxy / Hub restarting
|
||||||
|
BACKOFF_SECONDS = (1, 2, 4, 8) # 5 attempts in total
|
||||||
|
|
||||||
|
|
||||||
|
def _resilient(send):
|
||||||
|
"""Runs one idempotent HTTP call, retrying transport failures (connect/TLS/read/protocol errors) and proxy 502/503/504 with backoff, so a network blip in
|
||||||
|
the middle of a long job does not throw the whole job (and minutes of classification) away. Non-transient errors (4xx) are returned untouched."""
|
||||||
|
last = None
|
||||||
|
for attempt in range(len(BACKOFF_SECONDS) + 1):
|
||||||
|
try:
|
||||||
|
response = send()
|
||||||
|
if response.status_code not in TRANSIENT_STATUS or attempt == len(BACKOFF_SECONDS):
|
||||||
|
return response
|
||||||
|
last = None
|
||||||
|
except httpx.TransportError as error:
|
||||||
|
last = error
|
||||||
|
if attempt == len(BACKOFF_SECONDS):
|
||||||
|
raise
|
||||||
|
time.sleep(BACKOFF_SECONDS[attempt])
|
||||||
|
raise last # pragma: no cover
|
||||||
|
|
||||||
|
|
||||||
class HubClient:
|
class HubClient:
|
||||||
def __init__(self, url, token, chunk_size=25): self.url, self.token, self.chunk_size = url.rstrip("/"), token, chunk_size
|
def __init__(self, url, token, chunk_size=25): self.url, self.token, self.chunk_size = url.rstrip("/"), token, chunk_size
|
||||||
def _headers(self): return {"Authorization": f"Bearer {self.token}"}
|
def _headers(self): return {"Authorization": f"Bearer {self.token}"}
|
||||||
@@ -7,14 +31,9 @@ class HubClient:
|
|||||||
results = []
|
results = []
|
||||||
for start in range(0, len(products), self.chunk_size):
|
for start in range(0, len(products), self.chunk_size):
|
||||||
chunk = products[start:start + self.chunk_size]
|
chunk = products[start:start + self.chunk_size]
|
||||||
# Small chunks + generous timeout + one retry: a large first sync must survive a
|
# Small chunks + generous timeout + retry with backoff on any transport error or proxy 5xx: a large first sync must survive
|
||||||
# slow Hub / reverse-proxy read timeout instead of failing the whole job.
|
# a slow Hub, a reverse-proxy read timeout or a TLS/network blip instead of failing the whole job.
|
||||||
for attempt in (1, 2):
|
response = _resilient(lambda: httpx.post(f"{self.url}/v1/classify/batch", json={"products": chunk}, headers=self._headers(), timeout=120))
|
||||||
try:
|
|
||||||
response = httpx.post(f"{self.url}/v1/classify/batch", json={"products": chunk}, headers=self._headers(), timeout=120)
|
|
||||||
break
|
|
||||||
except httpx.ReadTimeout:
|
|
||||||
if attempt == 2: raise
|
|
||||||
response.raise_for_status(); results.extend(response.json()["results"])
|
response.raise_for_status(); results.extend(response.json()["results"])
|
||||||
return results
|
return results
|
||||||
def get_json(self, path):
|
def get_json(self, path):
|
||||||
@@ -48,8 +67,8 @@ class HubClient:
|
|||||||
response = httpx.get(f"{self.url}/v1/jobs/{job_id}", headers=self._headers(), timeout=15)
|
response = httpx.get(f"{self.url}/v1/jobs/{job_id}", headers=self._headers(), timeout=15)
|
||||||
response.raise_for_status(); return response.json()
|
response.raise_for_status(); return response.json()
|
||||||
def complete_job(self, job_id, result_summary):
|
def complete_job(self, job_id, result_summary):
|
||||||
response = httpx.post(f"{self.url}/v1/jobs/{job_id}/complete", json={"result_summary": result_summary}, headers=self._headers(), timeout=15)
|
response = _resilient(lambda: httpx.post(f"{self.url}/v1/jobs/{job_id}/complete", json={"result_summary": result_summary}, headers=self._headers(), timeout=30))
|
||||||
response.raise_for_status(); return response.json()
|
response.raise_for_status(); return response.json()
|
||||||
def fail_job(self, job_id, error):
|
def fail_job(self, job_id, error):
|
||||||
response = httpx.post(f"{self.url}/v1/jobs/{job_id}/fail", json={"error": str(error)}, headers=self._headers(), timeout=15)
|
response = _resilient(lambda: httpx.post(f"{self.url}/v1/jobs/{job_id}/fail", json={"error": str(error)}, headers=self._headers(), timeout=30))
|
||||||
response.raise_for_status(); return response.json()
|
response.raise_for_status(); return response.json()
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import os
|
|||||||
import sqlite3
|
import sqlite3
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
AGENT_VERSION_DEFAULT = "1.2.1"
|
AGENT_VERSION_DEFAULT = "1.2.2"
|
||||||
REQUIRED_ENV = ("GTI_HUB_URL", "AGENT_TOKEN", "FIREBIRD_DATABASE_PATH", "FB_USER", "FB_PASSWORD")
|
REQUIRED_ENV = ("GTI_HUB_URL", "AGENT_TOKEN", "FIREBIRD_DATABASE_PATH", "FB_USER", "FB_PASSWORD")
|
||||||
REQUIRED_CAPABILITIES = ("supports_ncm", "supports_ipi", "supports_cest")
|
REQUIRED_CAPABILITIES = ("supports_ncm", "supports_ipi", "supports_cest")
|
||||||
FISCAL_MODES = ("DRY_RUN", "AUTO_APPLY")
|
FISCAL_MODES = ("DRY_RUN", "AUTO_APPLY")
|
||||||
|
|||||||
@@ -32,3 +32,32 @@ def test_identity_requests_authenticated_identity_only(monkeypatch):
|
|||||||
|
|
||||||
assert calls["url"] == "https://hub.example/v1/agents/me/identity"
|
assert calls["url"] == "https://hub.example/v1/agents/me/identity"
|
||||||
assert calls["headers"] == {"Authorization": "Bearer test-agent-token"}
|
assert calls["headers"] == {"Authorization": "Bearer test-agent-token"}
|
||||||
|
|
||||||
|
|
||||||
|
def test_transport_errors_and_proxy_5xx_are_retried_but_client_errors_are_not(monkeypatch):
|
||||||
|
import httpx
|
||||||
|
from gti_fiscal_agent import client as c
|
||||||
|
monkeypatch.setattr(c.time, "sleep", lambda s: None)
|
||||||
|
calls = {"n": 0}
|
||||||
|
|
||||||
|
def flaky():
|
||||||
|
calls["n"] += 1
|
||||||
|
if calls["n"] == 1:
|
||||||
|
raise httpx.ConnectError("ssl handshake failure")
|
||||||
|
if calls["n"] == 2:
|
||||||
|
return httpx.Response(502)
|
||||||
|
return httpx.Response(200, json={"ok": True})
|
||||||
|
|
||||||
|
assert c._resilient(flaky).status_code == 200 and calls["n"] == 3
|
||||||
|
calls["n"] = 0
|
||||||
|
assert c._resilient(lambda: (calls.__setitem__("n", calls["n"] + 1), httpx.Response(401))[1]).status_code == 401 and calls["n"] == 1 # 4xx: no retry
|
||||||
|
calls["n"] = 0
|
||||||
|
|
||||||
|
def always_down():
|
||||||
|
calls["n"] += 1
|
||||||
|
raise httpx.ConnectError("down")
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
with pytest.raises(httpx.ConnectError):
|
||||||
|
c._resilient(always_down)
|
||||||
|
assert calls["n"] == 5 # bounded: 5 attempts, then the job fails cleanly
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ kept identical to this) and what an AgentRelease row's `version` column holds
|
|||||||
once published — never a second, independent version number. Fiscal semantics
|
once published — never a second, independent version number. Fiscal semantics
|
||||||
are versioned separately (ENGINE_VERSION/DECISION_VERSION in classification.py,
|
are versioned separately (ENGINE_VERSION/DECISION_VERSION in classification.py,
|
||||||
DECISION_ENGINE_VERSION etc.) and are NOT changed by a release bump."""
|
DECISION_ENGINE_VERSION etc.) and are NOT changed by a release bump."""
|
||||||
GTI_FISCAL_VERSION = "1.2.1"
|
GTI_FISCAL_VERSION = "1.2.2"
|
||||||
API_COMPAT_MAJOR_MINOR = "1.0" # an Agent 1.0.x/1.1.x talks to any Hub 1.0.x
|
API_COMPAT_MAJOR_MINOR = "1.0" # an Agent 1.0.x/1.1.x talks to any Hub 1.0.x
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "gti-fiscal-hub"
|
name = "gti-fiscal-hub"
|
||||||
version = "1.2.1"
|
version = "1.2.2"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fastapi>=0.115,<1",
|
"fastapi>=0.115,<1",
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ def test_health_is_unavailable_when_database_is_down():
|
|||||||
|
|
||||||
def test_version_endpoint_reports_release_and_fiscal_versions():
|
def test_version_endpoint_reports_release_and_fiscal_versions():
|
||||||
body = TestClient(create_app(database_probe=lambda: True)).get("/version").json()
|
body = TestClient(create_app(database_probe=lambda: True)).get("/version").json()
|
||||||
assert body["version"] == "1.2.1" and body["api_compat"] == "1.0" and body["engine_version"] and body["decision_version"]
|
assert body["version"] == "1.2.2" and body["api_compat"] == "1.0" and body["engine_version"] and body["decision_version"]
|
||||||
|
|
||||||
|
|
||||||
def test_production_refuses_the_dev_token(monkeypatch):
|
def test_production_refuses_the_dev_token(monkeypatch):
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ FB_PASSWORD=
|
|||||||
FISCAL_MODE=DRY_RUN
|
FISCAL_MODE=DRY_RUN
|
||||||
FIREBIRD_WRITES=0
|
FIREBIRD_WRITES=0
|
||||||
POLL_INTERVAL_SECONDS=5
|
POLL_INTERVAL_SECONDS=5
|
||||||
AGENT_VERSION=1.2.1
|
AGENT_VERSION=1.2.2
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ switch ($Command) {
|
|||||||
"GTI_HUB_URL=$hub", "AGENT_TOKEN=$token", "AGENT_ID=$agentId",
|
"GTI_HUB_URL=$hub", "AGENT_TOKEN=$token", "AGENT_ID=$agentId",
|
||||||
"COMPANY_CODE=$code", "COMPANY_CNPJ=$cnpj", "COMPANY_CRT_SOURCE=$crtSource",
|
"COMPANY_CODE=$code", "COMPANY_CNPJ=$cnpj", "COMPANY_CRT_SOURCE=$crtSource",
|
||||||
"FIREBIRD_DATABASE_PATH=$db", "FB_USER=$fbUser", "FB_PASSWORD=$fbPass",
|
"FIREBIRD_DATABASE_PATH=$db", "FB_USER=$fbUser", "FB_PASSWORD=$fbPass",
|
||||||
'FISCAL_MODE=DRY_RUN', 'FIREBIRD_WRITES=0', 'POLL_INTERVAL_SECONDS=5', 'AGENT_VERSION=1.2.1'
|
'FISCAL_MODE=DRY_RUN', 'FIREBIRD_WRITES=0', 'POLL_INTERVAL_SECONDS=5', 'AGENT_VERSION=1.2.2'
|
||||||
)
|
)
|
||||||
Set-Content -Path $EnvFile -Value $lines -Encoding UTF8
|
Set-Content -Path $EnvFile -Value $lines -Encoding UTF8
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ FB_PASSWORD=
|
|||||||
FISCAL_MODE=DRY_RUN
|
FISCAL_MODE=DRY_RUN
|
||||||
FIREBIRD_WRITES=0
|
FIREBIRD_WRITES=0
|
||||||
POLL_INTERVAL_SECONDS=5
|
POLL_INTERVAL_SECONDS=5
|
||||||
AGENT_VERSION=1.2.1
|
AGENT_VERSION=1.2.2
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ FB_PASSWORD=
|
|||||||
FISCAL_MODE=DRY_RUN
|
FISCAL_MODE=DRY_RUN
|
||||||
FIREBIRD_WRITES=0
|
FIREBIRD_WRITES=0
|
||||||
POLL_INTERVAL_SECONDS=5
|
POLL_INTERVAL_SECONDS=5
|
||||||
AGENT_VERSION=1.2.1
|
AGENT_VERSION=1.2.2
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ FB_PASSWORD=
|
|||||||
FISCAL_MODE=DRY_RUN
|
FISCAL_MODE=DRY_RUN
|
||||||
FIREBIRD_WRITES=0
|
FIREBIRD_WRITES=0
|
||||||
POLL_INTERVAL_SECONDS=5
|
POLL_INTERVAL_SECONDS=5
|
||||||
AGENT_VERSION=1.2.1
|
AGENT_VERSION=1.2.2
|
||||||
|
|||||||
@@ -19,4 +19,4 @@ FB_PASSWORD=
|
|||||||
FISCAL_MODE=DRY_RUN
|
FISCAL_MODE=DRY_RUN
|
||||||
FIREBIRD_WRITES=0
|
FIREBIRD_WRITES=0
|
||||||
POLL_INTERVAL_SECONDS=5
|
POLL_INTERVAL_SECONDS=5
|
||||||
AGENT_VERSION=1.2.1
|
AGENT_VERSION=1.2.2
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# GTI Fiscal Hub — production environment (copy to .env, never commit .env)
|
# GTI Fiscal Hub — production environment (copy to .env, never commit .env)
|
||||||
GTI_FISCAL_VERSION=1.2.1
|
GTI_FISCAL_VERSION=1.2.2
|
||||||
|
|
||||||
# REQUIRED. URL-safe secret (used inside a connection URL): openssl rand -hex 24
|
# REQUIRED. URL-safe secret (used inside a connection URL): openssl rand -hex 24
|
||||||
POSTGRES_PASSWORD=
|
POSTGRES_PASSWORD=
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ../..
|
context: ../..
|
||||||
dockerfile: central/Dockerfile
|
dockerfile: central/Dockerfile
|
||||||
image: gti-fiscal-hub:${GTI_FISCAL_VERSION:-1.2.1}
|
image: gti-fiscal-hub:${GTI_FISCAL_VERSION:-1.2.2}
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ A variável de ambiente `GTI_SSH_PASSWORD`, se existir, tem prioridade. A senha
|
|||||||
## Deploy
|
## Deploy
|
||||||
```
|
```
|
||||||
powershell -ExecutionPolicy Bypass -File .\scripts\deploy_hub.ps1
|
powershell -ExecutionPolicy Bypass -File .\scripts\deploy_hub.ps1
|
||||||
powershell -ExecutionPolicy Bypass -File .\scripts\deploy_hub.ps1 -PublishAgent -Version 1.2.1
|
powershell -ExecutionPolicy Bypass -File .\scripts\deploy_hub.ps1 -PublishAgent -Version 1.2.2
|
||||||
```
|
```
|
||||||
Parâmetros: `-Version` (padrão `release/VERSION`), `-PublishAgent`, `-SkipTests`, `-DryRun`.
|
Parâmetros: `-Version` (padrão `release/VERSION`), `-PublishAgent`, `-SkipTests`, `-DryRun`.
|
||||||
|
|
||||||
|
|||||||
@@ -364,6 +364,17 @@ def cli() -> int:
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
|
def _hide_console():
|
||||||
|
"""The frozen Setup is a console-subsystem exe (needed for --cli); in GUI mode the black console window behind the wizard is noise, so hide it."""
|
||||||
|
try:
|
||||||
|
import ctypes
|
||||||
|
handle = ctypes.windll.kernel32.GetConsoleWindow()
|
||||||
|
if handle:
|
||||||
|
ctypes.windll.user32.ShowWindow(handle, 0)
|
||||||
|
except Exception: # noqa: BLE001 - cosmetic only
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if "--cli" in sys.argv:
|
if "--cli" in sys.argv:
|
||||||
try:
|
try:
|
||||||
@@ -371,6 +382,7 @@ def main():
|
|||||||
except RuntimeError as error:
|
except RuntimeError as error:
|
||||||
print(f"INSTALL_FAIL {error}", file=sys.stderr)
|
print(f"INSTALL_FAIL {error}", file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
_hide_console()
|
||||||
root = tk.Tk()
|
root = tk.Tk()
|
||||||
SetupWizard(root)
|
SetupWizard(root)
|
||||||
root.mainloop()
|
root.mainloop()
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"artifact": "RELEASE_MANIFEST",
|
"artifact": "RELEASE_MANIFEST",
|
||||||
"GTI_FISCAL_VERSION": "1.2.1",
|
"GTI_FISCAL_VERSION": "1.2.2",
|
||||||
"generated_at": "2026-09-25T11:54:55+00:00",
|
"generated_at": "2026-09-25T14:59:09+00:00",
|
||||||
"hub": {
|
"hub": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.2",
|
||||||
"api_compat": "1.0",
|
"api_compat": "1.0",
|
||||||
"engine_version": "0.3.0",
|
"engine_version": "0.3.0",
|
||||||
"decision_version": "mission-04c-ipi-ex-split"
|
"decision_version": "mission-04c-ipi-ex-split"
|
||||||
},
|
},
|
||||||
"agent_version": "1.2.1",
|
"agent_version": "1.2.2",
|
||||||
"fiscal_engine": {
|
"fiscal_engine": {
|
||||||
"ENGINE_VERSION": "0.3.0",
|
"ENGINE_VERSION": "0.3.0",
|
||||||
"DECISION_VERSION": "mission-04c-ipi-ex-split",
|
"DECISION_VERSION": "mission-04c-ipi-ex-split",
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
1.2.1
|
1.2.2
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ sys.path.insert(0, str(ROOT))
|
|||||||
def test_versions_are_coherent_across_hub_agent_and_packages():
|
def test_versions_are_coherent_across_hub_agent_and_packages():
|
||||||
from central.app.version import GTI_FISCAL_VERSION
|
from central.app.version import GTI_FISCAL_VERSION
|
||||||
v = (ROOT / "release" / "VERSION").read_text(encoding="utf-8").strip()
|
v = (ROOT / "release" / "VERSION").read_text(encoding="utf-8").strip()
|
||||||
assert v == GTI_FISCAL_VERSION == "1.2.1"
|
assert v == GTI_FISCAL_VERSION == "1.2.2"
|
||||||
pep = v.replace("-rc", "rc")
|
pep = v.replace("-rc", "rc")
|
||||||
for pp in ("central/pyproject.toml", "agent/pyproject.toml"):
|
for pp in ("central/pyproject.toml", "agent/pyproject.toml"):
|
||||||
assert f'version = "{pep}"' in (ROOT / pp).read_text(encoding="utf-8")
|
assert f'version = "{pep}"' in (ROOT / pp).read_text(encoding="utf-8")
|
||||||
assert '"AGENT_VERSION", "1.2.1"' in (ROOT / "agent" / "scripts" / "run_agent_service.py").read_text(encoding="utf-8")
|
assert '"AGENT_VERSION", "1.2.2"' in (ROOT / "agent" / "scripts" / "run_agent_service.py").read_text(encoding="utf-8")
|
||||||
manifest = ROOT / "release" / "RELEASE_MANIFEST.json"
|
manifest = ROOT / "release" / "RELEASE_MANIFEST.json"
|
||||||
if manifest.exists():
|
if manifest.exists():
|
||||||
m = json.loads(manifest.read_text(encoding="utf-8"))
|
m = json.loads(manifest.read_text(encoding="utf-8"))
|
||||||
|
|||||||
Reference in New Issue
Block a user