Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/app-discovery-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on:
- scripts/build_catalog.py
- scripts/test_sitemap_route_integrity.py
- scripts/test_sitemap_growth_freshness.py
- scripts/test_live_smoke_diagnostics.py
- site_counts.json
- tests/catalog-growth.test.mjs
- tests/japanese-quick-games-discovery.test.mjs
Expand Down Expand Up @@ -68,6 +69,7 @@ on:
- scripts/build_catalog.py
- scripts/test_sitemap_route_integrity.py
- scripts/test_sitemap_growth_freshness.py
- scripts/test_live_smoke_diagnostics.py
- site_counts.json
- tests/catalog-growth.test.mjs
- tests/catalog-positioning-regression.test.mjs
Expand Down Expand Up @@ -95,6 +97,8 @@ jobs:
run: python3 scripts/build_catalog.py --check
- name: Verify sitemap URLs, source HTML and canonical integrity
run: python3 -m unittest scripts.test_sitemap_route_integrity scripts.test_sitemap_growth_freshness -v
- name: Verify live failure inventory stays read-only and fail-closed
run: python3 -m unittest scripts.test_live_smoke_diagnostics -v
- name: Verify non-destructive release scripts have valid shell syntax
run: bash -n scripts/publish_app_discovery.sh scripts/check_app_discovery_live.sh scripts/publish_stale_policy_pages.sh
- name: Verify search, referral links and guide listings
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/live-acquisition-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,59 @@ jobs:
set -euo pipefail
echo 'Checking public appdevelopsk.com, NOT source on GitHub main.'
bash scripts/check_app_discovery_live.sh
- name: Inventory all stale public routes (read-only, after failed smoke)
if: failure()
shell: bash
run: |
set -uo pipefail
# Diagnostic GETs are explicitly labeled bots. They never fire GA4
# browser events and do not add campaign UTMs or mutate the VPS.
python3 scripts/diagnose_growth_routes.py --timeout 7 --output growth-route-diagnosis.json || true
python3 scripts/diagnose_growth_deploy.py --timeout 7 --output growth-deploy-diagnosis.json || true
python3 - <<'PY'
import json
import os
from pathlib import Path
routes = Path('growth-route-diagnosis.json')
deploy = Path('growth-deploy-diagnosis.json')
lines = ['## Independent public route inventory', '']
if routes.exists():
data = json.loads(routes.read_text(encoding='utf-8'))
lines += [
f"Catalog locale deployed: {not data.get('catalog_locale_needs_review', True)}",
f"Catalog /apps and /apps.html aliases agree: {not data.get('apps_alias_needs_review', True)}",
'Press page readiness (HTTP, canonical, lang, tracking & sitemap):',
]
for path, ready in data.get('press_routes_ready', {}).items():
lines.append(f"- {path}: {'PASS' if ready else 'STALE or unverified'}")
else:
lines.append('Route diagnostic could not create a report.')
if deploy.exists():
data = json.loads(deploy.read_text(encoding='utf-8'))
lines += [
'',
'Source/live HTML SHA-256 comparison (not exact release-SHA proof):',
f"{data.get('identical_pages', 0)}/{data.get('checked_pages', 0)} byte-identical routes",
]
for path, result in data.get('pages', {}).items():
if not result.get('bytes_equal'):
lines.append(f"- {path}: HTTP {result.get('http_status')}, mismatch or error")
else:
lines.append('Source/live diagnostic could not create a report.')
lines += ['', 'This diagnostic never deploys, requests indexing, posts to SNS or verifies GA4/store installs.']
with open(os.environ['GITHUB_STEP_SUMMARY'], 'a', encoding='utf-8') as f:
f.write('\n'.join(lines) + '\n')
PY
- name: Attach machine-readable public route diagnostics
if: failure()
uses: actions/upload-artifact@v4
with:
name: appsite-live-route-inventory-${{ github.run_id }}
path: |
growth-route-diagnosis.json
growth-deploy-diagnosis.json
if-no-files-found: warn
retention-days: 7
- name: Summarize release blockers and recovery
if: failure()
run: |
Expand Down
60 changes: 60 additions & 0 deletions scripts/test_live_smoke_diagnostics.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
"""Read-only CI workflow contract for public app site release diagnostics."""
from pathlib import Path
import unittest

ROOT = Path(__file__).resolve().parents[1]
WORKFLOW = ROOT / ".github" / "workflows" / "live-acquisition-smoke.yml"
SOURCE_FILES = (
ROOT / "scripts" / "diagnose_growth_routes.py",
ROOT / "scripts" / "diagnose_growth_deploy.py",
)


class LiveFailureInventoryTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.yaml = WORKFLOW.read_text(encoding="utf-8")

def test_diagnostics_only_after_failed_public_smoke(self):
source = self.yaml
smoke = source.index(" - name: Check actual VPS HTTP pages")
inventory = source.index(" - name: Inventory all stale public routes")
upload = source.index(" - name: Attach machine-readable public route diagnostics")
summary = source.index(" - name: Summarize release blockers and recovery")
self.assertLess(smoke, inventory)
self.assertLess(inventory, upload)
self.assertLess(upload, summary)
self.assertIn("if: failure()", source[inventory:upload])
self.assertIn("if: failure()", source[upload:summary])

def test_inventory_runs_only_existing_readonly_public_checkers(self):
source = self.yaml.split(" - name: Inventory all stale public routes", 1)[1]
block = source.split(" - name: Attach machine-readable public route diagnostics", 1)[0]
self.assertIn("python3 scripts/diagnose_growth_routes.py --timeout 7 --output growth-route-diagnosis.json", block)
self.assertIn("python3 scripts/diagnose_growth_deploy.py --timeout 7 --output growth-deploy-diagnosis.json", block)
self.assertIn("GITHUB_STEP_SUMMARY", block)
self.assertIn("press_routes_ready", block)
self.assertIn("bytes_equal", block)
for command in ("--apply", "workflow_dispatch", "rsync ", "git push", "indexnow", "curl --request POST"):
self.assertNotIn(command, block)
for path in SOURCE_FILES:
self.assertTrue(path.exists(), str(path))

def test_failures_are_not_masked_and_structured_logs_retained(self):
source = self.yaml
self.assertIn("bash scripts/check_app_discovery_live.sh", source)
self.assertIn("actions/upload-artifact@v4", source)
self.assertIn("appsite-live-route-inventory-", source)
self.assertIn("growth-route-diagnosis.json", source)
self.assertIn("growth-deploy-diagnosis.json", source)
self.assertIn("retention-days: 7", source)
self.assertNotIn("continue-on-error: true", source)

def test_never_confuse_release_diagnostics_with_genuine_traffic(self):
source = self.yaml
self.assertIn("This diagnostic never deploys, requests indexing, posts to SNS or verifies GA4/store installs.", source)
self.assertIn("Source/live HTML SHA-256 comparison (not exact release-SHA proof)", source)


if __name__ == "__main__":
unittest.main()
Loading