Skip to content

[Fixes #14381] Service URL uniqueness [Fixes #14524] Remote-resource detection - #14536

Open
etj wants to merge 2 commits into
masterfrom
14381_14524
Open

[Fixes #14381] Service URL uniqueness [Fixes #14524] Remote-resource detection#14536
etj wants to merge 2 commits into
masterfrom
14381_14524

Conversation

@etj

@etj etj commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Coalesce the commits from:

Checklist

For all pull requests:

  • Confirm you have read the contribution guidelines
  • You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in the documentation)
  • Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.

The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):

  • There is a ticket in https://github.com/GeoNode/geonode/issues describing the issue/improvement/feature (a notable exemption is, changes not visible to end-users)
  • The issue connected to the PR must have Labels and Milestone assigned
  • PR for bug fixes and small new features are presented as a single commit
  • PR title must be in the form "[Fixes #<issue_number>] Title of the PR"
  • New unit tests have been added covering the changes, unless there is an explanation on why the tests are not necessary/implemented

Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.

Copilot AI lite review requested due to automatic review settings August 18, 2026 14:05
@cla-bot cla-bot Bot added the cla-signed CLA Bot: community license agreement signed label Aug 18, 2026
@etj
etj requested a review from mattiagiupponi August 18, 2026 14:06

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 pull request coalesces prior work to support multiple Service registrations per remote endpoint and to make “remote resource” detection consistent across harvesting and GeoServer/security paths.

Changes:

  • Remove uniqueness from Service.base_url and adjust service registration, caching, and lookups to be service-record + auth-context specific.
  • Ensure remote datasets don’t claim a GeoServer store (nullable Dataset.store, harvesters populate store=None) and standardize remote detection via sourcetype.
  • Add/adjust migrations and expand unit tests to cover cache-key behavior, duplicate service registration, and remote-resource handling.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
geonode/utils.py Pass service_id and auth_config into service handler resolution for remote legend-link generation.
geonode/services/views.py Replace URL-only handler caching with a service/auth-aware cache key and centralized cache helper.
geonode/services/tests.py Add extensive tests for cache key stability/sensitivity and duplicate service registration behavior.
geonode/services/serviceprocessors/wms.py Make WMS handler registration name-safe, propagate auth context correctly, and set remote dataset store=None.
geonode/services/serviceprocessors/cache.py Introduce ServiceHandlerCache for auth/service-scoped handler caching.
geonode/services/serviceprocessors/base.py Add unique-name generation + retry helper to avoid registration races on unique name constraints.
geonode/services/serviceprocessors/arcgis.py Apply unique-name creation pattern and set remote dataset store=None for ArcGIS handlers.
geonode/services/serviceprocessors/init.py Update get_service_handler to use the new service/auth-specific cache keying.
geonode/services/models.py Drop uniqueness constraint from Service.base_url (db-indexed only).
geonode/services/migrations/0061_alter_service_base_url.py Migration to alter Service.base_url field (remove uniqueness).
geonode/services/forms.py Remove “URL already registered” validation and update TagField import.
geonode/security/tests.py Adjust expectations and add coverage for skipping GeoFence sync on remote datasets.
geonode/resource/utils.py Redefine is_remote_resource() based on sourcetype (with legacy fallback warning).
geonode/layers/tests.py Add tests for remote dataset uniqueness behavior and auth_config propagation in link creation; split vector/raster link tests.
geonode/layers/models.py Make Dataset.store nullable/blank to support remote datasets without a GeoServer store.
geonode/layers/migrations/0047_alter_dataset_store.py Migration to alter Dataset.store to nullable/blank.
geonode/layers/api/tests.py Fix dataset listing test counts to exclude metadata-only datasets.
geonode/harvesting/tests/test_harvester_worker_wms.py Add assertion that harvested WMS resources set store=None.
geonode/harvesting/migrations/0051_flag_harvested_resources_as_remote.py Data migration to flag harvested resources as REMOTE and backfill remote service metadata.
geonode/harvesting/harvesters/wms.py Stop deriving a store for harvested WMS layers; mark subtype and store=None.
geonode/harvesting/harvesters/geonodeharvester.py Ensure remote descriptors/additional parameters use store=None.
geonode/harvesting/harvesters/base.py Set harvested resources’ sourcetype to REMOTE regardless of bbox presence.
geonode/harvesting/harvesters/arcgis.py Stop deriving a store for harvested ArcGIS layers; mark subtype and store=None.
geonode/geoserver/signals.py Make MapLayer→Dataset resolution tolerate ambiguity with a warning rather than raising.
geonode/geoserver/security.py Skip GeoFence rule syncing for remote resources and clear dirty state instead.
geonode/geoserver/manager.py Use is_remote_resource() for GeoServer existence checks rather than subtype heuristics.
geonode/base/api/tests.py Update expected totals impacted by metadata-only filtering changes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread geonode/services/serviceprocessors/cache.py Outdated
@etj etj self-assigned this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed CLA Bot: community license agreement signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants