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
30 changes: 30 additions & 0 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Openapi

on:
push:
pull_request:
schedule:
# Run weekly to check latest versions of dependencies
- cron: "0 8 * * WED"
env:
# The target python version, which must match the Dockerfile version
CONTAINER_PYTHON: "3.11"

jobs:
publish:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install python packages
uses: ./.github/actions/install_requirements
with:
requirements_file: requirements-dev-3.x.txt
install_options: -e .[dev]

- name: generate openapi schema
run: python src/blueapi/service/openapi.py
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: check-added-large-files
- id: check-yaml
exclude: ^helm\/.*\/templates\/.*
exclude: ^helm\/.*\/templates\/.*|catalog-info.yaml
- id: check-merge-conflict

- repo: local
Expand Down
43 changes: 43 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: bluesky-worker
title: bluesky-worker
description: Lightweight wrapper around bluesky services
annotations:
github.com/project-slug: DiamondLightSouce/blueapi
spec:
type: service
lifecycle: production
owner: user:vid18871 # TODO: owner: DAQ-Core
# system: Athena # TODO: Define Athena system: presumably same location as DAQ-Core/DAQ?
providesApis:
- message-topics
- restapi
- blueskydocument-to-scanmessage
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the ugliness of this (since it's not actually emitting ScanMessages, and ScanMessages are defined elsewhere, and this whole provided API is defined elsewhere) is reason enough to say: now is the time to do #167 and fold it into this change.

Copy link
Copy Markdown
Contributor

@keithralphs keithralphs May 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to address that in a separate change that also includes updating the AsyncAPI definition to reflect that some of it's functionality is now repaced by the REST API. That will allow us to close this ticket and its associated Jira one and schedule the cleanup activity for next sprint.

---
apiVersion: backstage.io/v1alpha1
kind: API
metadata:
name: restapi
title: restapi
description: REST API for getting plans/devices from the worker (and running tasks)
spec:
type: openapi
lifecycle: production
owner: user:vid18871
definition:
$text: ./docs/user/reference/openapi.json
---
apiVersion: backstage.io/v1alpha1
kind: API
metadata:
name: message-topics
title: message-topics
description: Message topics which can be listened to over an activeMQ message bus
spec:
type: asyncapi
lifecycle: production
owner: user:vid18871
definition:
$text: ./docs/user/reference/asyncapi.yaml
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"sphinx_copybutton",
# For the card element
"sphinx_design",
# OpenAPI directive
"sphinxcontrib.openapi",
]

# If true, Sphinx will warn about all references where the target cannot
Expand Down
1 change: 1 addition & 0 deletions docs/user/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ side-bar.

reference/api
reference/asyncapi
reference/openapi
../genindex

+++
Expand Down
Loading