Chore/sunset legacy api 289#290
Open
RLiNREL wants to merge 6 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR sunsets the legacy, model-specific WindWatts API endpoints (issue #289) by removing deprecated controllers/routes, bumping the API major version to 2.0.0, and adding documentation to help consumers migrate to the unified v1 endpoint structure.
Changes:
- Removed legacy
/wtk/*and/era5/*controller code and stopped registering those routers. - Bumped API version to
2.0.0and updated API description/docs (including a new migration guide). - Added a
CHANGELOG.mdentry documenting the breaking change.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| windwatts-ui/public/gtm-init.js | Formatting-only update to GTM init script. |
| windwatts-api/tests/test_wind_data_controller.py | Replaced legacy endpoint tests with a healthcheck-only test (now missing explicit legacy-removal assertions). |
| windwatts-api/app/main.py | Bumped API version to 2.0.0 and removed legacy router includes; updated API description text. |
| windwatts-api/app/controllers/wtk_data_controller.py | Deleted legacy WTK controller (legacy endpoints removed). |
| windwatts-api/app/controllers/era5_data_controller.py | Deleted legacy ERA5 controller (legacy endpoints removed). |
| docs/README.md | Added migration guide to documentation index. |
| docs/06-migration.md | Added migration guide mapping legacy endpoints to unified v1 equivalents. |
| docs/03-backend.md | Updated backend docs to describe unified v1 endpoint structure. |
| CHANGELOG.md | Added changelog documenting the 2.0.0 breaking change and removals. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
24
to
28
| ## API | ||
|
|
||
| **v1 (Recommended)**: | ||
| - `/v1/{model}/windspeed` - Wind speed data | ||
| - `/v1/{model}/production` - Energy production estimates | ||
| - `/v1/{model}/timeseries` - Raw timeseries downloads |
Comment on lines
+64
to
+74
| When the app is running, visit `/docs` (e.g., `http://localhost:8080/docs`) to see the auto-generated Swagger UI. | ||
|
|
||
| ### API Endpoints | ||
|
|
||
| All endpoints are under the `/api/v1/{model}/` prefix. | ||
|
|
||
| | Endpoint | Description | | ||
| |---|---| | ||
| | `/v1/{model}/windspeed` | Wind speed data | | ||
| | `/v1/{model}/production` | Energy production estimates | | ||
| | `/v1/{model}/timeseries` | Raw timeseries downloads | |
Comment on lines
+33
to
+34
| - **Period** — path-based period (e.g. `/windspeed/{avg_type}`) is now a query parameter: `?period=`. | ||
| - **Turbine** — the `powercurve` query parameter is renamed to `turbine`. |
Comment on lines
+7
to
+10
| def test_healthcheck(): | ||
| response = client.get("/healthcheck") | ||
| assert response.status_code == 200 | ||
| json = response.json() | ||
| assert "available_power_curves" in json | ||
| assert response.json() == {"status": "up"} |
Comment on lines
+9
to
+29
| ``` | ||
| Legacy: /wtk/<endpoint> → /v1/wtk-timeseries/<endpoint> | ||
| Legacy: /era5/<endpoint> → /v1/era5-quantiles/<endpoint> | ||
| ``` | ||
|
|
||
| ## Endpoint Mapping | ||
|
|
||
| | Legacy | v1 Equivalent | | ||
| |---|---| | ||
| | `GET /wtk/windspeed` | `GET /v1/wtk-timeseries/windspeed` | | ||
| | `GET /wtk/energy-production` | `GET /v1/wtk-timeseries/production` | | ||
| | `GET /wtk/download-csv` | `GET /v1/wtk-timeseries/timeseries` | | ||
| | `POST /wtk/download-csv-batch` | `POST /v1/wtk-timeseries/timeseries/batch` | | ||
| | `GET /wtk/nearest-locations` | `GET /v1/wtk-timeseries/grid-points` | | ||
| | `GET /wtk/available-powercurves` | `GET /v1/turbines` | | ||
| | `GET /era5/windspeed` | `GET /v1/era5-quantiles/windspeed` | | ||
| | `GET /era5/production` | `GET /v1/era5-quantiles/production` | | ||
| | `GET /era5/timeseries` | `GET /v1/era5-timeseries/timeseries` | | ||
| | `POST /era5/timeseries/batch` | `POST /v1/era5-timeseries/timeseries/batch` | | ||
| | `GET /era5/grid-points` | `GET /v1/era5-quantiles/grid-points` | | ||
| | `GET /era5/powercurves` | `GET /v1/turbines` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
close #289
Checklist
developmake formatandmake verifydevelopfeat/...,fix/...,docs/...,chore/...)feat: add new feature,fix: resolve bug,docs: update documentation)