CHAT_OUTPUT_BEGIN
COMMAND_ID=GITEA-V4-STAGE-RECONCILE-TRANSACTION-V2-20260730T165915Z
STATUS=FAIL
RC=1
HOST=pve01
MODE=change
COMPONENT=gitea-machine-identity
REFERENCE_REGISTER_CHECK=OK
REFERENCE_SHA256=5763f2f8edc75fcf6f3951f8c95896d1cc112ceccb6cf5b64a383f540a4deb8e
ERROR_REGISTER_CHECK=OK
ERROR_REGISTER_SHA256=24934a2c7fa5c26f6e828583c4aefac7f143b40c0171736ed7571e617d55ab83
COMMAND_SHA256=9ffcea480b54d6707a4308757839917962b95f120e48c04b04f25fc0b25c83a3
DUPLICATE_FAILED_COMMAND_BLOCKED=false
EXECUTION_STARTED=true
CHANGE_DECLARED=true
RESULT_CONTRACT_VALID=true
RESULT_CONTRACT_STATUS=FAIL
RESULT_CONTRACT_ERROR=NONE
COMMAND_RC=1
CHANGES_MADE=false
ROLLBACK_STARTED=false
ROLLBACK_RESTORED=null
MUTATION_OUTCOME=NO_MUTATION
SANITIZED=yes
SECRETS_INCLUDED=no
PRIVATE_ADDRESSES_INCLUDED=no
RAW_EVIDENCE_SHA256=41d148fc79fd258d1a038ea7d8f91bfc9709c7e4af1deb144bedd32e6004c413
SANITIZED_OUTPUT_SHA256=41d148fc79fd258d1a038ea7d8f91bfc9709c7e4af1deb144bedd32e6004c413
OUTPUT_BEGIN
HOMELAB_RESULT_CONTRACT={"changes_made":false,"command_id":"GITEA-V4-STAGE-RECONCILE-TRANSACTION-V2-20260730T165915Z","rollback_restored":null,"rollback_started":false,"status":"FAIL","version":1}
{"PLAN_SHA256":null,"changes_made":false,"command_id":"GITEA-V4-STAGE-RECONCILE-TRANSACTION-V2-20260730T165915Z","error":"RuntimeError: command failed rc=1 argv=/usr/bin/python3 -B -m unittest discover -s /tmp/gitea-v4-reconcile-2aauj_hx/review/tests -v stdout= stderr=(current, dict):\\n        fail('current user response')\\n    actual_login = current.get('login')\\n    if not isinstance(actual_login, str) or not re.fullmatch(r'[A-Za-z0-9_.-]+', actual_login):\\n        fail('current login')\\n    _, permission = client.request(\\n        'GET',\\n        f'/repos/{REPOSITORY}/collaborators/{actual_login}/permission',\\n    )\\n    if not isinstance(permission, dict) or permission.get('permission') != 'admin':\\n        fail('legacy repository permission')\\n    status, _ = client.request(\\n        'GET',\\n        '/users/' + MACHINE_USER,\\n        expected=(200, 404),\\n    )\\n    if status != 404:\\n        fail('machine user already present')\\n    return actual_login\\n\\n\\nparser = argparse.ArgumentParser()\\nparser.add_argument('mode', choices=('inspect', 'grant'))\\nparser.add_argument('--credential-file', required=True)\\nargs = parser.parse_args()\\nlogin_value, material_value = read_credential(Path(args.credential_file))\\nclient = Client(login_value, material_value)\\n\\nif args.mode == 'inspect':\\n    actual_login = inspect(client)\\n    print('LEGACY_IDENTITY_API_STATUS=OK')\\n    print('GITEA_VERSION=1.26.2')\\n    print('LEGACY_AUTHENTICATED_LOGIN=' + actual_login)\\n    print('LEGACY_REPOSITORY_PERMISSION=admin')\\n    print('MACHINE_USER_STATE=ABSENT')\\n    print('API_DEADLINE_SECONDS=10')\\n    raise SystemExit(0)\\n\\n_, version = client.request('GET', '/version', authenticated=False)\\nif not isinstance(version, dict) or version.get('version') != '1.26.2':\\n    fail('Gitea version')\\n_, current = client.request('GET', '/user')\\nif not isinstance(current, dict):\\n    fail('current user response')\\nactual_login = current.get('login')\\nif not isinstance(actual_login, str) or not re.fullmatch(r'[A-Za-z0-9_.-]+', actual_login):\\n    fail('current login')\\n_, legacy_permission = client.request(\\n    'GET',\\n    f'/repos/{REPOSITORY}/collaborators/{actual_login}/permission',\\n)\\nif not isinstance(legacy_permission, dict) or legacy_permission.get('permission') != 'admin':\\n    fail('legacy repository permission')\\n_, machine_user = client.request('GET', '/users/' + MACHINE_USER)\\nif not isinstance(machine_user, dict):\\n    fail('machine user response')\\nif machine_user.get('login') != MACHINE_USER or machine_user.get('is_admin') is not False:\\n    fail('machine user non-admin state')\\nclient.request(\\n    'PUT',\\n    f'/repos/{REPOSITORY}/collaborators/{MACHINE_USER}',\\n    payload={'permission': 'write'},\\n    expected=(204,),\\n)\\n_, permission = client.request(\\n    'GET',\\n    f'/repos/{REPOSITORY}/collaborators/{MACHINE_USER}/permission',\\n)\\nif not isinstance(permission, dict) or permission.get('permission') != 'write':\\n    fail('machine repository permission')\\nprint('LEGACY_IDENTITY_GRANT_STATUS=OK')\\nprint('MACHINE_USER_PRESENT=YES')\\nprint('MACHINE_USER_ADMIN=NO')\\nprint('REPOSITORY_PERMISSION=write')\\n\"\n\n----------------------------------------------------------------------\nRan 20 tests in 0.002s\n\nFAILED (failures=1)\n","mutation_outcome":"NO_MUTATION","rollback_restored":null,"rollback_started":false,"schema":1,"status":"FAIL"}

OUTPUT_END
CHAT_OUTPUT_END
