Skip to content

epcis: use the unversioned EPCIS context URL - #1

Merged
sboeckelmann merged 2 commits into
mainfrom
epcis/unversioned-context
Sep 12, 2026
Merged

sboeckelmann merged 2 commits into
mainfrom
epcis/unversioned-context

Conversation

@sboeckelmann

Copy link
Copy Markdown
Contributor

compat: EPCIS_CONTEXT pinned https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld. GS1 publishes the context unversioned at .../standards/epcis/epcis-context.jsonld; the versioned form pins a snapshot we do not mean.

Every document this library builds carried it, so it appears in every capture — and in the EPCIS tab of the Odoo connector, which vendors this package.

schemaVersion stays "2.0" — that is the property's value, not the context version, and GS1's own published examples carry it that way too.

The eventID does not move. As the constant's own docstring says, the context belongs on the document, not on the event, and the hash is taken over the event. The two tests that pin literal ni:///sha-256; values stay green.

Verified: 169 passed, 27 subtests, with the hash extra installed. (Without it, 7 hash tests error out on a missing epcis_event_hash_generator — that is pre-existing and unrelated: the same 7 fail on an untouched checkout.)

Follow-up: once this is in, openepcis-odoo needs a re-vendor (tools/vendor_benelog_client.sh) — its vendor/README.md says never to edit the copy by hand.

EPCIS_CONTEXT pinned
https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld. GS1 publishes
the context unversioned at .../standards/epcis/epcis-context.jsonld; the
versioned form pins a snapshot we do not mean. Every document this library
builds carried it, so it shows up in every capture and in the EPCIS tab of the
Odoo connector, which vendors this package.

`schemaVersion` stays "2.0" — that is the property's value, not the context
version, and GS1's own published examples carry it that way too.

The eventID does not move. As the constant's own docstring says, the context
belongs on the document, not on the event, and the hash is taken over the
event. The two tests that pin literal ni:///sha-256; values stay green: 169
passed, 27 subtests, with the `hash` extra installed.
Die unversionierte URL ist kuerzer, damit passt der Ausdruck in
test_events.py wieder auf eine Zeile. Reine Formatierung, kein Verhalten --
ruff 0.16.2, wie in pyproject gepinnt.
@sboeckelmann
sboeckelmann merged commit aa34f2b into main Sep 12, 2026
9 checks passed
@sboeckelmann
sboeckelmann deleted the epcis/unversioned-context branch September 12, 2026 17:24
sboeckelmann pushed a commit that referenced this pull request Sep 13, 2026
Since #1 every document carries the unversioned context URL. The hash
generator ships the context as a file, but keyed by the versioned URL
only; for ours its loader fell back to the internet. Locally that goes
unnoticed. In the Odoo test suite external requests are forbidden, so the
re-vendor broke test_the_document_leaves_without_an_event_id there — and
a pod without egress would fail to stamp a single eventID in production.

The generator's loader is wrapped: the unversioned URL is answered from the
bundled snapshot (the published document is the same; GS1 has issued no
later revision), everything else passes through as before. A test pins it
by forbidding requests.Session.request and stamping the golden event.

Signed-off-by: Schroeer, Imke <imke.schroeer@benelog.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant