Skip to content

[#14683][5.1.x] Metadata tracker - fixes - #14699

Open
etj wants to merge 1 commit into
5.1.xfrom
14683_51x_fixes
Open

etj wants to merge 1 commit into
5.1.xfrom
14683_51x_fixes

Conversation

@etj

@etj etj commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor
  • open the tracking block before the resource is touched, so that what set_missing_info() writes is part of the change and not of its premises
  • bracket the subclass managers: they change the resource both before and after delegating to the base one
  • pass the user on from the geoapps manager and the upload handlers
  • do not let an unresolvable default user break the change being tracked

Checklist

Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.

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.

@etj etj self-assigned this Oct 5, 2026
Copilot AI balanced review requested due to automatic review settings October 5, 2026 15:23
@cla-bot cla-bot Bot added the cla-signed CLA Bot: community license agreement signed label Oct 5, 2026

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.

Copilot review overview

🟡 Changes recommended

Map creation remains incompletely scoped, causing subclass mutations to be omitted from the creation change.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Improves metadata audit tracking boundaries and user attribution across resource managers and upload handlers.

Changes:

  • Opens tracking before resource mutations.
  • Propagates initiating users through update paths.
  • Prevents unresolved default users from breaking operations.
File Description
geonode/​upload/​handlers/​common/​vector.py Passes the execution user to updates.
geonode/​upload/​handlers/​common/​remote.py Attributes remote overwrites.
geonode/​upload/​handlers/​common/​raster.py Attributes raster overwrites.
geonode/​resource/​manager.py Starts tracking before initial mutations.
geonode/​metadata/​tracking/​operation.py Handles default-user resolution failures.
geonode/​maps/​manager.py Groups map update mutations.
geonode/​geoapps/​manager.py Groups GeoApp mutations and propagates users.
geonode/​documents/​manager.py Groups document creation mutations.

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

Comment thread geonode/maps/manager.py Outdated
Comment thread geonode/metadata/tracking/operation.py
@etj
etj force-pushed the 14683_51x_fixes branch from d046b64 to 7cbab32 Compare October 5, 2026 15:34
@etj
etj requested a balanced review from Copilot October 5, 2026 15:44
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.45226% with 19 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (5.1.x@a329dc2). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff            @@
##             5.1.x   #14699   +/-   ##
========================================
  Coverage         ?   75.58%           
========================================
  Files            ?      993           
  Lines            ?    62843           
  Branches         ?     8649           
========================================
  Hits             ?    47498           
  Misses           ?    13430           
  Partials         ?     1915           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

Copilot review overview

🟡 Changes recommended

Upload workflows remain split across tracker operations, and authenticated map updates can still be attributed to the default user.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)
Resolved since last review (2)

Comment thread geonode/maps/manager.py
Comment thread geonode/upload/handlers/common/raster.py Outdated
Comment thread geonode/upload/handlers/common/vector.py Outdated
@etj
etj force-pushed the 14683_51x_fixes branch from 7cbab32 to aee05b8 Compare October 5, 2026 16:00
@etj
etj requested a balanced review from Copilot October 5, 2026 16:01
@etj

etj commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

One note related to last forced push. Passing user= to the map update flips a gate: MapResourceManager.update guards on if extent or request_user, so _apply_extent_and_role_defaults() now runs on every map update rather than only when an extent is supplied. That is safe today only because of a bug --" manager.py:1055 does setattr(user, field, ...) where field iterates ["is_approved", "is_published", "featured"], which are ResourceBase fields. It writes to the in-memory User, never saved, so the permission guard is a no-op.

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.

Copilot review overview

🟡 Changes recommended

The new map attribution test mocks out the tracking path and cannot detect the regression it claims to cover.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
Resolved since last review (3)

Comment thread geonode/maps/api/tests.py Outdated
@etj
etj force-pushed the 14683_51x_fixes branch from aee05b8 to 7cbc253 Compare October 6, 2026 14:35
- open the tracking block before the resource is touched, so that what
  set_missing_info() writes is part of the change and not of its premises
- bracket the subclass managers: they change the resource both before and
  after delegating to the base one
- pass the user on from the geoapps manager and the upload handlers
- do not let an unresolvable default user break the change being tracked
@etj
etj force-pushed the 14683_51x_fixes branch from 7cbc253 to bdf0860 Compare October 7, 2026 12:54
@etj etj changed the title [#14683] Metadata tracker - fixes [#14683][5.1.x] Metadata tracker - fixes Oct 8, 2026
@etj
etj requested a review from Gpetrak October 8, 2026 14:45
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