Skip to content

Commit e69d36d

Browse files
JulusianCopilot
andcommitted
simplify
Co-authored-by: Copilot <copilot@github.com>
1 parent e985fbb commit e69d36d

5 files changed

Lines changed: 8 additions & 46 deletions

File tree

‎apps/package-manager-api/asyncapi/asyncapi.yaml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,6 @@ operations:
104104
$ref: './operations/from-consumer.yaml#/sendPackageContainerRemoved'
105105

106106
# Consumer receives from PM
107-
receiveExpectationStatusAdded:
108-
$ref: './operations/from-consumer.yaml#/receiveExpectationStatusAdded'
109107
receiveExpectationStatusUpdated:
110108
$ref: './operations/from-consumer.yaml#/receiveExpectationStatusUpdated'
111109
receiveExpectationStatusRemoved:

‎apps/package-manager-api/asyncapi/channels/from-pm.yaml‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ workStatuses:
1010
address: workStatuses
1111
title: Work Statuses Channel
1212
description: >
13-
The Package Manager sends CRUD-delta events for ExpectationStatus objects
14-
over this channel. The consumer maintains a live view of all expectation statuses,
15-
keyed by ExpectationId.
13+
The Package Manager sends upsert and removed events for ExpectationStatus
14+
objects over this channel. The consumer maintains a live view of all
15+
expectation statuses, keyed by ExpectationId.
1616
messages:
17-
ExpectationStatusAdded:
18-
$ref: '../components/messages/from-pm-messages.yaml#/ExpectationStatusAdded'
1917
ExpectationStatusUpdated:
2018
$ref: '../components/messages/from-pm-messages.yaml#/ExpectationStatusUpdated'
2119
ExpectationStatusRemoved:

‎apps/package-manager-api/asyncapi/components/messages/from-pm-messages.yaml‎

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Messages sent FROM the Package Manager TO the consumer.
22
#
3-
# Three event channels (CRUD deltas) plus two event channels for package-info:
4-
# - workStatuses (ExpectationStatus CRUD, keyed by ExpectationId)
3+
# Three event channels plus two event channels for package-info:
4+
# - workStatuses (ExpectationStatus upsert/remove, keyed by ExpectationId)
55
# - containerStatuses (PackageContainerStatus update/remove)
66
# - containerPackageStatuses (PackageContainerPackageStatus update/remove)
77
# - packageInfo (PackageInfo update/remove — fire and forget)
@@ -12,28 +12,10 @@
1212
# ---------------------------------------------------------------------------
1313
# workStatuses channel messages
1414
# ---------------------------------------------------------------------------
15-
ExpectationStatusAdded:
16-
name: ExpectationStatusAdded
17-
title: Expectation Status Added
18-
summary: Status reporting has started for a new Expectation.
19-
contentType: application/json
20-
payload:
21-
type: object
22-
required:
23-
- event
24-
- status
25-
properties:
26-
event:
27-
type: string
28-
const: added
29-
status:
30-
$ref: '../schemas/statuses.yaml#/ExpectationStatus'
31-
additionalProperties: false
32-
3315
ExpectationStatusUpdated:
3416
name: ExpectationStatusUpdated
3517
title: Expectation Status Updated
36-
summary: The status of an Expectation has changed (state, progress, reason, etc.).
18+
summary: Upsert the status of an Expectation. The consumer creates or replaces the stored status keyed by ExpectationId.
3719
contentType: application/json
3820
payload:
3921
type: object

‎apps/package-manager-api/asyncapi/operations/from-consumer.yaml‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,13 @@ sendPackageContainerRemoved:
3939
summary: The consumer notifies the PM that a PackageContainerExpectation has been removed.
4040

4141
# The consumer receives status events from the PM:
42-
receiveExpectationStatusAdded:
43-
action: receive
44-
channel:
45-
$ref: '../channels/from-pm.yaml#/workStatuses'
46-
messages:
47-
- $ref: '../channels/from-pm.yaml#/workStatuses/messages/ExpectationStatusAdded'
48-
summary: The consumer receives a new ExpectationStatus from the PM.
49-
5042
receiveExpectationStatusUpdated:
5143
action: receive
5244
channel:
5345
$ref: '../channels/from-pm.yaml#/workStatuses'
5446
messages:
5547
- $ref: '../channels/from-pm.yaml#/workStatuses/messages/ExpectationStatusUpdated'
56-
summary: The consumer receives an updated ExpectationStatus from the PM.
48+
summary: The consumer upserts (creates or replaces) an ExpectationStatus from the PM.
5749

5850
receiveExpectationStatusRemoved:
5951
action: receive

‎apps/package-manager-api/asyncapi/operations/from-pm.yaml‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,13 @@ receivePackageContainerRemoved:
4040
summary: PM receives notification that a PackageContainerExpectation has been removed.
4141

4242
# PM sends status events to the consumer:
43-
sendExpectationStatusAdded:
44-
action: send
45-
channel:
46-
$ref: '../channels/from-pm.yaml#/workStatuses'
47-
messages:
48-
- $ref: '../channels/from-pm.yaml#/workStatuses/messages/ExpectationStatusAdded'
49-
summary: PM notifies the consumer of a new ExpectationStatus.
50-
5143
sendExpectationStatusUpdated:
5244
action: send
5345
channel:
5446
$ref: '../channels/from-pm.yaml#/workStatuses'
5547
messages:
5648
- $ref: '../channels/from-pm.yaml#/workStatuses/messages/ExpectationStatusUpdated'
57-
summary: PM notifies the consumer of an updated ExpectationStatus.
49+
summary: PM upserts an ExpectationStatus on the consumer (create or replace).
5850

5951
sendExpectationStatusRemoved:
6052
action: send

0 commit comments

Comments
 (0)