geonode icon indicating copy to clipboard operation
geonode copied to clipboard

GNIP 91 - Removal of legacy API (v1)

Open giohappy opened this issue 4 years ago • 6 comments

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

  • [x] Under Discussion
  • [ ] In Progress
  • [ ] Completed
  • [ ] Rejected
  • [ ] Deferred

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:

  • Alessio Fabiani: :+1:
  • Francesco Bartoli:
  • Giovanni Allegri: :+1:
  • Toni Schoenbuchner: :+1:
  • Florian Hoedt: :+1:

giohappy avatar Dec 17 '21 17:12 giohappy

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 .

t-book avatar Dec 17 '21 17:12 t-book

@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.

giohappy avatar Dec 18 '21 16:12 giohappy

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

t-book avatar Dec 20 '21 10:12 t-book

+1

afabiani avatar Jan 20 '22 14:01 afabiani

@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?

marthamareal avatar Jan 25 '22 13:01 marthamareal

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

giohappy avatar Jan 26 '22 10:01 giohappy