Skip to content

sync: shipping-platform patches 2026-04-19#1068

Merged
danh91 merged 1 commit into
mainfrom
sync/shipping-platform-2026-04-19
Apr 19, 2026
Merged

sync: shipping-platform patches 2026-04-19#1068
danh91 merged 1 commit into
mainfrom
sync/shipping-platform-2026-04-19

Conversation

@danh91

@danh91 danh91 commented Apr 19, 2026

Copy link
Copy Markdown
Member

Summary

Sub-PR 3a of the 2026.5.0 umbrella release (#1065 / PRDs/RELEASE_2026_5_PLATFORM_UPGRADE.md).

Pulls 1445 files of accumulated shipping-platform work back upstream per PRDs/SUBTREE_SYNC_WORKFLOW.md. Counterpart sync into karrio-insiders main is karrioapi/karrio-insiders#32.

Area Files
modules/connectors 579
modules/core 198
apps/api 160
modules/manager 113
modules/pricing 75
modules/sdk 55
modules/events 46
modules/orders 39
modules/data 36
modules/documents 28
modules/graph 25
modules/admin 24
packages/, plugins/, scripts, PRDs (remainder)

Net: +41,610 / -20,154.

Source

# in shipping-platform
./bin/export-karrio-patches --force -o /tmp/karrio.patch

# in karrio
git checkout -b sync/shipping-platform-2026-04-19
git apply --3way \
  --exclude='apps/api/locale/de/LC_MESSAGES/django.mo' \
  --exclude='modules/data/karrio/server/data/templates/rate-sheet-template.xlsx' \
  --exclude='packages/e2e/fixtures/rate-sheet-*.xlsx' \
  --exclude='modules/core/karrio/server/providers/{credential_manager,secret_manager,rotation,...}.py' \
  /tmp/karrio.patch
# ...resolve 54 three-way conflicts, then copy 5 binary files from SP

Shipping-platform was 77 commits behind upstream when the patch was generated — expected per SUBTREE_SYNC_WORKFLOW.md ("5000+ commits ahead is normal").

Pre-exclusions (not in diff, intentional)

Phantom deletions (10 files) — SP-experimental credential/secret modules that never reached upstream, so there's nothing to delete:

  • modules/core/karrio/server/providers/{credential_manager,secret_manager,rotation}.py
  • modules/core/karrio/server/providers/models/secret.py
  • modules/core/karrio/server/providers/management/commands/{check_kek_usage,migrate_credentials_to_encrypted,rotate_secrets}.py
  • modules/core/karrio/server/providers/migrations/{0102_add_secret_storage,0103_rename_carrier_secret_refs_...}.py
  • modules/core/karrio/server/providers/tests/test_secret_encryption.py

Binary new files (5 files) — git's patch format lacked the --full-index line; copied directly from SP after the text patch applied:

  • apps/api/locale/de/LC_MESSAGES/django.mo
  • modules/data/karrio/server/data/templates/rate-sheet-template.xlsx
  • packages/e2e/fixtures/rate-sheet-{errors,updated,valid}.xlsx

Conflict Resolution (54 files)

Per the SUBTREE_SYNC_WORKFLOW.md matrix. Default on ambiguity: keep upstream (ours).

Connector i18n (4)

File Resolution Reason
modules/connectors/asendia/.../i18n.py merge both SP has e-PAQ naming matching units.py; ours had unique cup/country_road/priority variants. Kept both sets.
modules/connectors/dhl_parcel_de/.../i18n.py take SP SP adds ~40 OPTION_NAME_TRANSLATIONS entries; upstream dict was empty.
modules/connectors/usps/.../i18n.py keep upstream Ruff reflow only.
modules/connectors/usps_international/.../i18n.py keep upstream Ruff reflow only.

Connector providers (9)

File Resolution Reason
smartkargo/** (5 files) keep upstream New upstream carrier; SP is 77 commits behind and doesn't have it.
dhl_express/address.py keep upstream Uses upstream connection_config.software_name.state.
dhl_express/tests/.../test_shipment.py keep upstream SP's fixture has stale <LocalProductCode>P</LocalProductCode>.
dhl_parcel_de/.../shipment/create.py take SP Reference fallback via upstream-defined option.
fedex/rate.py, fedex/shipment/create.py keep upstream Authoritative signature defaults + email-notification logic.
ups/rate.py keep upstream Var-name consistency.

Core server (17)

File Resolution Reason
settings/base.py, core/gateway.py, core/signals.py, core/serializers.py, core/hooks.py, core/views/references.py, core/tests/test_sentry_shipment_context.py keep upstream Upstream N+1 batching, archive fields, typing style.
core/tests/test_references_i18n.py take SP SP has additional assertions for upstream reference-view expansions.
providers/migrations/0104_merge_0103.py keep upstream Theirs references a migration 0103_rename_carrier_secret_refs_... that doesn't exist here.
providers/models/__init__.py merge both Kept upstream _hookable + added SP's ServiceLevel/AccountRateSheet/RateSheet/SystemRateSheet/LabelTemplate/has_rate_sheet imports.
providers/models/{carrier,connection}.py, providers/serializers/base.py keep upstream Richer docstrings + "encryption-aware method" comment.
providers/views/carriers.py merge both Dedup django.conf.settings + kept SP's VirtualDownloadView / datatypes / dataunits / serializers imports (referenced in file body).
serializers/abstract.py, tracing/utils.py keep upstream Upstream N+1 bulk_create + matches codebase pass-on-exception pattern.

Graph / archive-unarchive (5)

All modules/graph/karrio/server/graph/schemas/base/{__init__,inputs,mutations,types}.py + graph/serializers.pykeep upstream. Upstream shipped archive/unarchive mutations, is_archived/archived_at fields, all_objects manager routing, and rate-sheet bulk_create fix that SP doesn't have.

UI (2)

File Resolution Reason
packages/ui/components/rate-sheet-editor.tsx keep upstream Different UX choice (refetch+stay vs close-with-importedCount).
packages/ui/components/rate-sheet-import-panel.tsx keep upstream Upstream has additional "Download sample" link + different template paths.

SDK, data, manager, orders, pricing (other, 14)

File Resolution Reason
modules/data/** (5 files) keep upstream Upstream rate-sheet work is significantly larger (67 conflict blocks in rate_sheets.py).
modules/manager/.../views/shipments.py keep upstream Pure import reflow.
modules/manager/.../views/trackers.py keep upstream SP partial rename of identifier would break consistency.
modules/orders/.../serializers/base.py, orders/views.py keep upstream is_archived/archived_at on Order.
modules/pricing/.../signals.py keep upstream SP strict-org-only plan resolution vs upstream multi-source — business logic difference, defaulted to upstream.
modules/sdk/.../i18n/{__init__,translations}.py keep upstream Minor — __all__ addition/reorder, line-wrap.
modules/sdk/.../utils/helpers.py keep upstream Upstream redacts many more sensitive header names (access_key, api-key, client-secret, ...).
modules/sdk/.../utils/tracing.py keep upstream Upstream adds threading.Lock for thread-safe recordings.

Migrations (1) + Localization (1)

  • modules/data/.../migrations/0004_add_rate_sheet_resource_type.py → keep upstream (blank-line diff).
  • apps/api/locale/de/LC_MESSAGES/django.po → take SP (SP has 111 more msgid entries; upstream-unique ones are all #~ obsolete stubs that compilemessages regenerates).

Contamination Check

grep -E 'modules/(entitlements|wawi|servicebus|beta|support|jtl|security)/' /tmp/karrio.patch
# → (empty)

Test plan

  • CI green (SDK + Django + build)
  • ./bin/run-sdk-tests passes locally
  • ./bin/run-server-tests passes locally (new modules/apps + modules/audit migrations present)
  • Review modules/providers/views/carriers.py merge (new dataunits/datatypes/serializers imports all have call sites)
  • Review providers/models/__init__.py merge (all six added imports resolved by downstream consumers)
  • Consider regenerating apps/api/locale/de/LC_MESSAGES/django.mo from the updated .po via ./manage.py compilemessages

Post-merge

Per SUBTREE_SYNC_WORKFLOW.md Phase 8, once this merges back in shipping-platform:

./bin/update-subtrees

…core)

Exported from jtlshipping/shipping-platform main via
./bin/export-karrio-patches --force per PRDs/SUBTREE_SYNC_WORKFLOW.md.

1445 files across modules/connectors (579), modules/core (198),
apps/api (160), modules/manager (113), modules/pricing (75),
modules/sdk (55), modules/events (46), modules/orders (39),
modules/data (36), modules/documents (28), modules/graph (25),
modules/admin (24) + packages, plugins, scripts, and PRDs.

Major functional additions from shipping-platform:
- rate sheet Excel/CSV import/export (apps/, packages/, modules/data/)
- Playwright e2e package scaffold (packages/e2e/)
- dhl_parcel_de improvements (optional dims, reference fallback)
- carrier i18n translation expansions (dhl_parcel_de, asendia)
- ruff-format reflow across the tree from SP's linter config

54 three-way conflicts resolved per SUBTREE_SYNC_WORKFLOW.md matrix
(see PR body for per-file decisions). Smartkargo, FedEx signature
defaults, rate-sheet UX variants, and graph archive/unarchive kept
at upstream (ours); carrier i18n dicts merged; e2e fixtures and
de locale compiled catalog copied directly from SP.

Pre-excluded from apply: 10 phantom-deletions of SP-experimental
credential/secret modules that never reached upstream, and 5
binary-new files that needed direct copy (xlsx fixtures, django.mo).
No JTL-proprietary modules in diff.
@vercel

vercel Bot commented Apr 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
karrio-web Ready Ready Preview, Comment Apr 19, 2026 10:16am

Request Review

)
except Exception as exc:
return Response(
{"errors": [{"message": str(exc)}]},
rate_sheet.batch_update_service_rates(updates)
except ValueError as e:
raise exceptions.ValidationError({"rates": str(e)})
raise exceptions.ValidationError({"rates": str(e)}) from e
)
except ValueError as e:
raise exceptions.ValidationError({"rate": str(e)})
raise exceptions.ValidationError({"rate": str(e)}) from e
rate_sheet.batch_update_surcharges(surcharges)
except ValueError as e:
raise exceptions.ValidationError({"surcharges": str(e)})
raise exceptions.ValidationError({"surcharges": str(e)}) from e
rate_sheet.remove_surcharge(input["surcharge_id"])
except ValueError as e:
raise exceptions.ValidationError({"surcharge_id": str(e)})
raise exceptions.ValidationError({"surcharge_id": str(e)}) from e
rate_sheet.add_surcharge(surcharge_dict)
except ValueError as e:
raise exceptions.ValidationError({"surcharge": str(e)})
raise exceptions.ValidationError({"surcharge": str(e)}) from e
rate_sheet.remove_zone(input["zone_id"])
except ValueError as e:
raise exceptions.ValidationError({"zone_id": str(e)})
raise exceptions.ValidationError({"zone_id": str(e)}) from e
rate_sheet.update_zone(input["zone_id"], zone_dict)
except ValueError as e:
raise exceptions.ValidationError({"zone_id": str(e)})
raise exceptions.ValidationError({"zone_id": str(e)}) from e
rate_sheet.add_zone(zone_dict)
except ValueError as e:
raise exceptions.ValidationError({"zone": str(e)})
raise exceptions.ValidationError({"zone": str(e)}) from e
refresh = jwt.RefreshToken(refresh_token)
except TokenError as e:
# Blacklisted / expired / malformed → 401, not 500.
raise exceptions.AuthenticationFailed(str(e), code="token_not_valid") from e
@danh91 danh91 merged commit e108ee7 into main Apr 19, 2026
10 of 15 checks passed
@danh91 danh91 deleted the sync/shipping-platform-2026-04-19 branch April 19, 2026 11:02
danh91 added a commit that referenced this pull request Apr 19, 2026
Picks up karrioapi/karrio-insiders#32 (158 files, orgs/automation/apps/audit).
Completes Wave 0 of the 2026.5 umbrella on feat/2026.5 — paired with
the karrio-side sync merged as #1068 (now in main).
danh91 added a commit that referenced this pull request Apr 19, 2026
Post-Wave-0-sync fixes — CI was failing on feat/2026.5 for two reasons
introduced by the shipping-platform sync (#1068):

1. modules/huey/ exists in the tree (task-backend abstraction from SP)
   but was never added to requirements.server.dev.txt or requirements.
   build.txt. INSTALLED_APPS declares huey.contrib.djhuey, so Django
   AppConfig.create() fails with ModuleNotFoundError: No module named
   'huey'. Add -e ./modules/huey to both files — its pyproject pulls
   huey>=2.5 transitively.

2. modules/sdk/karrio/lib.py:259 uses Python 3.12 type-parameter syntax
   (def to_list[T]: ...) but mypy.ini declared python_version = 3.10,
   so SDK typecheck fails. Bump to 3.12 to match the runtime.
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.

2 participants