docs(ISSUE-WP-0006): Forgejo-only language and projection boundary
Prefer Forgejo as the self-hosted forge product. Keep Gitea only as the Gitea-compatible API identifier (module backends/gitea, type string gitea). FORGEJO_TOKEN is preferred; GITEA_* remains a deprecated alias. INTENT/SCOPE quote ACT-ADR-005: issue-core is not the fleet ops claim queue. Connector docs describe repo work record → hub index → optional Forgejo projection, not activity-core → issue-core → harness. Assistant: grok Assistant-Session: 01a09dc6-3f0d-7c93-8b11-8e83c0623d49
This commit is contained in:
parent
f9d276dadf
commit
ee9b85215d
34 changed files with 410 additions and 263 deletions
|
|
@ -12,6 +12,23 @@ from .utils import (
|
|||
echo_error, echo_warning, echo_info, confirm_action
|
||||
)
|
||||
|
||||
# Preferred FORGEJO_*; GITEA_* remain deprecated aliases (ISSUE-WP-0006).
|
||||
_FORGE_TOKEN_ENV_NAMES = (
|
||||
'FORGEJO_TOKEN',
|
||||
'FORGEJO_API_TOKEN',
|
||||
'GITEA_API_TOKEN',
|
||||
'GITEA_TOKEN',
|
||||
)
|
||||
|
||||
|
||||
def _forge_token_from_env():
|
||||
"""Return (env_name, token) for the first set Forgejo/legacy token var."""
|
||||
for name in _FORGE_TOKEN_ENV_NAMES:
|
||||
value = os.getenv(name)
|
||||
if value:
|
||||
return name, value
|
||||
return None, None
|
||||
|
||||
|
||||
@click.group()
|
||||
def backend_group():
|
||||
|
|
@ -46,14 +63,19 @@ def add_backend(ctx, name, backend_type):
|
|||
'db_path': str(db_path)
|
||||
}
|
||||
elif backend_type == 'gitea':
|
||||
base_url = click.prompt('Gitea base URL (e.g., https://git.example.com)')
|
||||
base_url = click.prompt('Forgejo base URL (Gitea-compatible API)')
|
||||
owner = click.prompt('Repository owner/organization')
|
||||
repo = click.prompt('Repository name')
|
||||
|
||||
# Check for API token in environment variable first
|
||||
env_token = os.getenv('GITEA_API_TOKEN')
|
||||
env_name, env_token = _forge_token_from_env()
|
||||
if env_token:
|
||||
click.echo(f"Using API token from GITEA_API_TOKEN environment variable")
|
||||
if env_name in ('GITEA_API_TOKEN', 'GITEA_TOKEN'):
|
||||
click.echo(
|
||||
f"Using API token from {env_name} "
|
||||
"(deprecated alias; prefer FORGEJO_TOKEN)"
|
||||
)
|
||||
else:
|
||||
click.echo(f"Using API token from {env_name} environment variable")
|
||||
token = env_token
|
||||
else:
|
||||
token = click.prompt('Access token', hide_input=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue