Skip to content

feat(stactools): record the imagery owner as oam:owner_id - #371

Open
somoza wants to merge 2 commits into
mainfrom
feat/stac-owner-id
Open

somoza wants to merge 2 commits into
mainfrom
feat/stac-owner-id

Conversation

@somoza

@somoza somoza commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Adds oam:owner_id to the OAM extension (v0.4.0), the field proposed in ADR 0011, and drops oam:uploader_email from that new version.

Depends on:

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation
  • 🧑‍💻 Refactor
  • ✅ Test
  • 🤖 Build or CI
  • ❓ Other (please specify)

Related Issue

Part of #332. Implements the field from ADR 0011 (#370).

Describe this PR

oam:owner_id (OAM extension v0.4.0). The current owner of the imagery, as provider|id, next to oam:uploader_id. The uploader never changes; the owner changes when imagery is transferred. create_item writes it when set, and the legacy sync gives legacy Items their oam-legacy|<id> account as owner until it is claimed. The uploader does not set it yet; that comes in a follow-up PR.

No organisation prefix yet. ADR 0011 proposes hotosm-org|<id> for organisations, but that prefix is still to be agreed with the HOT Login team. Released schemas cannot change, so the v0.4.0 description only names the prefixes in use today (hotosm|, oam-legacy|). The field's pattern accepts any provider|id, so organisations need no new schema version.

Drop oam:uploader_email from v0.4.0. #343 stopped writing it because Items are public, but v0.3.0 was already released and kept the field. v0.4.0 is not released yet, so this is the moment to drop it. The schema rejects unknown oam: fields, so a v0.4.0 Item cannot carry an email. Items on v0.3.0 still validate against v0.3.0. The owner backfill, which moves stored Items to v0.4.0, will have to remove the field from Items registered before #343.

Schema housekeeping. Symlinks for the published docs site and the bundled package schema, the v0.4.0 checksum in RELEASED_SCHEMA_SHA256, both CHANGELOGs, and docs/dev/ingest/schema.md.

After merge, new Items point to v0.4.0, with no owner until the uploader sets it.

Screenshots

N/A, no UI change.

Alternative Approaches Considered

Reusing oam:uploader_id as the owner, or keeping ownership only in the uploader database. Both are covered in ADR 0011.

For oam:uploader_email, keeping it in v0.4.0 as an unused optional field. Dropping it now means no new Item can publish an email again.

Review Guide

uvx pre-commit run --all-files
just test stactools        # fails only on the #369 test until it merges
just test stac-extension

tests/test_owner_identity.py covers the owner on Items and in the legacy sync. test_v0_4_0_drops_uploader_email checks that v0.4.0 rejects the email while a v0.3.0 Item still accepts it.

Question for reviewers: is dropping oam:uploader_email in v0.4.0 fine, or would you rather keep it until a later version?

AI Tool Usage

How much of this PR was AI-assisted? (check one)

  • 0 - No AI at any point
  • 1 - AI helped me think, but I wrote all the code myself
  • 2 - I planned the change and decided the approach; AI helped write the code
  • 3 - AI planned and wrote it; I checked and approved each step as it went
  • 4 - I set the AI going and left it to it; I reviewed the finished result
  • 5 - I set the AI going and left it to it; nobody has read the result - no review, or AI review only

If an AI agent is filling this in: declare the level honestly, and open as a draft if it is 5. Do not lower the declared level to get the PR reviewed.

If level 1 or above:

  • Tool(s) used:
  • What was generated:
  • What you reviewed and changed:

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

@somoza

somoza commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator Author

The pytest failure is the one on main that hotosm/openaerialmap#369 fixes (test_legacy_result_with_a_bare_user_id); this PR does not touch that test. I’ll rebase once hotosm/openaerialmap#369 is merged.

Add oam:owner_id to the OAM extension (v0.4.0), next to the immutable
oam:uploader_id: the owner changes when imagery is transferred, the
uploader does not. create_item writes it when set, and the legacy sync
gives legacy Items their oam-legacy|<id> account as owner until claimed.

This is the field proposed in ADR 0011. The uploader does not set it yet.

Signed-off-by: Julian Somoza <julian.somoza@gmail.com>
Items are public, so stactools-hotosm stopped writing oam:uploader_email
in #343, but v0.3.0 was already released and kept the field. v0.4.0 is
not released yet, so drop it there. The schema rejects unknown oam:
fields, so v0.4.0 Items cannot carry an email; Items on v0.3.0 still
validate against v0.3.0.

Signed-off-by: Julian Somoza <julian.somoza@gmail.com>

This branch was successfully deployed

1 active deployment
test — 3a5c6ea7 Deployed Oct 30, 2026 by somoza via stac-extension / just #33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant