Files
cc-ci/tests/gitea/recipe_meta.py
autonomic-bot 51c3280163
Some checks failed
continuous-integration/drone/push Build is failing
feat(drone): enroll drone + gitea SCM dep (M1 implementation)
- tests/gitea/recipe_meta.py: gitea as install-time dep provider; sqlite3
  overlay EXTRA_ENV, health path /api/healthz, relaxed access for CI use
- tests/drone/recipe_meta.py: DEPS=["gitea"]; health /healthz; 600s timeout
- tests/drone/install_steps.sh: wires GITEA_CLIENT_ID + GITEA_DOMAIN +
  client_secret Docker secret + DRONE_USER_CREATE before single drone deploy
- tests/drone/functional/test_scm_configured.py: Playwright-free SCM test —
  follows /login redirect, asserts final URL is gitea dep's OAuth2 authorize
  endpoint with matching client_id (per Adversary pre-probe REVIEW-drone.md)
- tests/drone/PARITY.md: backup structural-skip justified (no backupbot labels)
- runner/harness/sso.py: setup_gitea_oauth() — creates gitea admin user via
  CLI + OAuth2 app via API, returns {admin_user, admin_password, client_id,
  client_secret} for install_steps.sh consumption
- runner/run_recipe_ci.py: _enrich_deps_with_sso now handles gitea dep (calls
  setup_gitea_oauth; keycloak path unchanged)
- tests/unit/test_gitea_dep.py: unit tests for gitea dep path — meta loading,
  SSO routing, SCM redirect assertion logic (parametrized)
- machine-docs: STATUS/JOURNAL/BACKLOG-drone.md phase state files initialized

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-11 21:31:43 +00:00

53 lines
2.5 KiB
Python

# Per-recipe harness config for gitea when used as an install-time dep provider (phase drone).
# Gitea is not enrolled as a standalone recipe-under-test here — it serves as the SCM backend
# that drone requires to boot. The harness deploys it before drone, provisions an admin user +
# OAuth2 app inside it (sso.setup_gitea_oauth), and tears it down after.
#
# Database: sqlite3 (via compose.sqlite3.yml overlay) — no MariaDB needed for a CI dep; lighter
# resource footprint, and the gitea data persists only for the duration of the drone test run.
HEALTH_PATH = "/api/healthz"
HEALTH_OK = (200,)
DEPLOY_TIMEOUT = 600
HTTP_TIMEOUT = 600
def EXTRA_ENV(ctx):
# Use sqlite3 (no external DB dep), and relax access controls so the harness can create the
# admin user and OAuth2 app via API immediately after deploy.
return {
"COMPOSE_FILE": "compose.yml:compose.sqlite3.yml",
"GITEA_APP_NAME": "CI Dep Gitea",
"GITEA_ALLOW_ONLY_EXTERNAL_REGISTRATION": "false",
"GITEA_AUTO_WATCH_NEW_REPOS": "false",
"GITEA_DISABLE_REGISTRATION": "false",
"GITEA_ENABLE_NOTIFY_MAIL": "false",
"GITEA_ENABLE_OPENID_SIGNIN": "false",
"GITEA_ENABLE_OPENID_SIGNUP": "false",
"GITEA_DISABLE_GRAVATAR": "true",
"GITEA_ENABLE_FEDERATED_AVATAR": "false",
# Not requiring sign-in lets the /api/healthz endpoint work without a session.
"GITEA_REQUIRE_SIGNIN_VIEW": "false",
"GITEA_LANDING_PAGE": "explore",
"GITEA_SHOW_USER_EMAIL": "false",
"GITEA_DISABLE_REGULAR_ORG_CREATION": "false",
"GITEA_DEFAULT_KEEP_EMAIL_PRIVATE": "false",
"GITEA_DEFAULT_ALLOW_CREATE_ORGANIZATION": "true",
"GITEA_ENABLE_USER_HEATMAP": "false",
"GITEA_DEFAULT_USER_VISIBILITY": "public",
"GITEA_ALLOWED_USER_VISIBILITY_MODES": "public,limited,private",
"GITEA_DEFAULT_ORG_VISIBILITY": "public",
"GITEA_SSH_PORT": "2222",
"GITEA_REPO_UPLOAD_ENABLED": "false",
"GITEA_REPO_UPLOAD_ALLOWED_TYPES": "",
"GITEA_REPO_UPLOAD_MAX_SIZE": "0",
"GITEA_REPO_UPLOAD_MAX_FILES": "0",
"GITEA_ENABLE_PUSH_CREATE_USER": "false",
"GITEA_ENABLE_PUSH_CREATE_ORG": "false",
"GITEA_LFS_START_SERVER": "false",
# CORS allow-domain — left empty; OAuth2 redirects are not CORS-gated.
"GITEA_CORS_ALLOW_DOMAIN": "",
# Mailer placeholder — required by app.ini.tmpl but SMTP is not enabled.
"GITEA_MAILER_FROM": "noreply@ci.local",
"GITEA_MAILER_USER": "noreply@ci.local",
}