"""GitHub release provider stub.

Reserved so the registry advertises the option and the frontend can render the
provider toggle without a follow-up backend release. The full implementation
will mirror :class:`GiteaReleaseProvider` against
``api.github.com/repos/{owner}/{repo}/releases``.
"""

from __future__ import annotations

from typing import ClassVar

import aiohttp

from .base import ReleaseErrorCode, ReleaseInfo, ReleaseProviderKind, ReleaseTestResult


class GitHubReleaseProvider:
    """Not yet implemented — placeholder so the registry is forward-compatible."""

    kind: ClassVar[ReleaseProviderKind] = ReleaseProviderKind.GITHUB

    def __init__(self, session: aiohttp.ClientSession, repo: str) -> None:
        self._session = session
        self._repo = repo

    async def fetch_latest(self, *, include_prereleases: bool = False) -> ReleaseInfo | None:
        # Soft-fail rather than raise — `run_check` already catches
        # NotImplementedError but a None return keeps the persisted
        # `release_error` taxonomy clean (NOT_IMPLEMENTED, not "not impl…").
        return None

    async def test(self) -> ReleaseTestResult:
        return {"ok": False, "info": None, "error": ReleaseErrorCode.NOT_IMPLEMENTED.value}
