Skip to content

Chore/sunset legacy api 289#290

Open
RLiNREL wants to merge 6 commits into
developfrom
chore/sunset-legacy-api-289
Open

Chore/sunset legacy api 289#290
RLiNREL wants to merge 6 commits into
developfrom
chore/sunset-legacy-api-289

Conversation

@RLiNREL

@RLiNREL RLiNREL commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Description

close #289

  • remove legacy controller
  • update api description
  • add CHANGELOG
  • add migration doc

Checklist

  • PR targets develop
  • I have run make format and make verify
  • No merge conflicts with develop
  • Branch name is descriptive (feat/..., fix/..., docs/..., chore/...)
  • Commit messages are clear (e.g., feat: add new feature, fix: resolve bug, docs: update documentation)
  • Documentation updated where needed
  • I have self-reviewed this PR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.0 and updated API description/docs (including a new migration guide).
  • Added a CHANGELOG.md entry 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 thread windwatts-api/app/main.py Outdated
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 thread docs/03-backend.md Outdated
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 thread docs/06-migration.md Outdated
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 thread docs/06-migration.md Outdated
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` |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sunset legacy APIs

2 participants