From 888e00f3695bc62dd2d517c17d5b0756238746f9 Mon Sep 17 00:00:00 2001 From: qwe67581 Date: Tue, 2 May 2023 13:53:48 +0100 Subject: [PATCH 1/8] Correct order of publish/subscribe --- docs/user/reference/asyncapi.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/user/reference/asyncapi.yaml b/docs/user/reference/asyncapi.yaml index 3267db68b..b8ea5be88 100644 --- a/docs/user/reference/asyncapi.yaml +++ b/docs/user/reference/asyncapi.yaml @@ -16,7 +16,7 @@ defaultContentType: application/json channels: public.worker.event: description: Produces events about the state of the worker - subscribe: + publish: operationId: stateEvent summary: Updates on the state of the worker description: Events describing the state of the worker and any tasks it's running. Includes error and warning information. @@ -28,7 +28,7 @@ channels: $ref: "#/components/schemas/workerStateEvent" public.worker.event.progress: description: Produces events about the progress of runs associated with a plan - subscribe: + publish: operationId: progressEvent summary: Updates on the progress of tasks description: Events describing the progress of processes within a running task,such as moving motors and exposing detectors. @@ -40,7 +40,7 @@ channels: $ref: "#/components/schemas/workerProgressEvent" public.worker.event.data: description: Produces events supplying data produced by runs associated with a plan - subscribe: + publish: operationId: dataEvent summary: Events representing collection of data description: Data documents produced by running plans @@ -158,7 +158,7 @@ channels: $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/stream_datum.json" worker.run: description: Accepts and provides responses to requests to run a plan using the supplied parameters - publish: + subscribe: operationId: runPlanRequest summary: Submit a 'Run Plan' task with parameters description: Consume a request to run a scan based on the specified Plan with the supplied parameters @@ -168,7 +168,7 @@ channels: $ref: "#/components/schemas/contextHeaders" payload: $ref: "#/components/schemas/runPlan" - subscribe: + publish: operationId: runPlanResponse summary: Indicate acceptance of a 'Run Plan' task - N.B. returned on a temporary channel description: >- @@ -211,7 +211,7 @@ channels: worker.devices: description: >- Accepts requests to return the names of all the Ophyd Devices known to the service. At the moment - any message on this channe will produce this response. + any message on this channel will produce this response. publish: operationId: devicesRequest summary: Get list of Device names From adc713e6830b0cc9de28829261e56595f50d1b76 Mon Sep 17 00:00:00 2001 From: qwe67581 Date: Tue, 2 May 2023 13:54:33 +0100 Subject: [PATCH 2/8] Extract Message schemas to allow referencing from other documents --- docs/user/reference/asyncapi.yaml | 474 +++++++++++++++--------------- 1 file changed, 245 insertions(+), 229 deletions(-) diff --git a/docs/user/reference/asyncapi.yaml b/docs/user/reference/asyncapi.yaml index b8ea5be88..d2c8e7286 100644 --- a/docs/user/reference/asyncapi.yaml +++ b/docs/user/reference/asyncapi.yaml @@ -21,11 +21,7 @@ channels: summary: Updates on the state of the worker description: Events describing the state of the worker and any tasks it's running. Includes error and warning information. message: - messageId: stateEvent - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - $ref: "#/components/schemas/workerStateEvent" + $ref: "#/components/messages/workerStateEvent" public.worker.event.progress: description: Produces events about the progress of runs associated with a plan publish: @@ -33,11 +29,7 @@ channels: summary: Updates on the progress of tasks description: Events describing the progress of processes within a running task,such as moving motors and exposing detectors. message: - messageId: progressEvent - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - $ref: "#/components/schemas/workerProgressEvent" + $ref: "#/components/messages/workerProgressEvent" public.worker.event.data: description: Produces events supplying data produced by runs associated with a plan publish: @@ -46,116 +38,16 @@ channels: description: Data documents produced by running plans message: oneOf: - - messageId: runStart - summary: Indicates the start of a Bluesky run based on a previously specified Plan; describes the initial position/metadata of a scan and its involved devices - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - type: object - properties: - name: - type: string - doc: - $ref: "#/components/schemas/StartDocument" - - messageId: runStop - summary: Indicates the completion of a Bluesky run based on a previously specified Plan; describes end conditions and metadata - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - type: object - properties: - name: - type: string - doc: - $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/run_stop.json" - - messageId: eventStreamDescriptor - summary: Describes the devices to be within a scientifically related stream of measurements - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - type: object - properties: - name: - type: string - doc: - $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/event_descriptor.json" - - messageId: dataEvent - summary: Describes a point measurement for a number of scientifically related devices - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - type: object - properties: - name: - type: string - doc: - $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/event.json" - - messageId: eventPage - summary: jjkjkj - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - type: object - properties: - name: - type: string - doc: - $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/event_page.json" - - messageId: resource - summary: Describes an external resource (file, database entry etc.) that is to be referenced by later datum - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - type: object - properties: - name: - type: string - doc: - $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/resource.json" - - messageId: datum - summary: Describes how to access a point measurement within an external resource - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - type: object - properties: - name: - type: string - doc: - $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/datum.json" - - messageId: datumPage - summary: jjkjkj - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - type: object - properties: - name: - type: string - doc: - $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/datum_page.json" - - messageId: streamResource - summary: Describes an external resource (file, database entry etc.) that is to be referenced by later Stream Datum - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - type: object - properties: - name: - type: string - doc: - $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/stream_resource.json" - - messageId: streamDatum - summary: Describes how to access a slice of an external resource - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - type: object - properties: - name: - type: string - doc: - $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/stream_datum.json" + - $ref: "#/components/messages/taggedStartDocument" + - $ref: "#/components/messages/taggedDescriptorDocument" + - $ref: "#/components/messages/taggedEventDocument" + - $ref: "#/components/messages/taggedStopDocument" + - $ref: "#/components/messages/taggedResourceDocument" + - $ref: "#/components/messages/taggedDatumDocument" + - $ref: "#/components/messages/taggedResourceStream" + - $ref: "#/components/messages/taggedDatumStream" + - $ref: "#/components/messages/taggedEventPage" + - $ref: "#/components/messages/taggedDatumPage" worker.run: description: Accepts and provides responses to requests to run a plan using the supplied parameters subscribe: @@ -163,11 +55,7 @@ channels: summary: Submit a 'Run Plan' task with parameters description: Consume a request to run a scan based on the specified Plan with the supplied parameters message: - messageId: RunPlan - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - $ref: "#/components/schemas/runPlan" + $ref: "#/components/messages/runPlan" publish: operationId: runPlanResponse summary: Indicate acceptance of a 'Run Plan' task - N.B. returned on a temporary channel @@ -176,11 +64,7 @@ channels: specified by replyDestination in the header of the corresponding runPlanRequest but is documented here as the name of the channel will not be known until runtime. message: - messageId: runPlanResponse - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - $ref: "#/components/schemas/taskResponse" + $ref: "#/components/messages/taskResponse" worker.plans: description: >- Accepts requests to return the names of all the Bluesky Plans known to the service. At the moment @@ -190,11 +74,7 @@ channels: summary: Get list of Plan names description: Request a list of Plan names known to the system message: - messageId: plansRequest - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - $ref: "#/components/schemas/anyJson" + $ref: "#/components/messages/anyJson" subscribe: operationId: plansResponse summary: The list of plan names - N.B. returned on a temporary channel @@ -203,11 +83,7 @@ channels: channel specified by replyDestination in the header of the corresponding runPlanRequest but is documented here as the name of the channel will not be known until runtime. message: - messageId: plansResponse - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - $ref: "#/components/schemas/plansResponse" + $ref: "#/components/messages/plansResponse" worker.devices: description: >- Accepts requests to return the names of all the Ophyd Devices known to the service. At the moment @@ -217,11 +93,7 @@ channels: summary: Get list of Device names description: Request a list of Device names known to the system message: - messageId: devicesRequest - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - $ref: "#/components/schemas/anyJson" + $ref: "#/components/messages/anyJson" subscribe: operationId: devicesResponse summary: The list of device names - N.B. returned on a temporary channel @@ -230,12 +102,234 @@ channels: channel specified by replyDestination in the header of the corresponding devicesRequest but is documented here as the name of the channel will not be known until runtime. message: - messageId: devicesResponse - headers: - $ref: "#/components/schemas/contextHeaders" - payload: - $ref: "#/components/schemas/devicesResponse" + $ref: "#/components/messages/devicesResponse" components: + messages: # Defined as Components to allow referencing from other APIs. + taggedStartDocument: + messageId: runStart + summary: Indicates the start of a Bluesky run based on a previously specified Plan; describes the initial position/metadata of a scan and its involved devices + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + name: + type: string + doc: + $ref: "#/components/schemas/StartDocument" + taggedStopDocument: + messageId: runStop + summary: Indicates the completion of a Bluesky run based on a previously specified Plan; describes end conditions and metadata + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + name: + type: string + doc: + $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/run_stop.json" + taggedDescriptorDocument: + messageId: eventStreamDescriptor + summary: Describes the devices to be within a scientifically related stream of measurements + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + name: + type: string + doc: + $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/event_descriptor.json" + taggedEventDocument: + messageId: dataEvent + summary: Describes a point measurement for a number of scientifically related devices + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + name: + type: string + doc: + $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/event.json" + taggedEventPage: + messageId: eventPage + deprecated: true + summary: Page style collection of events + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + name: + type: string + doc: + $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/event_page.json" + taggedResourceDocument: + messageId: resource + summary: Describes an external resource (file, database entry etc.) that is to be referenced by later datum + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + name: + type: string + doc: + $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/resource.json" + taggedDatumDocument: + messageId: datum + summary: Describes how to access a point measurement within an external resource + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + name: + type: string + doc: + $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/datum.json" + taggedDatumPage: + messageId: datumPage + deprecated: true + summary: Page style collection of datum + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + name: + type: string + doc: + $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/datum_page.json" + taggedResourceStream: + messageId: streamResource + summary: Describes an external resource (file, database entry etc.) that is to be referenced by later Stream Datum + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + name: + type: string + doc: + $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/stream_resource.json" + taggedDatumStream: + messageId: streamDatum + summary: Describes how to access a slice of an external resource + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + name: + type: string + doc: + $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/stream_datum.json" + runPlan: + messageId: RunPlan + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + required: + - name + - params + properties: + name: + description: Name of plan to run + type: string + params: + description: Values for parameters to plan, if any (Map of name to any) + type: object + additionalProperties: + type: object + taskResponse: + messageId: runPlanResponse + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + taskName: + description: Unique identifier for the task + type: string + additionalProperties: false + plansResponse: + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + plans: + description: Plans available to use by a worker + type: array + items: + type: string + additionalProperties: false + devicesResponse: + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + properties: + devices: + description: Devices available to use in plans + type: array + items: + type: string + additionalProperties: false + workerStateEvent: + messageId: stateEvent + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + required: + - state + - errors + - warnings + properties: + state: + $ref: "#/components/schemas/workerState" + taskStatus: + $ref: "#/components/schemas/taskStatus" + errors: + description: A list of any errors generated during the execution of a task + type: array + items: + type: string + warnings: + description: A list of any warnings generated during the execution of a task + type: array + items: + type: string + workerProgressEvent: + messageId: progressEvent + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + type: object + required: + - taskName + - statuses + properties: + taskName: + description: Unique id of the task, returned when it was originally submitted + type: string + statuses: + type: object + description: Status object providing various indicators for the task + additionalProperties: + $ref: "#/components/schemas/statusView" + anyJson: + headers: + $ref: "#/components/schemas/contextHeaders" + payload: + title: AnyJSON + type: string + format: json schemas: contextHeaders: type: object @@ -243,7 +337,7 @@ components: - destination properties: destination: - description: Name of the channel on which the message is bein sent + description: Name of the channel on which the message is being sent type: string replyDestination: description: Name of the temporary queue, specified by the caller where they will listen for response messages to requests submitted on the worker.X channels @@ -251,80 +345,6 @@ components: correlationId: description: Unique identifier of an exchange supplied by its originator type: string - runPlan: - type: object - required: - - name - - params - properties: - name: - description: Name of plan to run - type: string - params: - description: Values for parameters to plan, if any (Map of name to any) - type: object - additionalProperties: - type: object - taskResponse: - type: object - properties: - taskName: - description: Unique identifier for the task - type: string - additionalProperties: false - plansResponse: - type: object - properties: - plans: - description: Plans available to use by a worker - type: array - items: - type: string - additionalProperties: false - devicesResponse: - type: object - properties: - devices: - description: Devices available to use in plans - type: array - items: - type: string - additionalProperties: false - workerStateEvent: - type: object - required: - - state - - errors - - warnings - properties: - state: - $ref: "#/components/schemas/workerState" - taskStatus: - $ref: "#/components/schemas/taskStatus" - errors: - description: A list of any errors generated during the execution of a task - type: array - items: - type: string - warnings: - description: A list of any warnings generated during the execution of a task - type: array - items: - type: string - workerProgressEvent: - type: object - required: - - taskName - - statuses - properties: - taskName: - description: Unique id of the task, returned when it was originally submitted - type: string - statuses: - type: object - description: Status object providing various indicators for the task - additionalProperties: - $ref: "#/components/schemas/statusView" workerState: description: The state of the Worker. enum: @@ -402,10 +422,6 @@ components: description: Estimated time remaining until operation completion, if known type: number format: float - anyJson: - title: AnyJSON - type: string - format: json data_type: title: data_type patternProperties: From 71b0987184785366a4192c49625df4dfee9b913e Mon Sep 17 00:00:00 2001 From: qwe67581 Date: Tue, 2 May 2023 16:10:50 +0100 Subject: [PATCH 3/8] Minor additions --- docs/user/reference/asyncapi.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/user/reference/asyncapi.yaml b/docs/user/reference/asyncapi.yaml index d2c8e7286..997478665 100644 --- a/docs/user/reference/asyncapi.yaml +++ b/docs/user/reference/asyncapi.yaml @@ -1,13 +1,16 @@ asyncapi: "2.6.0" id: https://github.com/DiamondLightSource/blueapi info: - title: Bluesky Worker Service Asynchronous API + title: Bluesky Worker Service version:
description: Service for controlling access to and running scans based on Bluesky Plans and Ophyd Devices contact: name: Callum Forrester email: callum.forrester@diamond.ac.uk -servers: + license: + name: Apache 2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html +servers: # TODO: Reference from internal System definition development: url: p45 description: Development Test Beamline @@ -79,7 +82,7 @@ channels: operationId: plansResponse summary: The list of plan names - N.B. returned on a temporary channel description: >- - A List of the names of plans known to the system. Infact this response will be sent on a temporary + A List of the names of plans known to the system. This response will be sent on a temporary channel specified by replyDestination in the header of the corresponding runPlanRequest but is documented here as the name of the channel will not be known until runtime. message: @@ -98,13 +101,13 @@ channels: operationId: devicesResponse summary: The list of device names - N.B. returned on a temporary channel description: >- - A List of the names of devices known to the system. Infact this response will be sent on a temporary + A List of the names of devices known to the system. This response will be sent on a temporary channel specified by replyDestination in the header of the corresponding devicesRequest but is documented here as the name of the channel will not be known until runtime. message: $ref: "#/components/messages/devicesResponse" components: - messages: # Defined as Components to allow referencing from other APIs. + messages: # Defined as Components to allow referencing from other APIs. # TODO: Define protocol specific correlationId bindings taggedStartDocument: messageId: runStart summary: Indicates the start of a Bluesky run based on a previously specified Plan; describes the initial position/metadata of a scan and its involved devices From 2f54d72a3cc2caf23ce01c459e3d4f199b12b0b9 Mon Sep 17 00:00:00 2001 From: qwe67581 Date: Tue, 2 May 2023 16:34:03 +0100 Subject: [PATCH 4/8] Replace StartDocument schema now that Json schema of event model is valid --- docs/user/reference/asyncapi.yaml | 205 +----------------------------- 1 file changed, 1 insertion(+), 204 deletions(-) diff --git a/docs/user/reference/asyncapi.yaml b/docs/user/reference/asyncapi.yaml index 997478665..5ca500233 100644 --- a/docs/user/reference/asyncapi.yaml +++ b/docs/user/reference/asyncapi.yaml @@ -119,7 +119,7 @@ components: name: type: string doc: - $ref: "#/components/schemas/StartDocument" + $ref: "https://raw.githubusercontent.com/bluesky/event-model/master/event_model/schemas/run_start.json" taggedStopDocument: messageId: runStop summary: Indicates the completion of a Bluesky run based on a previously specified Plan; describes end conditions and metadata @@ -425,206 +425,3 @@ components: description: Estimated time remaining until operation completion, if known type: number format: float - data_type: - title: data_type - patternProperties: - "^([^./]+)$": - "$ref": "#/components/schemas/data_type" - additionalProperties: false - projection: - description: Where to get the data from - type: object - properties: - type: - enum: - - linked - - calculated - - static - description: - "linked: a value linked from the data set, calculated: a value - that requires calculation, static: a value defined here in the projection " - stream: - type: string - location: - enum: - - start - - event - - configuration - description: - start comes from metadata fields in the start document, event - comes from event, configuration comes from configuration fields in the event_descriptor - document - field: - type: string - config_index: - type: integer - config_device: - type: string - calculation: - title: calculation properties - description: required fields if type is calculated - properties: - callable: - type: string - description: callable function to perform calculation - args: - type: array - decription: args for calculation callable - kwargs: - type: object - description: kwargs for calcalation callable - required: - - callable - value: - description: value explicitely defined in the projection when type==static. - allOf: - - if: - allOf: - - properties: - location: - const: configuration - - properties: - type: - const: linked - then: - required: - - type - - location - - config_index - - config_device - - field - - stream - - if: - allOf: - - properties: - location: - const: event - - properties: - type: - const: linked - then: - required: - - type - - location - - field - - stream - - if: - allOf: - - properties: - location: - const: event - - properties: - type: - const: calculated - then: - required: - - type - - field - - stream - - calculation - - if: - properties: - type: - const: static - then: - required: - - type - - value - additionalProperties: false - projections: - title: Describe how to interperet this run as the given projection - properties: - name: - type: string - description: The name of the projection - version: - type: string - description: - The version of the projection spec. Can specify the version of - an external specification. - configuration: - type: object - description: Static information about projection - projection: - type: object - patternProperties: - ".": - "$ref": "#/components/schemas/projection" - additionalProperties: false - additionalProperties: false - required: - - projection - - version - - configuration - StartDocument: # TODO: When Python Json schema not failing to validate due to enum key in anyOf value, switch to importing from there - properties: - data_session: - type: string - description: - An optional field for grouping runs. The meaning is not mandated, - but this is a data management grouping and not a scientific grouping. It is - intended to group runs in a visit or set of trials. - data_groups: - type: array - items: - type: string - description: - An optional list of data access groups that have meaning to some - external system. Examples might include facility, beamline, end stations, proposal, - safety form. - project: - type: string - description: Name of project that this run is part of - sample: - type: - - object - - string - description: Information about the sample, may be a UID to another collection - scan_id: - type: integer - description: Scan ID number, not globally unique - time: - type: number - description: Time the run started. Unix epoch time - uid: - type: string - description: Globally unique ID for this run - group: - type: string - description: Unix group to associate this data with - owner: - type: string - description: Unix owner to associate this data with - projections: - type: array - items: - "$ref": "#/components/schemas/projections" - hints: - type: object - description: Start-level hints - properties: - dimensions: - type: array - description: The independent axes of the experiment. Ordered slow to fast - items: - type: array - description: - Each entry in this list is of the from ([, ...], ). A - 1d scan will have 1 such entry, a scan with 3 independent entries would - have 3 - items: - - type: array - description: The data key(s) for the given dimension. - items: - type: string - - type: string - description: The stream to find the datakeys in. - additionalItems: false - minItems: 2 - patternProperties: - "^([^.]+)$": - "$ref": "#/components/schemas/data_type" - additionalProperties: false - patternProperties: - "^([^./]+)$": - "$ref": "#/components/schemas/data_type" From 14fdb991393060181ace486e2495633a79e34201 Mon Sep 17 00:00:00 2001 From: qwe67581 Date: Wed, 3 May 2023 08:01:08 +0100 Subject: [PATCH 5/8] Add validation action for AsyncAPI schema to run when changes made to that file --- .github/workflows/api.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/api.yaml diff --git a/.github/workflows/api.yaml b/.github/workflows/api.yaml new file mode 100644 index 000000000..a24d07160 --- /dev/null +++ b/.github/workflows/api.yaml @@ -0,0 +1,17 @@ +name: API CI + +on: + push: + paths: # TODO: add catalog-info.yaml validation + - 'docs/user/reference/asyncapi.yaml' + pull_request: + +jobs: + validate-api: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: asyncapi-github-action + uses: WaleedAshraf/asyncapi-github-action@v0.0.9 + with: + filepath: 'docs/user/reference/asyncapi.yaml' \ No newline at end of file From 2635423e81cb1330e18d670d1d50bb3235da953d Mon Sep 17 00:00:00 2001 From: qwe67581 Date: Wed, 3 May 2023 08:32:05 +0100 Subject: [PATCH 6/8] Disable validation github action until AsyncAPI validator action supports AsyncAPI 2.6.0 --- .github/workflows/api.yaml | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/api.yaml b/.github/workflows/api.yaml index a24d07160..581a9f7a8 100644 --- a/.github/workflows/api.yaml +++ b/.github/workflows/api.yaml @@ -1,17 +1,17 @@ -name: API CI - -on: - push: - paths: # TODO: add catalog-info.yaml validation - - 'docs/user/reference/asyncapi.yaml' - pull_request: - -jobs: - validate-api: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: asyncapi-github-action - uses: WaleedAshraf/asyncapi-github-action@v0.0.9 - with: - filepath: 'docs/user/reference/asyncapi.yaml' \ No newline at end of file +#name: API CI +# +#on: +# push: +# paths: # TODO: add catalog-info.yaml validation +# - 'docs/user/reference/asyncapi.yaml' +# pull_request: +# +#jobs: +# validate-api: +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - name: asyncapi-github-action +# uses: WaleedAshraf/asyncapi-github-action@v0.0.9 +# with: +# filepath: 'docs/user/reference/asyncapi.yaml' \ No newline at end of file From 10082ce226ed08a97b44873b615d2217ea98d388 Mon Sep 17 00:00:00 2001 From: qwe67581 Date: Wed, 3 May 2023 10:20:50 +0100 Subject: [PATCH 7/8] Revert switching publish/subscribe operations --- docs/user/reference/asyncapi.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/user/reference/asyncapi.yaml b/docs/user/reference/asyncapi.yaml index 5ca500233..146992b7a 100644 --- a/docs/user/reference/asyncapi.yaml +++ b/docs/user/reference/asyncapi.yaml @@ -19,7 +19,7 @@ defaultContentType: application/json channels: public.worker.event: description: Produces events about the state of the worker - publish: + subscribe: operationId: stateEvent summary: Updates on the state of the worker description: Events describing the state of the worker and any tasks it's running. Includes error and warning information. @@ -27,7 +27,7 @@ channels: $ref: "#/components/messages/workerStateEvent" public.worker.event.progress: description: Produces events about the progress of runs associated with a plan - publish: + subscribe: operationId: progressEvent summary: Updates on the progress of tasks description: Events describing the progress of processes within a running task,such as moving motors and exposing detectors. @@ -35,7 +35,7 @@ channels: $ref: "#/components/messages/workerProgressEvent" public.worker.event.data: description: Produces events supplying data produced by runs associated with a plan - publish: + subscribe: operationId: dataEvent summary: Events representing collection of data description: Data documents produced by running plans @@ -53,13 +53,13 @@ channels: - $ref: "#/components/messages/taggedDatumPage" worker.run: description: Accepts and provides responses to requests to run a plan using the supplied parameters - subscribe: + publish: operationId: runPlanRequest summary: Submit a 'Run Plan' task with parameters description: Consume a request to run a scan based on the specified Plan with the supplied parameters message: $ref: "#/components/messages/runPlan" - publish: + subscribe: operationId: runPlanResponse summary: Indicate acceptance of a 'Run Plan' task - N.B. returned on a temporary channel description: >- From 15cc4992d64f733afc427a824664ff96d39eb1d3 Mon Sep 17 00:00:00 2001 From: qwe67581 Date: Wed, 3 May 2023 10:32:43 +0100 Subject: [PATCH 8/8] Remove AsyncAPI validation until github action updated --- .github/workflows/api.yaml | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .github/workflows/api.yaml diff --git a/.github/workflows/api.yaml b/.github/workflows/api.yaml deleted file mode 100644 index 581a9f7a8..000000000 --- a/.github/workflows/api.yaml +++ /dev/null @@ -1,17 +0,0 @@ -#name: API CI -# -#on: -# push: -# paths: # TODO: add catalog-info.yaml validation -# - 'docs/user/reference/asyncapi.yaml' -# pull_request: -# -#jobs: -# validate-api: -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - name: asyncapi-github-action -# uses: WaleedAshraf/asyncapi-github-action@v0.0.9 -# with: -# filepath: 'docs/user/reference/asyncapi.yaml' \ No newline at end of file