From 1f1933af1970e30b13e96af1110746f21ac1c336 Mon Sep 17 00:00:00 2001 From: alrayyes <511318+alrayyes@users.noreply.github.com> Date: Thu, 19 Nov 2026 13:44:37 +0000 Subject: [PATCH] fix: regenerate client from updated forge-dashboard spec --- openapi/SPEC_COMMIT | 2 +- openapi/openapi.yaml | 89 ++++++++- .../api/dashboard/get_issue_details.py | 16 ++ .../_generated/models/__init__.py | 10 + .../_generated/models/issue_details.py | 31 +++ .../_generated/models/item_reference.py | 177 ++++++++++++++++++ .../models/item_reference_direction.py | 8 + .../_generated/models/item_reference_kind.py | 8 + .../models/item_reference_relation.py | 9 + .../_generated/models/item_reference_state.py | 9 + 10 files changed, 357 insertions(+), 2 deletions(-) create mode 100644 src/forge_dashboard/_generated/models/item_reference.py create mode 100644 src/forge_dashboard/_generated/models/item_reference_direction.py create mode 100644 src/forge_dashboard/_generated/models/item_reference_kind.py create mode 100644 src/forge_dashboard/_generated/models/item_reference_relation.py create mode 100644 src/forge_dashboard/_generated/models/item_reference_state.py diff --git a/openapi/SPEC_COMMIT b/openapi/SPEC_COMMIT index d0e1c96..cbc5d1f 100644 --- a/openapi/SPEC_COMMIT +++ b/openapi/SPEC_COMMIT @@ -1 +1 @@ -50f4e7209fed7ace6ffe7783de2d7256c3c5150a +09b6a56224f78d418ae63daf0120b134b34be455 diff --git a/openapi/openapi.yaml b/openapi/openapi.yaml index 195c010..322cb25 100644 --- a/openapi/openapi.yaml +++ b/openapi/openapi.yaml @@ -2546,6 +2546,10 @@ paths: one for each comment's reactions (up to 50), so the reaction calls run at most eight at a time and stop at the first rate limit. + `references` lists the items that refer to the issue. GitHub adds + them to the same query; Forgejo reads the issue's timeline once more, one + request per page of 50 events and an empty one to end on. + Every text is Markdown exactly as the forge stores it (`format` is always `markdown`). The server neither converts nor sanitises it, so a client must render it with raw HTML disabled. Each text is cut at @@ -5812,7 +5816,15 @@ components: IssueDetails: type: object required: - [kind, state, description, comments, commentCount, commentsTruncated] + [ + kind, + state, + description, + comments, + commentCount, + commentsTruncated, + references, + ] description: What the issue dialog shows. properties: kind: @@ -5848,6 +5860,81 @@ components: commentsTruncated: type: boolean description: True when `commentCount` is more than the comments returned. + references: + type: array + maxItems: 50 + items: + $ref: "#/components/schemas/ItemReference" + description: | + The items that refer to this one, as the forge's own timeline + records them, newest first, at most the first 50. They are read + from the forge, so a closed or merged item shows them as well as an + open one: the board's own pills list open pull requests only. An + empty array means nothing refers to it. Only the entries whose + `direction` is `incoming` are returned for now; `outgoing` is part + of the contract so a later release can add what this item refers + to without another change. + + ItemReference: + type: object + required: + [ + forge, + repo, + number, + title, + url, + pageUrl, + kind, + state, + direction, + relation, + ] + description: One issue or pull request that is related to the item whose details were asked for. + properties: + forge: + $ref: "#/components/schemas/Forge" + repo: + type: string + description: The related item's repository as `owner/name`, which is not always the asked-for item's own. + number: + type: integer + minimum: 1 + title: + type: string + description: The related item's title, as the forge has it now. + url: + type: string + description: The related item's address on the forge. + pageUrl: + type: string + description: | + The address on this dashboard that opens the related item's pop-up: + `/pull-requests.html?pr=` or `/issues.html?issue=`, then + `forge/owner/name/number`. A relative address. + kind: + type: string + enum: [issue, pullRequest] + description: What the related number is. A forge shares one number space between the two. + state: + type: string + enum: [open, closed, merged] + description: Where the related item stands. Only a pull request is `merged`; `closed` means closed without merging. + direction: + type: string + enum: [incoming, outgoing] + description: | + `incoming` when the related item refers to the asked-for one, + `outgoing` when the asked-for one refers to it. + relation: + type: string + enum: [closes, refs, mentions] + description: | + What the referring item does to the referred-to one. `closes` + closes it when merged (a closing keyword). `refs` references it + without closing it (`Refs`, `Related to`, `See`). `mentions` only + names it. The forge's timeline does not tell the last two apart, + so a read from it says `mentions` for both. IssuePullRequest: type: object diff --git a/src/forge_dashboard/_generated/api/dashboard/get_issue_details.py b/src/forge_dashboard/_generated/api/dashboard/get_issue_details.py index 7cd6f5c..74ae9d0 100644 --- a/src/forge_dashboard/_generated/api/dashboard/get_issue_details.py +++ b/src/forge_dashboard/_generated/api/dashboard/get_issue_details.py @@ -136,6 +136,10 @@ def sync_detailed( one for each comment's reactions (up to 50), so the reaction calls run at most eight at a time and stop at the first rate limit. + `references` lists the items that refer to the issue. GitHub adds + them to the same query; Forgejo reads the issue's timeline once more, one + request per page of 50 events and an empty one to end on. + Every text is Markdown exactly as the forge stores it (`format` is always `markdown`). The server neither converts nor sanitises it, so a client must render it with raw HTML disabled. Each text is cut at @@ -201,6 +205,10 @@ def sync( one for each comment's reactions (up to 50), so the reaction calls run at most eight at a time and stop at the first rate limit. + `references` lists the items that refer to the issue. GitHub adds + them to the same query; Forgejo reads the issue's timeline once more, one + request per page of 50 events and an empty one to end on. + Every text is Markdown exactly as the forge stores it (`format` is always `markdown`). The server neither converts nor sanitises it, so a client must render it with raw HTML disabled. Each text is cut at @@ -261,6 +269,10 @@ async def asyncio_detailed( one for each comment's reactions (up to 50), so the reaction calls run at most eight at a time and stop at the first rate limit. + `references` lists the items that refer to the issue. GitHub adds + them to the same query; Forgejo reads the issue's timeline once more, one + request per page of 50 events and an empty one to end on. + Every text is Markdown exactly as the forge stores it (`format` is always `markdown`). The server neither converts nor sanitises it, so a client must render it with raw HTML disabled. Each text is cut at @@ -326,6 +338,10 @@ async def asyncio( one for each comment's reactions (up to 50), so the reaction calls run at most eight at a time and stop at the first rate limit. + `references` lists the items that refer to the issue. GitHub adds + them to the same query; Forgejo reads the issue's timeline once more, one + request per page of 50 events and an empty one to end on. + Every text is Markdown exactly as the forge stores it (`format` is always `markdown`). The server neither converts nor sanitises it, so a client must render it with raw HTML disabled. Each text is cut at diff --git a/src/forge_dashboard/_generated/models/__init__.py b/src/forge_dashboard/_generated/models/__init__.py index 2d6b40c..77b67c0 100644 --- a/src/forge_dashboard/_generated/models/__init__.py +++ b/src/forge_dashboard/_generated/models/__init__.py @@ -72,6 +72,11 @@ from .issue_pull_request import IssuePullRequest from .issue_pull_request_state import IssuePullRequestState from .issue_relation import IssueRelation +from .item_reference import ItemReference +from .item_reference_direction import ItemReferenceDirection +from .item_reference_kind import ItemReferenceKind +from .item_reference_relation import ItemReferenceRelation +from .item_reference_state import ItemReferenceState from .label import Label from .linked_pull_request import LinkedPullRequest from .main_branch import MainBranch @@ -217,6 +222,11 @@ "IssuePullRequest", "IssuePullRequestState", "IssueRelation", + "ItemReference", + "ItemReferenceDirection", + "ItemReferenceKind", + "ItemReferenceRelation", + "ItemReferenceState", "Label", "LinkedPullRequest", "MainBranch", diff --git a/src/forge_dashboard/_generated/models/issue_details.py b/src/forge_dashboard/_generated/models/issue_details.py index 999603f..f364c0f 100644 --- a/src/forge_dashboard/_generated/models/issue_details.py +++ b/src/forge_dashboard/_generated/models/issue_details.py @@ -17,6 +17,7 @@ from ..models.details_body import DetailsBody from ..models.details_comment import DetailsComment from ..models.issue_pull_request import IssuePullRequest + from ..models.item_reference import ItemReference @@ -43,6 +44,14 @@ class IssueDetails: comments (list[DetailsComment]): The conversation, oldest first, at most the first 50. comment_count (int): How many comments the forge has on the issue. comments_truncated (bool): True when `commentCount` is more than the comments returned. + references (list[ItemReference]): The items that refer to this one, as the forge's own timeline + records them, newest first, at most the first 50. They are read + from the forge, so a closed or merged item shows them as well as an + open one: the board's own pills list open pull requests only. An + empty array means nothing refers to it. Only the entries whose + `direction` is `incoming` are returned for now; `outgoing` is part + of the contract so a later release can add what this item refers + to without another change. pull_request (IssuePullRequest | Unset): Present only when `kind` is `pullRequest`: what the header of a pull request needs when the board has no row for it, because it is closed, merged or in a repository the board doesn't track. The dialog words it. @@ -54,6 +63,7 @@ class IssueDetails: comments: list[DetailsComment] comment_count: int comments_truncated: bool + references: list[ItemReference] pull_request: IssuePullRequest | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -65,6 +75,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.details_body import DetailsBody # noqa: PLC0415 from ..models.details_comment import DetailsComment # noqa: PLC0415 from ..models.issue_pull_request import IssuePullRequest # noqa: PLC0415 + from ..models.item_reference import ItemReference # noqa: PLC0415 kind = self.kind.value state = self.state.value @@ -82,6 +93,13 @@ def to_dict(self) -> dict[str, Any]: comments_truncated = self.comments_truncated + references = [] + for references_item_data in self.references: + references_item = references_item_data.to_dict() + references.append(references_item) + + + pull_request: dict[str, Any] | Unset = UNSET if not isinstance(self.pull_request, Unset): pull_request = self.pull_request.to_dict() @@ -96,6 +114,7 @@ def to_dict(self) -> dict[str, Any]: "comments": comments, "commentCount": comment_count, "commentsTruncated": comments_truncated, + "references": references, }) if pull_request is not UNSET: field_dict["pullRequest"] = pull_request @@ -109,6 +128,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.details_body import DetailsBody # noqa: PLC0415 from ..models.details_comment import DetailsComment # noqa: PLC0415 from ..models.issue_pull_request import IssuePullRequest # noqa: PLC0415 + from ..models.item_reference import ItemReference # noqa: PLC0415 d = dict(src_dict) kind = IssueDetailsKind(d.pop("kind")) @@ -139,6 +159,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: comments_truncated = d.pop("commentsTruncated") + references = [] + _references = d.pop("references") + for references_item_data in (_references): + references_item = ItemReference.from_dict(references_item_data) + + + + references.append(references_item) + + _pull_request = d.pop("pullRequest", UNSET) pull_request: IssuePullRequest | Unset if isinstance(_pull_request, Unset): @@ -156,6 +186,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: comments=comments, comment_count=comment_count, comments_truncated=comments_truncated, + references=references, pull_request=pull_request, ) diff --git a/src/forge_dashboard/_generated/models/item_reference.py b/src/forge_dashboard/_generated/models/item_reference.py new file mode 100644 index 0000000..a68364c --- /dev/null +++ b/src/forge_dashboard/_generated/models/item_reference.py @@ -0,0 +1,177 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, BinaryIO, TextIO, TYPE_CHECKING, Generator + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +from ..models.forge import Forge +from ..models.item_reference_direction import ItemReferenceDirection +from ..models.item_reference_kind import ItemReferenceKind +from ..models.item_reference_relation import ItemReferenceRelation +from ..models.item_reference_state import ItemReferenceState + + + + + + +T = TypeVar("T", bound="ItemReference") + + + +@_attrs_define +class ItemReference: + """ One issue or pull request that is related to the item whose details were asked for. + + Attributes: + forge (Forge): + repo (str): The related item's repository as `owner/name`, which is not always the asked-for item's own. + number (int): + title (str): The related item's title, as the forge has it now. + url (str): The related item's address on the forge. + page_url (str): The address on this dashboard that opens the related item's pop-up: + `/pull-requests.html?pr=` or `/issues.html?issue=`, then + `forge/owner/name/number`. A relative address. + kind (ItemReferenceKind): What the related number is. A forge shares one number space between the two. + state (ItemReferenceState): Where the related item stands. Only a pull request is `merged`; `closed` means + closed without merging. + direction (ItemReferenceDirection): `incoming` when the related item refers to the asked-for one, + `outgoing` when the asked-for one refers to it. + relation (ItemReferenceRelation): What the referring item does to the referred-to one. `closes` + closes it when merged (a closing keyword). `refs` references it + without closing it (`Refs`, `Related to`, `See`). `mentions` only + names it. The forge's timeline does not tell the last two apart, + so a read from it says `mentions` for both. + """ + + forge: Forge + repo: str + number: int + title: str + url: str + page_url: str + kind: ItemReferenceKind + state: ItemReferenceState + direction: ItemReferenceDirection + relation: ItemReferenceRelation + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + + + + + def to_dict(self) -> dict[str, Any]: + forge = self.forge.value + + repo = self.repo + + number = self.number + + title = self.title + + url = self.url + + page_url = self.page_url + + kind = self.kind.value + + state = self.state.value + + direction = self.direction.value + + relation = self.relation.value + + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({ + "forge": forge, + "repo": repo, + "number": number, + "title": title, + "url": url, + "pageUrl": page_url, + "kind": kind, + "state": state, + "direction": direction, + "relation": relation, + }) + + return field_dict + + + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + forge = Forge(d.pop("forge")) + + + + + repo = d.pop("repo") + + number = d.pop("number") + + title = d.pop("title") + + url = d.pop("url") + + page_url = d.pop("pageUrl") + + kind = ItemReferenceKind(d.pop("kind")) + + + + + state = ItemReferenceState(d.pop("state")) + + + + + direction = ItemReferenceDirection(d.pop("direction")) + + + + + relation = ItemReferenceRelation(d.pop("relation")) + + + + + item_reference = cls( + forge=forge, + repo=repo, + number=number, + title=title, + url=url, + page_url=page_url, + kind=kind, + state=state, + direction=direction, + relation=relation, + ) + + + item_reference.additional_properties = d + return item_reference + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/src/forge_dashboard/_generated/models/item_reference_direction.py b/src/forge_dashboard/_generated/models/item_reference_direction.py new file mode 100644 index 0000000..be50c7e --- /dev/null +++ b/src/forge_dashboard/_generated/models/item_reference_direction.py @@ -0,0 +1,8 @@ +from enum import StrEnum + +class ItemReferenceDirection(StrEnum): + INCOMING = "incoming" + OUTGOING = "outgoing" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/forge_dashboard/_generated/models/item_reference_kind.py b/src/forge_dashboard/_generated/models/item_reference_kind.py new file mode 100644 index 0000000..506aa62 --- /dev/null +++ b/src/forge_dashboard/_generated/models/item_reference_kind.py @@ -0,0 +1,8 @@ +from enum import StrEnum + +class ItemReferenceKind(StrEnum): + ISSUE = "issue" + PULLREQUEST = "pullRequest" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/forge_dashboard/_generated/models/item_reference_relation.py b/src/forge_dashboard/_generated/models/item_reference_relation.py new file mode 100644 index 0000000..2815e89 --- /dev/null +++ b/src/forge_dashboard/_generated/models/item_reference_relation.py @@ -0,0 +1,9 @@ +from enum import StrEnum + +class ItemReferenceRelation(StrEnum): + CLOSES = "closes" + MENTIONS = "mentions" + REFS = "refs" + + def __str__(self) -> str: + return str(self.value) diff --git a/src/forge_dashboard/_generated/models/item_reference_state.py b/src/forge_dashboard/_generated/models/item_reference_state.py new file mode 100644 index 0000000..6333af3 --- /dev/null +++ b/src/forge_dashboard/_generated/models/item_reference_state.py @@ -0,0 +1,9 @@ +from enum import StrEnum + +class ItemReferenceState(StrEnum): + CLOSED = "closed" + MERGED = "merged" + OPEN = "open" + + def __str__(self) -> str: + return str(self.value)