From 1c148486edd894c5a17cf784d8b58c6a9fb0f31c Mon Sep 17 00:00:00 2001 From: Rose Yemelyanova Date: Fri, 21 Apr 2023 15:09:39 +0000 Subject: [PATCH 1/5] added codecov and catalog-info, the latter for backstage --- README.rst | 4 ++++ catalog-info.yaml | 26 ++++++++++++++++++++++++++ codecov.yml | 9 +++++++++ 3 files changed, 39 insertions(+) create mode 100644 catalog-info.yaml create mode 100644 codecov.yml diff --git a/README.rst b/README.rst index 7c9223c..b24ee44 100644 --- a/README.rst +++ b/README.rst @@ -28,6 +28,10 @@ Or if it is a commandline tool then you might put some example commands here:: No other features yet. +To test codecov.yaml, run: +``` +curl -X POST --data-binary @codecov.yml https://codecov.io/validate +``` .. |code_ci| image:: https://github.com/dls-controls/diffcalc_api/workflows/Code%20CI/badge.svg?branch=master :target: https://github.com/dls-controls/diffcalc_api/actions?query=workflow%3A%22Code+CI%22 :alt: Code CI diff --git a/catalog-info.yaml b/catalog-info.yaml new file mode 100644 index 0000000..a5d5816 --- /dev/null +++ b/catalog-info.yaml @@ -0,0 +1,26 @@ +apiVersion: backstage.io/v1alpha1 +kind: Component +metadata: + name: diffcalc + title: diffcalc + description: service for accessing diffcalc-core library methods, with a mongo database backend. +spec: + type: service + lifecycle: production + owner: user:ton99817 + providesApis: + - diffcalc-api + +--- +apiVersion: backstage.io/v1alpha1 +kind: API +metadata: + name: diffcalc-api + title: diffcalc-api + description: REST API for the service +spec: + type: openapi + lifecycle: production + owner: user:ton99817 + definition: + $ref: https://raw.githubusercontent.com/DiamondLightSource/diffcalc-api/releases/download/latest/openapi.json diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..49ab1e8 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,9 @@ +coverage: + status: + project: + default: + target: 90% + threshold: 2% + patch: + default: + threshold: 2% From 42d0a178e6fd60e5284cde8ef0634bd53749537e Mon Sep 17 00:00:00 2001 From: Rose Yemelyanova Date: Fri, 21 Apr 2023 15:19:55 +0000 Subject: [PATCH 2/5] fixing validation errors --- catalog-info.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog-info.yaml b/catalog-info.yaml index a5d5816..35a19ba 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -23,4 +23,4 @@ spec: lifecycle: production owner: user:ton99817 definition: - $ref: https://raw.githubusercontent.com/DiamondLightSource/diffcalc-api/releases/download/latest/openapi.json + $text: https://raw.githubusercontent.com/DiamondLightSource/diffcalc-api/releases/download/latest/openapi.json From 9cb3d1c0a6fbb0bebd98c453cab9a0f10d9a7e26 Mon Sep 17 00:00:00 2001 From: Rose Yemelyanova Date: Tue, 25 Apr 2023 08:36:53 +0000 Subject: [PATCH 3/5] modified url for openapi spec --- catalog-info.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog-info.yaml b/catalog-info.yaml index 35a19ba..503a38a 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -23,4 +23,4 @@ spec: lifecycle: production owner: user:ton99817 definition: - $text: https://raw.githubusercontent.com/DiamondLightSource/diffcalc-api/releases/download/latest/openapi.json + $text: https://github.com/DiamondLightSource/diffcalc-api/releases/latest/download/openapi.json From e2e886c002bc585b350e109bf7384127a10fe1e0 Mon Sep 17 00:00:00 2001 From: Rose Yemelyanova Date: Tue, 25 Apr 2023 08:43:14 +0000 Subject: [PATCH 4/5] pip installing diffcalc-core from main instead of merged branch --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8724a78..5a6addd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "diffcalc-core @ git+https://github.com/DiamondLightSource/diffcalc-core.git@getMiscut", + "diffcalc-core @ git+https://github.com/DiamondLightSource/diffcalc-core.git", "fastapi", "uvicorn", "pymongo", From 8a38d456b143e6a9584e73be71d3e19bd7f7203e Mon Sep 17 00:00:00 2001 From: Rose Yemelyanova Date: Tue, 25 Apr 2023 09:42:47 +0000 Subject: [PATCH 5/5] modified pre commit conig --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 59bf16c..3448ce5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: hooks: - id: check-added-large-files - id: check-yaml - exclude: ^helm\/diffcalc-api\/templates\/.* + exclude: ^helm\/diffcalc-api\/templates\/.*|catalog-info.yaml - id: check-merge-conflict - repo: local @@ -36,4 +36,4 @@ repos: stages: [commit] language: system entry: mypy - files: ^(src\/|tests\/).*\.py \ No newline at end of file + files: ^(src\/|tests\/).*\.py