You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Model GitHub API enum fields as StrEnum in the async client (DataDog#24316)
* Model GitHub API enum fields as StrEnum in the async client
Convert response-model fields the GitHub OpenAPI description (pinned to
GITHUB_API_VERSION 2022-11-28) declares as an enum into StrEnums, per the
github_async guidelines:
- PullRequestState (open, closed) for PullRequest.state
- WorkflowJobStatus / WorkflowJobConclusion for WorkflowJob
- JobStepStatus (3-value) for JobStep.status (JobStep.conclusion has no
declared enum, kept str | None)
- CheckRunStatus / CheckRunConclusion for CheckRun
WorkflowRun.status/conclusion and GitHubUser.type declare no enum in the
description, so they stay free-form strings. Add WorkflowRun.is_completed
helper, retype update_check_run's conclusion param, and cover the new field
types in the async client unit tests.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add changelog entry
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Sort model re-exports (ruff isort)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Change changelog entry type to fixed
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Use auto() for StrEnum values in the async GitHub models
Every member's declared value equals its lowercased name, and StrEnum's auto()
generates exactly that, so this is behavior-preserving. Also document in the
folder AGENTS.md when auto() applies and when values must stay explicit.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Add stale conclusion; refactor github_async client tests to endpoint-level coverage
- Add STALE to CheckRunConclusion: GitHub can return conclusion="stale" on a
check run (present in the update-a-check-run request enum/docs though omitted
from the response schema), so the model must accept it.
- Drop the model-only tests that just exercised Pydantic; move enum-type
coverage into the endpoint tests (parametrized over the API response), where a
broken model breaks a real client test.
- Standardize every payload-builder helper on the **overrides pattern and merge
the duplicate workflow-job builder into one.
- Fill endpoint-coverage gaps: get_pull_request (success/headers/http_error) and
create/update_check_run http-error tests; fold is_completed into a
parametrized test_get_workflow_run_success.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Drop leading underscores from test helpers in test_github_async.py
Non-public module-level helpers and constants don't need a privacy
underscore prefix; it's noise. Applies the convention from PR DataDog#24253
review to this branch's test file.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* Give test payload builders explicit params instead of bare **overrides
Each fixture builder now names the fields it expects and keeps a trailing
**extra for injected/unknown fields, so callers can see the accepted
parameters from the signature without scrolling to the definition.
Addresses review feedback on PR DataDog#24316; call sites are unchanged.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments