Bump GOBL to v0.507.0 and refresh addon modules - #57
Merged
Merged
Conversation
Upgrade the core GOBL requirement to v0.507.0 and move every addon module
to its latest release:
gobl.br.nfse v0.0.1 -> v0.0.2
gobl.dk.oioubl v0.0.1 -> v0.0.6
gobl.mx.cfdi v0.63.0 -> v0.64.0
gobl.pt.saft v0.0.6 -> v0.0.7
Two upstream changes needed handling:
GOBL 0.507.0 adds pl-favat-v3 to its approved addon list, so the bundle
registration test failed. Add gobl.pl.ksef and its blank import. Only
v0.45.0 is built against 0.507.0; v0.44.0 and earlier target gobl 0.402.0.
GOBL 0.507.0 also deregisters the org/unit schema — Unit("") is dropped
from schema.Register and unitRules() from the rules registry in
org/org.go. Remove the now-stale entry from the expected schema list.
Verified by building all 166 example and test documents shipped by the
nine addon modules against the upgraded stack. Several addons still
target older GOBL lines (sa.zatca on 0.500.0, br.nfe/br.nfse on 0.502.2)
but execute correctly, so the lag is benign.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
==========================================
- Coverage 72.58% 72.56% -0.02%
==========================================
Files 47 48 +1
Lines 1988 1994 +6
==========================================
+ Hits 1443 1447 +4
- Misses 465 467 +2
Partials 80 80 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
GET /v0/addons/{key} returned 404 for every addon implemented in its own
module — mx-cfdi-v4, it-sdi-v1, pt-saft-v1, sa-zatca-v1, br-nfe-v4,
br-nfse-v1, dk-oioubl-v2, fi-finvoice-v3 and the three fr-ctc flows.
The handler read addons/<key>.json from core GOBL's embedded data
directory. Addons that moved out to their own modules register themselves
via init() when the bundle blank-imports them, but ship no file in that
directory, so only the addons still compiled into core resolved. The list
endpoint meanwhile reads the in-memory registry, so /v0/addons advertised
25 addons of which 12 could not be fetched.
Render the definition from the registry instead, via a new
ops.AddonData helper shared by the API and MCP server. This mirrors what
core GOBL's addons/generate.go does to produce those files, so output for
the addons still in core is byte-for-byte identical.
The same read was duplicated in the MCP addon tool and the
gobl://addons/{key} resource, and the gobl://addons resource listed the
embedded directory rather than the registry; all now go through the
helper.
Tests assert the invariant that broke — everything the registry reports
must be retrievable — so an addon moving out of core cannot regress this
again. They cover the API endpoint, both MCP paths, and the helper, and
the test packages now blank-import the bundle as the real binaries do;
without it no externally-implemented addon is registered and the gap is
invisible, which is how this shipped.
One deliberate behaviour change: /v0/addons/pl-favat-v2 no longer
resolves. It was a stale file left in core GOBL 0.505's data directory
for an addon that is not registered, so it was never listed by /v0/addons
and could not be used in a document's $addons. It is absent from core
GOBL 0.507 entirely.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Serve addon definitions from the registry, not embedded data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrades the core GOBL requirement to v0.507.0 and moves every addon module to its latest release.
Version changes
goblgobl.br.nfsegobl.dk.oioublgobl.mx.cfdigobl.pt.saftgobl.pl.ksefbr.nfe(0.0.4),fi.finvoice(0.0.2),fr.ctc(0.0.8),it.sdi(0.77.0) andsa.zatca(0.0.4) were already at their latest releases.Incompatibilities resolved
New approved addon
pl-favat-v3. GOBL 0.507.0 adds Poland's KSeF addon to its approved list, soTestApprovedAddonsAvailablefailed. Addedgobl.pl.ksefplus its blank import inbundle/bundle.go. Note this is the one bump that isn't a straight upgrade — v0.44.0 and earlier target gobl 0.402.0; only v0.45.0 is built for 0.507.0.org/unitschema deregistered upstream.TestBulk/schemasfailed because 0.507.0 dropsUnit("")fromschema.RegisterandunitRules()from the rules registry inorg/org.go. This is a deliberate upstream removal, so the stale entry is removed from the expected schema list.Verification
go build ./...,go vet ./...and the full test suite pass; the WASM target (GOOS=js GOARCH=wasm) builds.pl-favat-v3.sa.zatcaon 0.500.0,br.nfe/br.nfseon 0.502.2), so I built all 166 example and test documents shipped by the nine addon modules through the CLI against the upgraded stack — 166 pass, 0 fail. The older-line addons execute their rule engines correctly, so the lag is benign.next-version.shcomputesv0.507.0, so release versioning follows automatically.Left out of scope
gobl.ublstays at v0.64.0 (v0.74.0 exists). It's a graph-only requirement fromgobl.dk.oioubl@v0.0.6— not ingo.mod, not compiled in, andgo mod whyconfirms the main module doesn't need it.popui.go,mcp-go,templ,icons). Unrelated to this upgrade, andmcp-gocrosses a major version, so they're better handled separately.🤖 Generated with Claude Code