From 31e9c9bb5663ff5a4ff69be2f547f7ee0512559c Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Mon, 20 Mar 2023 16:09:03 +0100 Subject: [PATCH] implement `/CHANGELOG` view --- Dockerfile | 1 + src/openeo_aggregator/backend.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 81fb81cb..105dbd2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,6 +43,7 @@ COPY --chown=openeo src src COPY --chown=openeo conf conf COPY --chown=openeo pytest.ini pytest.ini COPY --chown=openeo tests tests +COPY --chown=openeo CHANGELOG.md CHANGELOG.md # Install dependencies and app. diff --git a/src/openeo_aggregator/backend.py b/src/openeo_aggregator/backend.py index 7ead8b74..a844028c 100644 --- a/src/openeo_aggregator/backend.py +++ b/src/openeo_aggregator/backend.py @@ -1,9 +1,9 @@ import re - import contextlib import datetime import functools import logging +import pathlib import time from collections import defaultdict from typing import List, Dict, Union, Tuple, Optional, Iterable, Iterator, Callable, Any @@ -1154,3 +1154,9 @@ def postprocess_capabilities(self, capabilities: dict) -> dict: # TODO: standardize this field? capabilities["_partitioned_job_tracking"] = bool(self.batch_jobs.partitioned_job_tracker) return capabilities + + def changelog(self) -> Union[str, pathlib.Path]: + changelog = pathlib.Path(__file__).parent.parent.parent / "CHANGELOG.md" + if changelog.exists(): + return changelog + return super().changelog()