From 8feea189a3c1eed4a7ac51022cf5c666c4e1a206 Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Wed, 15 Jan 2025 11:06:45 -0500 Subject: [PATCH 1/2] Add fixture data for upcoming API Add fixture data for upcoming changes --- app/data/__init__.py | 2 + app/data/upcoming.py | 240 +++++++++++++++++++++++++++++++++++ app/v1/upcoming/endpoints.py | 18 +-- 3 files changed, 248 insertions(+), 12 deletions(-) create mode 100644 app/data/__init__.py create mode 100644 app/data/upcoming.py diff --git a/app/data/__init__.py b/app/data/__init__.py new file mode 100644 index 0000000..b62bd2c --- /dev/null +++ b/app/data/__init__.py @@ -0,0 +1,2 @@ +# ruff: noqa: F401 +from .upcoming import UPCOMING_DATA diff --git a/app/data/upcoming.py b/app/data/upcoming.py new file mode 100644 index 0000000..3a45e2b --- /dev/null +++ b/app/data/upcoming.py @@ -0,0 +1,240 @@ +UPCOMING_DATA = [ + { + "name": "OpenJDK 11 retirement", + "type": "Deprecation", + "release": "9.x", + "date": "Oct 2024", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": ".NET 6 retirement", + "type": "Deprecation", + "release": "9.x", + "date": "Nov 2024", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "gcc-toolset 12 retirement", + "type": "Deprecation", + "release": "9.x", + "date": "Nov 2024", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "Ruby 3.1 retirement", + "type": "Deprecation", + "release": "9.x", + "date": "Mar 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "Node.js 18 retirement", + "type": "Deprecation", + "release": "9.x", + "date": "Apr 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "6.11 kernel version", + "type": "Change", + "release": "10.0", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "gcc-toolset 14", + "type": "addition", + "release": "9.5", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "gcc-toolset 14", + "type": "addition", + "release": "10.0", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "MariaDB 11.0", + "type": "addition", + "release": "9.5", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "MariaDB 11.0", + "type": "addition", + "release": "10.0", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "PHP 8.1 retirement", + "type": "Deprecation", + "release": "9.x", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "PHP 8.3", + "type": "addition", + "release": "9.5", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "PHP 8.3", + "type": "addition", + "release": "10.0", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "Python 3.12", + "type": "addition", + "release": "9.5", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "Python 3.12", + "type": "addition", + "release": "10.0", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "Ruby 3.4", + "type": "addition", + "release": "9.5", + "date": "May 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, + { + "name": "Ruby 3.5", + "type": "addition", + "release": "10.0", + "date": "June 2025", + "details": { + "detailFormat": 0, + "summary": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub works as well!", + "potentiallyAffectedSystems": 5, + "trainingTicket": "No training ticket", + "dateAdded": "October 29, 2024", + "lastModified": "October 29, 2024", + }, + }, +] diff --git a/app/v1/upcoming/endpoints.py b/app/v1/upcoming/endpoints.py index 5444988..da266a6 100644 --- a/app/v1/upcoming/endpoints.py +++ b/app/v1/upcoming/endpoints.py @@ -1,17 +1,11 @@ from fastapi import APIRouter +from app.data import UPCOMING_DATA + v1_router = APIRouter() -@v1_router.get("/get-future-data") -async def get_relevant(): - # TODO: This is a dummy function that returns a list of changes that are planned for the future. - # In a real application, this data would be fetched from a database or some other source. - return { - "changes": [ - {"type": "feature", "description": "New feature 1", "release": "9.0"}, - {"type": "retirement", "description": "Retiring feature 2", "release": "10.0"}, - {"type": "bugfix", "description": "Fixing bug 3", "release": "8.6"}, - {"type": "deprecation", "description": "Deprecating feature 4", "release": "9.0"}, - ] - } +@v1_router.get("") +async def get_upcoming(): + # TODO: Replace fixture data with data from database + return UPCOMING_DATA From 0c82d42b008f92ad773f841e33493c5be007528e Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Wed, 15 Jan 2025 14:41:55 -0500 Subject: [PATCH 2/2] Update test --- app/tests/upcoming/test_get_mock_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/tests/upcoming/test_get_mock_data.py b/app/tests/upcoming/test_get_mock_data.py index 50ba339..e1cf522 100644 --- a/app/tests/upcoming/test_get_mock_data.py +++ b/app/tests/upcoming/test_get_mock_data.py @@ -6,5 +6,5 @@ def test_upcoming_mock_endpoint(): - response = client.get("/api/digital-roadmap/v1/upcoming-changes/get-future-data") + response = client.get("/api/digital-roadmap/v1/upcoming-changes") assert response.status_code == 200