Skip to content

Commit e83ee91

Browse files
authored
Merge branch 'main' into feat-add-blocked-events
2 parents 7cdebea + c44dd1b commit e83ee91

7 files changed

Lines changed: 90 additions & 19 deletions

File tree

‎csfunctions/actions/start_workflow.py‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@
22

33
from pydantic import BaseModel, Field
44

5+
from ..subject import Subject
56
from .base import ActionNames, BaseAction
67

78

8-
class Subject(BaseModel):
9-
subject_id: str = Field(..., description="ID of the subject, eg. a role name or personalnummer")
10-
subject_type: Literal["Person", "PCS Role", "Common Role"] = Field(
11-
..., description="Type of the subject: Person, PCS Role or Common Role"
12-
)
13-
14-
159
class TaskConfiguration(BaseModel):
1610
task_id: str = Field(..., description="Identifier for the task")
1711
responsible: Subject | None = Field(default=None, description="Responsible subject for the task")

‎csfunctions/events/document_release_check.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pydantic import BaseModel, Field
44

55
from csfunctions.objects import Document, Part
6+
from csfunctions.subject import Subject
67

78
from .base import BaseEvent, EventNames
89
from .dialog_data import DocumentReleasedDialogData
@@ -12,6 +13,10 @@ class DocumentReleaseCheckData(BaseModel):
1213
documents: list[Document] = Field(..., description="List of documents that will be released.")
1314
parts: list[Part] = Field(..., description="List of parts that belong to the documents")
1415
dialog_data: DocumentReleasedDialogData
16+
reviewers: list[Subject] = Field(
17+
default_factory=list,
18+
description="List of reviewers assigned to the release. Only populated for express releases.",
19+
)
1520

1621

1722
class DocumentReleaseCheckEvent(BaseEvent):

‎csfunctions/events/part_release_check.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pydantic import BaseModel, Field
44

55
from csfunctions.objects import Document, Part
6+
from csfunctions.subject import Subject
67

78
from .base import BaseEvent, EventNames
89
from .dialog_data import PartReleasedDialogData
@@ -12,6 +13,10 @@ class PartReleaseCheckData(BaseModel):
1213
parts: list[Part] = Field(..., description="List of parts that will be released.")
1314
documents: list[Document] = Field(..., description="List of documents that are referenced by the parts.")
1415
dialog_data: PartReleasedDialogData
16+
reviewers: list[Subject] = Field(
17+
default_factory=list,
18+
description="List of reviewers assigned to the release. Only populated for express releases.",
19+
)
1520

1621

1722
class PartReleaseCheckEvent(BaseEvent):

‎csfunctions/subject.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from typing import Literal
2+
3+
from pydantic import BaseModel, Field
4+
5+
6+
class Subject(BaseModel):
7+
subject_id: str = Field(..., description="ID of the subject, eg. a role name or personalnummer")
8+
subject_type: Literal["Person", "PCS Role", "Common Role"] = Field(
9+
..., description="Type of the subject: Person, PCS Role or Common Role"
10+
)

‎docs/reference/events.md‎

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ Be aware that the document is not released yet and the release might still be ab
5454

5555
**DocumentReleaseCheckEvent.data:**
5656

