Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion openapi/SPEC_COMMIT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
50f4e7209fed7ace6ffe7783de2d7256c3c5150a
09b6a56224f78d418ae63daf0120b134b34be455
89 changes: 88 additions & 1 deletion openapi/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions src/forge_dashboard/_generated/api/dashboard/get_issue_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions src/forge_dashboard/_generated/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -217,6 +222,11 @@
"IssuePullRequest",
"IssuePullRequestState",
"IssueRelation",
"ItemReference",
"ItemReferenceDirection",
"ItemReferenceKind",
"ItemReferenceRelation",
"ItemReferenceState",
"Label",
"LinkedPullRequest",
"MainBranch",
Expand Down
31 changes: 31 additions & 0 deletions src/forge_dashboard/_generated/models/issue_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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



Expand All @@ -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.
Expand All @@ -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)

Expand All @@ -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
Expand All @@ -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()
Expand All @@ -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
Expand All @@ -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"))

Expand Down Expand Up @@ -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):
Expand All @@ -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,
)

Expand Down
Loading