From a7647887ca83045f11e88271c3642479394d8f29 Mon Sep 17 00:00:00 2001 From: thanhnv Date: Fri, 24 Jul 2026 16:36:17 +0700 Subject: [PATCH] fix: clarify optional integration status --- VERSION | 2 +- packages/casan-devkit/casan-init.py | 13 +++++++++++-- packages/casan-devkit/tests/hybrid-install-tests.sh | 5 +++++ .../tests/phase-upgrade-compatibility-tests.sh | 6 +++--- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 6d7de6e..21e8796 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.2 +1.0.3 diff --git a/packages/casan-devkit/casan-init.py b/packages/casan-devkit/casan-init.py index 2af16fe..0f25fb3 100755 --- a/packages/casan-devkit/casan-init.py +++ b/packages/casan-devkit/casan-init.py @@ -107,6 +107,10 @@ def _warn_mark(): return _color("33", "!") +def _neutral_mark(): + return _color("2", "–") + + def _heading(text): print(_color("1;36", text)) @@ -145,8 +149,13 @@ def _render_init(result): print() print(_color("1", "Integrations")) for path, status in result["hook_merges"].items(): - ok = status not in (None, "absent") - print(" %s %-26s %s" % (_mark(ok), path, status or "unavailable")) + if status in ("absent", "skipped"): + marker = _neutral_mark() + display = "not needed" + else: + marker = _mark(status is not None) + display = status or "unavailable" + print(" %s %-26s %s" % (marker, path, display)) extension = result["vscode_extension"] if extension.get("status") not in ("skipped",): ok = extension.get("status") == "installed" diff --git a/packages/casan-devkit/tests/hybrid-install-tests.sh b/packages/casan-devkit/tests/hybrid-install-tests.sh index af75b42..0177446 100755 --- a/packages/casan-devkit/tests/hybrid-install-tests.sh +++ b/packages/casan-devkit/tests/hybrid-install-tests.sh @@ -469,6 +469,11 @@ echo "$INIT_OUT" | grep -q "CASAN initialized" \ echo "$INIT_OUT" | grep -q "Runtime.*Managed" \ && pass "init output clearly identifies managed runtime and path" \ || fail "init output hides runtime placement ($INIT_OUT)" +if echo "$INIT_OUT" | grep -q "✗"; then + fail "init output shows a false integration failure ($INIT_OUT)" +else + pass "optional integrations use a neutral status instead of a false failure" +fi if echo "$INIT_OUT" | head -1 | grep -q '^[[:space:]]*{'; then fail "init still defaults to raw JSON" else diff --git a/packages/casan-harness/tests/phase-upgrade-compatibility-tests.sh b/packages/casan-harness/tests/phase-upgrade-compatibility-tests.sh index d7cf6c1..89159ff 100755 --- a/packages/casan-harness/tests/phase-upgrade-compatibility-tests.sh +++ b/packages/casan-harness/tests/phase-upgrade-compatibility-tests.sh @@ -6,8 +6,8 @@ S="$CASAN_HARNESS_ROOT/scripts/bash/upgrade-compatibility.sh" M="$CASAN_APP_ROOT/infra/production/compatibility-matrix.json" PASS=0; FAIL=0 pass(){ echo "PASS: $1"; PASS=$((PASS+1)); }; fail(){ echo "FAIL: $1"; FAIL=$((FAIL+1)); } -if bash "$S" check --from 1.0.1 --to 1.0.2 --matrix "$M" | grep -q '"decision": "allow"'; then pass "patch upgrade is explicitly allowed"; else fail "patch upgrade denied"; fi -if bash "$S" check --from 1.0.2 --to 1.0.1 --rollback --matrix "$M" | grep -q '"rollback": true'; then pass "approved rollback is explicitly allowed"; else fail "approved rollback denied"; fi -if bash "$S" check --from 1.0.2 --to 2.0.0 --matrix "$M" >/dev/null 2>&1; then fail "unreviewed major upgrade accepted"; else pass "unreviewed major upgrade denied"; fi +if bash "$S" check --from 1.0.2 --to 1.0.3 --matrix "$M" | grep -q '"decision": "allow"'; then pass "patch upgrade is explicitly allowed"; else fail "patch upgrade denied"; fi +if bash "$S" check --from 1.0.3 --to 1.0.2 --rollback --matrix "$M" | grep -q '"rollback": true'; then pass "approved rollback is explicitly allowed"; else fail "approved rollback denied"; fi +if bash "$S" check --from 1.0.3 --to 2.0.0 --matrix "$M" >/dev/null 2>&1; then fail "unreviewed major upgrade accepted"; else pass "unreviewed major upgrade denied"; fi if bash "$S" check --from invalid --to 1.0.0 --matrix "$M" >/dev/null 2>&1; then fail "invalid version accepted"; else pass "invalid version denied"; fi echo "===== UPGRADE COMPATIBILITY SUMMARY: PASS=$PASS FAIL=$FAIL ====="; [[ "$FAIL" -eq 0 ]]