Skip to content

Commit e85c951

Browse files
committed
Updated API
1 parent 2fde2f4 commit e85c951

File tree

6 files changed

+41
-26
lines changed

6 files changed

+41
-26
lines changed

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@ task site:update
2525
Run
2626

2727
``` shell
28-
git submodule update --init
29-
# Apply a patch to support MySQL in the API and make building it work.
30-
git -C api apply < patches/Process_Dashboard_API.patch
3128
task site:update
3229
```
3330

34-
to get things started.
31+
> [!NOTE]
32+
> Running `task site:update` on [macOS (darwin)](https://en.wikipedia.org/wiki/Darwin_(operating_system)) will pull and
33+
> patch the API Git submodule (cf. [#api](API)). See [`Taskfile.yml`](Taskfile.yml) for details.
3534
3635
Load fixtures with
3736

@@ -73,6 +72,17 @@ task api:get API_PATH='/api/v1/runs/?process_id=1&meta_filter=name:Gregory%20Men
7372

7473
See [`docker-compose.api.yml`](docker-compose.api.yml) for the docker compose setup for the API.
7574

75+
## Updating the API
76+
77+
Run
78+
79+
``` shell
80+
task api:update
81+
```
82+
83+
to update the API to the latest version (the [`main`
84+
branch](https://github.com/AAK-MBU/Process_Dashboard_API/tree/main)).
85+
7686
### Loading data
7787

7888
``` shell

Taskfile.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@ tasks:
3737
- task: compose
3838
vars:
3939
TASK_ARGS: pull
40+
41+
# Additional setup for local development (assuming we're running on maxOS (darwin))
42+
- cmd: |
43+
git -C api checkout .
44+
git submodule update --init
45+
# Apply a patch to support MySQL in the API and make building it work.
46+
git -C api apply < patches/Process_Dashboard_API.patch
47+
# https://taskfile.dev/docs/reference/schema#platforms
48+
platforms: [darwin]
49+
4050
- task: compose
4151
vars:
4252
TASK_ARGS: up --build --detach --wait
@@ -155,6 +165,16 @@ tasks:
155165
vars:
156166
SCRIPT_PATH: scripts/api/fixtures.py
157167

168+
api:update:
169+
desc: Update API to latest version (https://github.com/AAK-MBU/Process_Dashboard_API/tree/main)
170+
prompt: Really?
171+
cmds:
172+
- git -C api checkout .
173+
- git -C api checkout main
174+
- git -C api pull
175+
# Check that our patch can be applied.
176+
- git -C api apply --check < patches/Process_Dashboard_API.patch
177+
158178
api:script:run:
159179
desc: "Run script inside API service container, example: `task {{.TASK}} SCRIPT_PATH=test/load_data.py"
160180
silent: true
Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,12 @@
11
diff --git a/pyproject.toml b/pyproject.toml
2-
index 15be699..0933d91 100644
2+
index b3adc84..f92da38 100644
33
--- a/pyproject.toml
44
+++ b/pyproject.toml
5-
@@ -21,6 +21,7 @@ dependencies = [
6-
"python-dotenv>=1.0.0",
5+
@@ -22,6 +22,7 @@ dependencies = [
76
"python-multipart>=0.0.6",
87
"python-jose[cryptography]>=3.3.0",
8+
"fastapi-pagination>=0.14.3",
99
+ "pymysql>=1.1.2",
1010
]
1111

1212
[project.optional-dependencies]
13-
diff --git a/uv.lock b/uv.lock
14-
index 67c564a..ad82d70 100644
15-
--- a/uv.lock
16-
+++ b/uv.lock
17-
@@ -350,8 +350,8 @@ wheels = [
18-
]
19-
20-
[[package]]
21-
-name = "process-visualization-api"
22-
-version = "1.0.0"
23-
+name = "process-dashboard-api"
24-
+version = "1.1.0"
25-
source = { editable = "." }
26-
dependencies = [
27-
{ name = "fastapi" },

src/DataSourceHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public function __construct(
1818

1919
public function getProcesses(DataSource $dataSource): array
2020
{
21-
return $this->get($dataSource, 'processes/processes');
21+
return $this->get($dataSource, 'processes/');
2222
}
2323

2424
public function getProcess(DataSource $dataSource, string $processId): array
2525
{
26-
return $this->get($dataSource, 'processes/processes/'.$processId);
26+
return $this->get($dataSource, 'processes/'.$processId);
2727
}
2828

2929
public function getProcessRun(DataSource $dataSource, string $processId, array $query): array

src/ProcessOverviewHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function getData(Request $request, ProcessOverview $overview): array
5353
}
5454

5555
$rows = [];
56-
$items = $data;
56+
$items = $data['items'] ?? [];
5757
foreach ($items as $item) {
5858
$steps = $item['steps'] ?? null;
5959
if (!$steps) {

0 commit comments

Comments
 (0)