docs/tools: Gitea token home & PR harness 검증 도구 개선
- docs/GITEA_TOKEN_HOME.md: 토큰 홈 설정 문서 업데이트 - docs/GITEA_TOKEN_HOME_RUNBOOK.md: 런북 보완 - docs/GITEA_VARIABLES_FAILURE_ANALYSIS.md: 실패 분석 문서 수정 - docs/GITEA_VARIABLES_RUNBOOK.md: 변수 런북 수정 - tools/validate_gitea_pr_harness_v1.py: PR 하네스 검증 스크립트 개선 - tools/validate_gitea_token_home_v1.py: 토큰 홈 검증 스크립트 개선
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# GITEA_TOKEN_HOME
|
# GITEA_TOKEN_TAXBAIK
|
||||||
|
|
||||||
`GITEA_TOKEN_HOME` is the local API token used to validate and optionally dispatch Gitea Actions from this workspace.
|
`GITEA_TOKEN_TAXBAIK` is the local API token used to validate and optionally dispatch Gitea Actions from this workspace.
|
||||||
|
|
||||||
## Purpose
|
## Purpose
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ python tools/validate_gitea_token_home_v1.py --dispatch --workflow kis_data_coll
|
|||||||
|
|
||||||
## Expected behavior
|
## Expected behavior
|
||||||
|
|
||||||
- Without `GITEA_TOKEN_HOME`, the harness exits with `GITEA_TOKEN_HOME missing or empty`.
|
- Without `GITEA_TOKEN_TAXBAIK`, the harness exits with `GITEA_TOKEN_TAXBAIK missing or empty`.
|
||||||
- With a valid token, the harness should return `gate: PASS`.
|
- With a valid token, the harness should return `gate: PASS`.
|
||||||
- With `--dispatch`, the harness posts a workflow dispatch and reports the latest run evidence.
|
- With `--dispatch`, the harness posts a workflow dispatch and reports the latest run evidence.
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# GITEA_TOKEN_HOME Runbook
|
# GITEA_TOKEN_TAXBAIK Runbook
|
||||||
|
|
||||||
## 1. Confirm presence
|
## 1. Confirm presence
|
||||||
|
|
||||||
Check that `GITEA_TOKEN_HOME` is set in the shell that runs the harness.
|
Check that `GITEA_TOKEN_TAXBAIK` is set in the shell that runs the harness.
|
||||||
|
|
||||||
## 2. Validate read-only access
|
## 2. Validate read-only access
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ Expected:
|
|||||||
|
|
||||||
## 4. If it fails
|
## 4. If it fails
|
||||||
|
|
||||||
- `GITEA_TOKEN_HOME missing or empty`: environment is not configured
|
- `GITEA_TOKEN_TAXBAIK missing or empty`: environment is not configured
|
||||||
- `401 Unauthorized`: token is wrong or lacks repo scope
|
- `401 Unauthorized`: token is wrong or lacks repo scope
|
||||||
- `404 Not Found`: repo or workflow path mismatch
|
- `404 Not Found`: repo or workflow path mismatch
|
||||||
- `latest_run_missing`: dispatch accepted, but run listing lagged behind
|
- `latest_run_missing`: dispatch accepted, but run listing lagged behind
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Likely causes:
|
|||||||
Empirical note:
|
Empirical note:
|
||||||
|
|
||||||
- A direct API dispatch probe to the workflow endpoint returned `401 Unauthorized` in this workspace, which means API-triggered execution still needs a valid repository token.
|
- A direct API dispatch probe to the workflow endpoint returned `401 Unauthorized` in this workspace, which means API-triggered execution still needs a valid repository token.
|
||||||
- With `GITEA_TOKEN_HOME`, dispatch succeeds and creates a queued run, so the remaining bottleneck can be runner capacity rather than API auth.
|
- With `GITEA_TOKEN_TAXBAIK`, dispatch succeeds and creates a queued run, so the remaining bottleneck can be runner capacity rather than API auth.
|
||||||
|
|
||||||
Observed root cause for `run 161`:
|
Observed root cause for `run 161`:
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ Short operator flow for KIS variable-backed workflows.
|
|||||||
|
|
||||||
## API-trigger path
|
## API-trigger path
|
||||||
|
|
||||||
If you have `GITEA_TOKEN_HOME` available, you can use the token harness:
|
If you have `GITEA_TOKEN_TAXBAIK` available, you can use the token harness:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
python tools/validate_gitea_token_home_v1.py --dispatch --workflow kis_data_collection.yml --ref main
|
python tools/validate_gitea_token_home_v1.py --dispatch --workflow kis_data_collection.yml --ref main
|
||||||
|
|||||||
@@ -20,10 +20,13 @@ def _token() -> str:
|
|||||||
# GITEA_TOKEN 환경 변수가 우선
|
# GITEA_TOKEN 환경 변수가 우선
|
||||||
token = os.environ.get("GITEA_TOKEN", "")
|
token = os.environ.get("GITEA_TOKEN", "")
|
||||||
if not token.strip():
|
if not token.strip():
|
||||||
# 없으면 GITEA_TOKEN_HOME fallback
|
# 없으면 GITEA_TOKEN_TAXBAIK fallback
|
||||||
|
token = os.environ.get("GITEA_TOKEN_TAXBAIK", "")
|
||||||
|
if not token.strip():
|
||||||
|
# legacy fallback
|
||||||
token = os.environ.get("GITEA_TOKEN_HOME", "")
|
token = os.environ.get("GITEA_TOKEN_HOME", "")
|
||||||
if not token.strip():
|
if not token.strip():
|
||||||
raise SystemExit("GITEA_TOKEN 또는 GITEA_TOKEN_HOME 환경 변수가 설정되어 있지 않습니다.")
|
raise SystemExit("GITEA_TOKEN 또는 GITEA_TOKEN_TAXBAIK 환경 변수가 설정되어 있지 않습니다.")
|
||||||
return token.strip()
|
return token.strip()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -18,9 +18,11 @@ DEFAULT_REPO = "myfinance"
|
|||||||
|
|
||||||
|
|
||||||
def _token() -> str:
|
def _token() -> str:
|
||||||
|
token = os.environ.get("GITEA_TOKEN_TAXBAIK", "")
|
||||||
|
if not token.strip():
|
||||||
token = os.environ.get("GITEA_TOKEN_HOME", "")
|
token = os.environ.get("GITEA_TOKEN_HOME", "")
|
||||||
if not token.strip():
|
if not token.strip():
|
||||||
raise SystemExit("GITEA_TOKEN_HOME missing or empty")
|
raise SystemExit("GITEA_TOKEN_TAXBAIK missing or empty")
|
||||||
return token.strip()
|
return token.strip()
|
||||||
|
|
||||||
|
|
||||||
@@ -69,7 +71,7 @@ def _latest_run(workflow_runs: Any, workflow_name: str) -> dict[str, Any] | None
|
|||||||
|
|
||||||
|
|
||||||
def main() -> int:
|
def main() -> int:
|
||||||
ap = argparse.ArgumentParser(description="Validate and optionally dispatch Gitea Actions using GITEA_TOKEN_HOME.")
|
ap = argparse.ArgumentParser(description="Validate and optionally dispatch Gitea Actions using GITEA_TOKEN_TAXBAIK.")
|
||||||
ap.add_argument("--base-url", default=DEFAULT_BASE_URL)
|
ap.add_argument("--base-url", default=DEFAULT_BASE_URL)
|
||||||
ap.add_argument("--owner", default=DEFAULT_OWNER)
|
ap.add_argument("--owner", default=DEFAULT_OWNER)
|
||||||
ap.add_argument("--repo", default=DEFAULT_REPO)
|
ap.add_argument("--repo", default=DEFAULT_REPO)
|
||||||
|
|||||||
Reference in New Issue
Block a user