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
51 changes: 51 additions & 0 deletions openapi.public.json
Original file line number Diff line number Diff line change
Expand Up @@ -2462,6 +2462,43 @@
],
"type": "object"
},
"EarlierOpenFinding": {
"description": "A published occurrence of an unresolved series absent from the current run.",
"properties": {
"finding_id": {
"description": "The occurrence in the series' first published review.",
"format": "uuid",
"type": "string"
},
"finding_series_id": {
"description": "The unresolved environment finding series counted for this run.",
"format": "uuid",
"type": "string"
},
"review_id": {
"description": "The first published review containing this occurrence.",
"format": "uuid",
"type": "string"
},
"run_number": {
"description": "The earlier pull-request run that contains this occurrence.",
"format": "int64",
"type": "integer"
},
"severity": {
"description": "Severity used by the series count; the linked occurrence may be less severe.",
"type": "string"
}
},
"required": [
"finding_series_id",
"finding_id",
"review_id",
"run_number",
"severity"
],
"type": "object"
},
"EvidenceView": {
"enum": [
"REQUIRED_PROPERTIES_ESTABLISHED",
Expand Down Expand Up @@ -3921,6 +3958,13 @@
"minimum": 0,
"type": "integer"
},
"earlier_findings": {
"description": "Exact published occurrences of earlier unresolved environment findings.",
"items": {
"$ref": "#/components/schemas/EarlierOpenFinding"
},
"type": "array"
},
"not_assessed": {
"description": "Recorded assessment gaps, including explicit policy exclusions.",
"items": {
Expand Down Expand Up @@ -4823,6 +4867,13 @@
"null"
]
},
"earlier_findings": {
"description": "Exact published occurrences of earlier unresolved environment findings.\n Absent from observations recorded before destinations were captured.",
"items": {
"$ref": "#/components/schemas/EarlierOpenFinding"
},
"type": "array"
},
"environments": {
"description": "This review's environment assessments that are not `COMPLETED`, ordered\n by environment key.",
"items": {
Expand Down
2 changes: 2 additions & 0 deletions proofline/_generated/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
from .deep_review_escalation import DeepReviewEscalation
from .deep_review_escalation_status import DeepReviewEscalationStatus
from .domain_view import DomainView
from .earlier_open_finding import EarlierOpenFinding
from .evidence_view import EvidenceView
from .export_evidence_kind import ExportEvidenceKind
from .export_evidence_ref import ExportEvidenceRef
Expand Down Expand Up @@ -226,6 +227,7 @@
"DeepReviewEscalation",
"DeepReviewEscalationStatus",
"DomainView",
"EarlierOpenFinding",
"EvidenceView",
"ExportEvidenceKind",
"ExportEvidenceRef",
Expand Down
95 changes: 95 additions & 0 deletions proofline/_generated/models/earlier_open_finding.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
from __future__ import annotations

from collections.abc import Mapping
from typing import Any, TypeVar
from uuid import UUID

from attrs import define as _attrs_define
from attrs import field as _attrs_field

T = TypeVar("T", bound="EarlierOpenFinding")


@_attrs_define
class EarlierOpenFinding:
"""A published occurrence of an unresolved series absent from the current run.

Attributes:
finding_id (UUID): The occurrence in the series' first published review.
finding_series_id (UUID): The unresolved environment finding series counted for this run.
review_id (UUID): The first published review containing this occurrence.
run_number (int): The earlier pull-request run that contains this occurrence.
severity (str): Severity used by the series count; the linked occurrence may be less severe.
"""

finding_id: UUID
finding_series_id: UUID
review_id: UUID
run_number: int
severity: str
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
finding_id = str(self.finding_id)

finding_series_id = str(self.finding_series_id)

review_id = str(self.review_id)

run_number = self.run_number

severity = self.severity

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
{
"finding_id": finding_id,
"finding_series_id": finding_series_id,
"review_id": review_id,
"run_number": run_number,
"severity": severity,
}
)

return field_dict

@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
d = dict(src_dict)
finding_id = UUID(d.pop("finding_id"))

finding_series_id = UUID(d.pop("finding_series_id"))

review_id = UUID(d.pop("review_id"))

run_number = d.pop("run_number")

severity = d.pop("severity")

earlier_open_finding = cls(
finding_id=finding_id,
finding_series_id=finding_series_id,
review_id=review_id,
run_number=run_number,
severity=severity,
)

earlier_open_finding.additional_properties = d
return earlier_open_finding

@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
26 changes: 26 additions & 0 deletions proofline/_generated/models/open_items_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
from attrs import define as _attrs_define
from attrs import field as _attrs_field

from ..types import UNSET, Unset

if TYPE_CHECKING:
from ..models.earlier_open_finding import EarlierOpenFinding
from ..models.not_assessed_view import NotAssessedView


Expand All @@ -27,12 +30,15 @@ class OpenItemsView:
earlier published series of the pull request that this review did not
find again.
serious_findings (int): The `SERIOUS` findings among `open_findings`.
earlier_findings (list[EarlierOpenFinding] | Unset): Exact published occurrences of earlier unresolved
environment findings.
"""

accepted_risks: int
not_assessed: list[NotAssessedView]
open_findings: int
serious_findings: int
earlier_findings: list[EarlierOpenFinding] | Unset = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
Expand All @@ -47,6 +53,13 @@ def to_dict(self) -> dict[str, Any]:

serious_findings = self.serious_findings

earlier_findings: list[dict[str, Any]] | Unset = UNSET
if not isinstance(self.earlier_findings, Unset):
earlier_findings = []
for earlier_findings_item_data in self.earlier_findings:
earlier_findings_item = earlier_findings_item_data.to_dict()
earlier_findings.append(earlier_findings_item)

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)
field_dict.update(
Expand All @@ -57,11 +70,14 @@ def to_dict(self) -> dict[str, Any]:
"serious_findings": serious_findings,
}
)
if earlier_findings is not UNSET:
field_dict["earlier_findings"] = earlier_findings

return field_dict

@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.earlier_open_finding import EarlierOpenFinding # noqa: PLC0415
from ..models.not_assessed_view import NotAssessedView # noqa: PLC0415

d = dict(src_dict)
Expand All @@ -78,11 +94,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:

serious_findings = d.pop("serious_findings")

_earlier_findings = d.pop("earlier_findings", UNSET)
earlier_findings: list[EarlierOpenFinding] | Unset = UNSET
if _earlier_findings is not UNSET:
earlier_findings = []
for earlier_findings_item_data in _earlier_findings:
earlier_findings_item = EarlierOpenFinding.from_dict(earlier_findings_item_data)

earlier_findings.append(earlier_findings_item)

open_items_view = cls(
accepted_risks=accepted_risks,
not_assessed=not_assessed,
open_findings=open_findings,
serious_findings=serious_findings,
earlier_findings=earlier_findings,
)

open_items_view.additional_properties = d
Expand Down
25 changes: 25 additions & 0 deletions proofline/_generated/models/review_open_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from ..types import UNSET, Unset

if TYPE_CHECKING:
from ..models.earlier_open_finding import EarlierOpenFinding
from ..models.open_finding_counts import OpenFindingCounts
from ..models.open_item_environment import OpenItemEnvironment
from ..models.open_items_threads_type_0 import OpenItemsThreadsType0
Expand Down Expand Up @@ -46,6 +47,9 @@ class ReviewOpenItems:
`current_head_sha` comes from. Null when none is recorded.
current_head_sha (None | str | Unset): The pull request's head commit as Proofline last recorded it from
GitHub. Null when no pull request state is recorded.
earlier_findings (list[EarlierOpenFinding] | Unset): Exact published occurrences of earlier unresolved
environment findings.
Absent from observations recorded before destinations were captured.
latest_review_head_sha (None | str | Unset): The head commit of the newest review of this pull request the
caller
can see. Null when that review recorded none.
Expand All @@ -65,6 +69,7 @@ class ReviewOpenItems:
threads: OpenItemsThreadsType0 | OpenItemsThreadsType1
current_head_provider_updated_at: datetime.datetime | None | Unset = UNSET
current_head_sha: None | str | Unset = UNSET
earlier_findings: list[EarlierOpenFinding] | Unset = UNSET
latest_review_head_sha: None | str | Unset = UNSET
reviewed_head_sha: None | str | Unset = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
Expand Down Expand Up @@ -113,6 +118,13 @@ def to_dict(self) -> dict[str, Any]:
else:
current_head_sha = self.current_head_sha

earlier_findings: list[dict[str, Any]] | Unset = UNSET
if not isinstance(self.earlier_findings, Unset):
earlier_findings = []
for earlier_findings_item_data in self.earlier_findings:
earlier_findings_item = earlier_findings_item_data.to_dict()
earlier_findings.append(earlier_findings_item)

latest_review_head_sha: None | str | Unset
if isinstance(self.latest_review_head_sha, Unset):
latest_review_head_sha = UNSET
Expand Down Expand Up @@ -145,6 +157,8 @@ def to_dict(self) -> dict[str, Any]:
field_dict["current_head_provider_updated_at"] = current_head_provider_updated_at
if current_head_sha is not UNSET:
field_dict["current_head_sha"] = current_head_sha
if earlier_findings is not UNSET:
field_dict["earlier_findings"] = earlier_findings
if latest_review_head_sha is not UNSET:
field_dict["latest_review_head_sha"] = latest_review_head_sha
if reviewed_head_sha is not UNSET:
Expand All @@ -154,6 +168,7 @@ def to_dict(self) -> dict[str, Any]:

@classmethod
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
from ..models.earlier_open_finding import EarlierOpenFinding # noqa: PLC0415
from ..models.open_finding_counts import OpenFindingCounts # noqa: PLC0415
from ..models.open_item_environment import OpenItemEnvironment # noqa: PLC0415
from ..models.open_items_threads_type_0 import OpenItemsThreadsType0 # noqa: PLC0415
Expand Down Expand Up @@ -230,6 +245,15 @@ def _parse_current_head_sha(data: object) -> None | str | Unset:

current_head_sha = _parse_current_head_sha(d.pop("current_head_sha", UNSET))

_earlier_findings = d.pop("earlier_findings", UNSET)
earlier_findings: list[EarlierOpenFinding] | Unset = UNSET
if _earlier_findings is not UNSET:
earlier_findings = []
for earlier_findings_item_data in _earlier_findings:
earlier_findings_item = EarlierOpenFinding.from_dict(earlier_findings_item_data)

earlier_findings.append(earlier_findings_item)

def _parse_latest_review_head_sha(data: object) -> None | str | Unset:
if data is None:
return data
Expand Down Expand Up @@ -263,6 +287,7 @@ def _parse_reviewed_head_sha(data: object) -> None | str | Unset:
threads=threads,
current_head_provider_updated_at=current_head_provider_updated_at,
current_head_sha=current_head_sha,
earlier_findings=earlier_findings,
latest_review_head_sha=latest_review_head_sha,
reviewed_head_sha=reviewed_head_sha,
)
Expand Down
Loading