GeoNode / geonode

GeoNode is an open source platform that facilitates the creation, sharing, and collaborative use of geospatial data.
https://geonode.org/
Other
1.43k stars 1.12k forks source link

GNIP 91 - Removal of legacy API (v1) #8511

Closed giohappy closed 7 months ago

giohappy commented 2 years ago

GNIP 91 - Removal of legacy API (v1)

Overview

Version 2 of GeoNode API has much more coverage and offers access to many of the new services implemented in GeoNode (Harvesting, Resource Manager, Permissions, etc.). Given the deep and wide refactoring in master branch we cannot grant backword compatibility with v1. Our proposal is to drop it and, in case, invite users to switch to v2.

When v1 will be dropped we propose to use v2 both under the root URL /api and /api/v2

Proposed By

GeoSolutions s.a.s.

Assigned to Release

This proposal is for GeoNode 4.x.

State

Motivation

API v2 is actively developed since version 3.3.1, and it's actively used in many contexts. The new QGIS GeoNode Plugin (which is under development) is also based on v2. For the moment tests are passing for v1 but, if there's no strong reasons to maintain it, we are in favour to remove this legacy code (which is not actively maintained). This will simplify further refactorings of GeoNode core models that might happen in the near future.

Proposal

Remove the legacy api module and expose v2 both under the root API /api, and also keep the /api/v2 as an alias.

Voting

Project Steering Committee:

t-book commented 2 years ago

Dear Giovanni,

thanks for your PR!

I'm usually a bit "conservative" when it comes to cutting old ties. Simply because it is always difficult to estimate what this means for the user community of GeoNode. But since we are making a big step with the new version anyway. (For example, URLs change from layer/ to catalog/#/ ... [1]) I would say now or never. My +1

Simone has unfortunately left the PSC. I have taken him therefore from the voting list.

[1] I will try to commit an Nginx rewrite here to prevent 404s, not easy as I think the routing now uses IDs for layers but that's a different story .

giohappy commented 2 years ago

@t-book, as a side note regarding the detail url, it might change in the future. The url currently reflects the single page nature of the client, but I'd prefer to have a "client agnostic" url. We might consider e Djano url that does a redirect according to the specific client routing.

t-book commented 2 years ago

@giohappy that's a great idea! Thanks +1 for adding a Django route

afabiani commented 2 years ago

+1

marthamareal commented 2 years ago

@giohappy, Currently there is a challenge where the templates are still using the legacy api(v1). For example, the picture below lists templates that use v1.

api

Also the views in geonode.api.views.py are referenced in these urls, are they safe to delete?

giohappy commented 2 years ago

thanks @marthamareal. I'lll mark this as blocked, since it depends on replacing the APIs inside the legacy views which master still depends on.