From 8226a31793f9dbb9bfdb22f4ca9ad936b6dc497f Mon Sep 17 00:00:00 2001 From: jingrow Date: Wed, 24 Dec 2025 01:24:09 +0800 Subject: [PATCH] update JCLOUDE to JCLOUDE --- .github/workflows/main.yaml | 8 ++++---- dashboard/tests-e2e/tests/dashboard/auth.setup.ts | 4 ++-- jcloude/api/client.py | 2 +- jcloude/auth.py | 14 +++++++------- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 31dc92df..f0db27cd 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -90,8 +90,8 @@ jobs: name: Client runs-on: ubuntu-latest env: - JCLOUDE _ADMIN_USER_EMAIL: playwright@example.com - JCLOUDE _ADMIN_USER_PASSWORD: playwright + JCLOUDE_ADMIN_USER_EMAIL: playwright@example.com + JCLOUDE_ADMIN_USER_PASSWORD: playwright BASE_URL: http://test_site:8000 services: @@ -169,8 +169,8 @@ jobs: working-directory: /home/runner/jingrow-bench/apps/jcloude/dashboard run: | bench --site test_site execute jcloude.jcloude.pagetype.team.test_team.create_test_jcloude_admin_team \ - --kwargs "{\"email\": \"${JCLOUDE _ADMIN_USER_EMAIL}\", \"free_account\": True, \"skip_onboarding\": True}" - bench --site test_site set-password "$JCLOUDE _ADMIN_USER_EMAIL" "$JCLOUDE _ADMIN_USER_PASSWORD" + --kwargs "{\"email\": \"${JCLOUDE_ADMIN_USER_EMAIL}\", \"free_account\": True, \"skip_onboarding\": True}" + bench --site test_site set-password "$JCLOUDE_ADMIN_USER_EMAIL" "$JCLOUDE_ADMIN_USER_PASSWORD" - name: Run Playwright Tests working-directory: /home/runner/jingrow-bench/apps/jcloude/dashboard diff --git a/dashboard/tests-e2e/tests/dashboard/auth.setup.ts b/dashboard/tests-e2e/tests/dashboard/auth.setup.ts index 707c8a8d..2052792c 100644 --- a/dashboard/tests-e2e/tests/dashboard/auth.setup.ts +++ b/dashboard/tests-e2e/tests/dashboard/auth.setup.ts @@ -4,8 +4,8 @@ import { fileURLToPath } from 'url'; import { test as setup } from "./coverage.fixture"; const localCloudBaseUrl = process.env.BASE_URL!; -const userEmail = process.env.JCLOUDE _ADMIN_USER_EMAIL!; -const userPassword = process.env.JCLOUDE _ADMIN_USER_PASSWORD!; +const userEmail = process.env.JCLOUDE_ADMIN_USER_EMAIL!; +const userPassword = process.env.JCLOUDE_ADMIN_USER_PASSWORD!; const sessionStoragePath = process.env.PLAYWRIGHT_SESSION_STORAGE_PATH || '../../.auth/session.json'; function getSessionStorageStatePath() { diff --git a/jcloude/api/client.py b/jcloude/api/client.py index 44d69815..f8213b39 100644 --- a/jcloude/api/client.py +++ b/jcloude/api/client.py @@ -488,7 +488,7 @@ def check_permissions(pagetype): if not hasattr(jingrow.local, "team") or not jingrow.local.team(): jingrow.throw( - "current_team is not set. Use X-JCLOUDE -TEAM header in the request to set it.", + "current_team is not set. Use X-JCLOUDE-TEAM header in the request to set it.", TeamHeaderNotInRequestError, ) diff --git a/jcloude/auth.py b/jcloude/auth.py index 09e0024f..81f48cf9 100644 --- a/jcloude/auth.py +++ b/jcloude/auth.py @@ -7,8 +7,8 @@ import traceback import jingrow -JCLOUDE _AUTH_KEY = "jcloude-auth-logs" -JCLOUDE _AUTH_MAX_ENTRIES = 1000000 +JCLOUDE_AUTH_KEY = "jcloude-auth-logs" +JCLOUDE_AUTH_MAX_ENTRIES = 1000000 ALLOWED_PATHS = [ @@ -110,23 +110,23 @@ def log(path, user_type): "referer": jingrow.request.headers.get("Referer", ""), } - if jingrow.cache().llen(JCLOUDE _AUTH_KEY) > JCLOUDE _AUTH_MAX_ENTRIES: - jingrow.cache().ltrim(JCLOUDE _AUTH_KEY, 1, -1) + if jingrow.cache().llen(JCLOUDE_AUTH_KEY) > JCLOUDE_AUTH_MAX_ENTRIES: + jingrow.cache().ltrim(JCLOUDE_AUTH_KEY, 1, -1) serialized = json.dumps(data, sort_keys=True, default=str) - jingrow.cache().rpush(JCLOUDE _AUTH_KEY, serialized) + jingrow.cache().rpush(JCLOUDE_AUTH_KEY, serialized) def flush(): log_file = os.path.join(jingrow.utils.get_bench_path(), "logs", "jcloude.auth.json.log") try: # Fetch all entries without removing from cache - logs = jingrow.cache().lrange(JCLOUDE _AUTH_KEY, 0, -1) + logs = jingrow.cache().lrange(JCLOUDE_AUTH_KEY, 0, -1) if logs: logs = list(map(jingrow.safe_decode, logs)) with open(log_file, "a", os.O_NONBLOCK) as f: f.write("\n".join(logs)) f.write("\n") # Remove fetched entries from cache - jingrow.cache().ltrim(JCLOUDE _AUTH_KEY, len(logs) - 1, -1) + jingrow.cache().ltrim(JCLOUDE_AUTH_KEY, len(logs) - 1, -1) except Exception: traceback.print_exc()