57-
| Attribute | Type | Description |
58-
| ----------- | ------------------------------------- | ------------------------------------------- |
59-
| documents | list[[Document](objects.md#document)] | List of documents that will be released. |
60-
| parts | list[[Part](objects.md#part)] | List of parts that belong to the documents. |
61-
| dialog_data | DocumentReleaseDialogData | Contents of the dialog. |
57+
| Attribute | Type | Description |
58+
| ----------- | ------------------------------------- | -------------------------------------------------------------------------------- |
59+
| documents | list[[Document](objects.md#document)] | List of documents that will be released. |
60+
| parts | list[[Part](objects.md#part)] | List of parts that belong to the documents. |
61+
| dialog_data | DocumentReleaseDialogData | Contents of the dialog. |
62+
| reviewers | list[Subject] | List of reviewers assigned to the release. Only populated for express releases. |
6263

6364
**DocumentReleaseCheckDialogData:**
6465

@@ -67,6 +68,13 @@ Be aware that the document is not released yet and the release might still be ab
6768
| cdbprot_remark | str \| None | Remark |
6869
| cdb_ec_id | str \| None | Engineering Change ID |
6970

71+
**Subject:**
72+
73+
| Attribute | Type | Description |
74+
| ------------ | ---- | ------------------------------------------------------------------ |
75+
| subject_id | str | ID of the subject, e.g. a role name or "personalnummer" |
76+
| subject_type | str | Type of the subject. Can be "Person", "PCS Role" or "Common Role" |
77+
7078
## DocumentReleasedEvent
7179
`csfunctions.events.DocumentReleasedEvent`
7280

@@ -382,11 +390,12 @@ Be aware that the part is not released yet and the release might still be aborte
382390

383391
**PartReleaseCheckEvent.data:**
384392

385-
| Attribute | Type | Description |
386-
| ----------- | ------------------------------------- | ---------------------------------------------------- |
387-
| parts | list[[Part](objects.md#part)] | List of parts that will released. |
388-
| documents | list[[Document](objects.md#document)] | List of documents that belong to the released parts. |
389-
| dialog_data | PartReleaseDialogData | Contents of the dialog. |
393+
| Attribute | Type | Description |
394+
| ----------- | ------------------------------------- | -------------------------------------------------------------------------------- |
395+
| parts | list[[Part](objects.md#part)] | List of parts that will released. |
396+
| documents | list[[Document](objects.md#document)] | List of documents that belong to the released parts. |
397+
| dialog_data | PartReleaseDialogData | Contents of the dialog. |
398+
| reviewers | list[Subject] | List of reviewers assigned to the release. Only populated for express releases. |
390399

391400
**PartReleaseCheckDialogData:**
392401

@@ -395,6 +404,13 @@ Be aware that the part is not released yet and the release might still be aborte
395404
| cdbprot_remark | str \| None | Remark |
396405
| cdb_ec_id | str \| None | Engineering Change ID |
397406

407+
**Subject:**
408+
409+
| Attribute | Type | Description |
410+
| ------------ | ---- | ------------------------------------------------------------------ |
411+
| subject_id | str | ID of the subject, e.g. a role name or "personalnummer" |
412+
| subject_type | str | Type of the subject. Can be "Person", "PCS Role" or "Common Role" |
413+
398414

399415
## PartReleasedEvent
400416
`csfunctions.events.PartReleasedEvent`

‎docs/release_notes.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ hide:
33
- toc
44
---
55

6-
### Version 0.27.0
7-
- Feat: Add part_blocked and document_blocked events
86

97
### Version 0.26.0
108
- Feat: Extend all multi-language object fields with Japanese (ja) and Chinese (zh) variants
9+
- Feat: Add part_blocked and document_blocked events
10+
- Feat: Add reviewers field to PartReleaseCheckEvent and DocumentReleaseCheckEvent, populated for express releases
1111

1212
### Version 0.25.0
1313
- Feat: Add change objects (ChangeOrder and ChangeRequest) with their release and status change events

‎json_schemas/request.json‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7463,6 +7463,14 @@
74637463
},
74647464
"dialog_data": {
74657465
"$ref": "#/$defs/DocumentReleasedDialogData"
7466+
},
7467+
"reviewers": {
7468+
"description": "List of reviewers assigned to the release. Only populated for express releases.",
7469+
"items": {
7470+
"$ref": "#/$defs/Subject"
7471+
},
7472+
"title": "Reviewers",
7473+
"type": "array"
74667474
}
74677475
},
74687476
"required": [
@@ -11237,6 +11245,14 @@
1123711245
},
1123811246
"dialog_data": {
1123911247
"$ref": "#/$defs/PartReleasedDialogData"
11248+
},
11249+
"reviewers": {
11250+
"description": "List of reviewers assigned to the release. Only populated for express releases.",
11251+
"items": {
11252+
"$ref": "#/$defs/Subject"
11253+
},
11254+
"title": "Reviewers",
11255+
"type": "array"
1124011256
}
1124111257
},
1124211258
"required": [
@@ -11363,6 +11379,31 @@
1136311379
"title": "PartReleasedEvent",
1136411380
"type": "object"
1136511381
},
11382+
"Subject": {
11383+
"properties": {
11384+
"subject_id": {
11385+
"description": "ID of the subject, eg. a role name or personalnummer",
11386+
"title": "Subject Id",
11387+
"type": "string"
11388+
},
11389+
"subject_type": {
11390+
"description": "Type of the subject: Person, PCS Role or Common Role",
11391+
"enum": [
11392+
"Person",
11393+
"PCS Role",
11394+
"Common Role"
11395+
],
11396+
"title": "Subject Type",
11397+
"type": "string"
11398+
}
11399+
},
11400+
"required": [
11401+
"subject_id",
11402+
"subject_type"
11403+
],
11404+
"title": "Subject",
11405+
"type": "object"
11406+
},
1136611407
"Workflow": {
1136711408
"properties": {
1136811409
"object_type": {

0 commit comments

Comments
 (0)