update JCLOUDE to JCLOUDE

This commit is contained in:
jingrow 2025-12-24 01:24:09 +08:00
parent bedad8d095
commit 8226a31793
4 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -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() {

View File

@ -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,
)

View File

@ -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()