sync: latest JTL karrio subtree (2026-06-23) — regressions triaged#1129
Draft
danh91 wants to merge 1 commit into
Draft
sync: latest JTL karrio subtree (2026-06-23) — regressions triaged#1129danh91 wants to merge 1 commit into
danh91 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| @@ -897,7 +782,7 @@ | |||
| try: | |||
| 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 |
|
|
||
| try: | ||
| rate_sheet.batch_update_surcharges(surcharges) | ||
| except ValueError as e: | ||
| raise exceptions.ValidationError({"surcharges": str(e)}) | ||
| raise exceptions.ValidationError({"surcharges": str(e)}) from e |
|
|
||
| try: | ||
| 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 |
| surcharge_data = input["surcharge"] | ||
| surcharge_dict = {k: v for k, v in surcharge_data.items() if not utils.is_unset(v)} | ||
|
|
||
| try: | ||
| rate_sheet.update_surcharge(input["surcharge_id"], surcharge_dict) | ||
| except ValueError as e: | ||
| raise exceptions.ValidationError({"surcharge_id": str(e)}) | ||
| raise exceptions.ValidationError({"surcharge_id": str(e)}) from e |
| zone_data = input["zone"] | ||
| zone_dict = {k: v for k, v in zone_data.items() if not utils.is_unset(v)} | ||
|
|
||
| try: | ||
| 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 |
| zone_data = input["zone"] | ||
| zone_dict = {k: v for k, v in zone_data.items() if not utils.is_unset(v)} | ||
|
|
||
| try: | ||
| rate_sheet.add_zone(zone_dict) | ||
| except ValueError as e: | ||
| raise exceptions.ValidationError({"zone": str(e)}) | ||
| raise exceptions.ValidationError({"zone": str(e)}) from e |
| { | ||
| "errors": [ | ||
| { | ||
| "message": "Staff access required", |
| ) -> "BatchUpdateSurchargesMutation": | ||
| def mutate(info: Info, **input: inputs.base.BatchUpdateSurchargesMutationInput) -> "BatchUpdateSurchargesMutation": | ||
| from rest_framework import exceptions | ||
|
|
| @strawberry.type | ||
| class DeleteSharedZoneMutation(utils.BaseMutation): | ||
| rate_sheet: typing.Optional[types.SystemRateSheetType] = None | ||
| rate_sheet: types.SystemRateSheetType | None = None |
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.
Summary
Fresh subtree sync of the latest karrio (OSS) subtree from
jtlshipping/shipping-platformmain (cae41427), onto a new branch offmain. 66 code conflicts triaged (16 reflow, 50 semantic) via a multi-agent workflow; 1613 files in the sync commit; 0 byte-compile failures.How conflicts were resolved
These are karrio fixes the platform lacks (it last synced before karrio's 2026.1.x releases); each was preserved via merge/keep-karrio rather than overwritten:
apps/api/karrio/server/settings/__init__.py— The platform alphabetizes the top import block (apm, base, cache, constance, debug, email, workers), which placesapmBEFOREworkers. karrio current/origin-main deliberately importsworkersbeforeapmper GH Worker/huey ignores REDIS_HOST and connects to localhost when OTEL_ENABLED=true (import-order race in settings) #1124: apm's OTEL block …apps/api/karrio/server/settings/base.py— Platform version is a near-superset of karrio current (adds [patch] 2025.5.7 #926 PASSWORD_HASHERS hardening, feat: Australiapost full integration #508 inline Postgres keepalives+psycopg3 pool, dj_database_url conn_max_age=60/conn_health_checks, plus import reflow and dropping an unused `logge…apps/api/karrio/server/settings/constance.py— Two-sided change. Platform adds the paperless-trade ETD feature (DEFAULT_COMMERCIAL_INVOICE_TEMPLATE + PAPERLESS_DEFAULT_INVOICE_TEMPLATE config, a CONSTANCE_CONFIG entry, and a "Paperless Trade" fieldset). Karrio (origin/main + current syn…apps/web/public/carrier-integrations.json— karrio current == origin/main (338819 bytes, 52 carriers); platform is OLDER/smaller (289834 bytes, 51 carriers). Taking platform blindly would regress karrio badly: (1) DROP all 485 human-readablelabelfields on connection_fields/config…modules/admin/karrio/server/admin/schemas/base/mutations.py— Most deltas are reflow (typing.Optional->| None, List->list, import sorting, collapsed comprehensions/calls,raise ... from e). Two semantic axes: (1) the platform REMOVES@admin.staff_requiredfrom InstanceConfigMutation/CreateRateShee…modules/connectors/dhl_express/karrio/providers/dhl_express/rate.py— The .rej hunk itself is pure reflow (collapsing the QtdShpExChrg list comprehension to one line), but the platform's FULL file lags karrio on two real changes, making it semantic + high-risk to take-platform: 1) SoftwareName accessor (line…modules/connectors/dhl_parcel_de/karrio/providers/dhl_parcel_de/shipment/create.py— Karrio current is strictly NEWER than the platform (jtl-main) version; the platform's rejected hunks are an obsolete earlier attempt to reach a state karrio already surpassed. The .rej hunks try to transform origin/main's OLD flat structure…modules/connectors/fedex/karrio/providers/fedex/rate.py— The .rej hunks are pure reflow (line-joining + a list-shaped signatureOptionType), but the platform's FULL file is semantically OLDER than karrio and would DROP four karrio-only fixes present in both origin/main and the current sync file: (…modules/connectors/fedex/karrio/providers/fedex/shipment/create.py— The platform version predates karrio's 2026.1.x fixes and would DROP five karrio-only behaviors that exist in both the karrio-current (sync branch) file and origin/main: (1) configurable pickupType via options.fedex_pickup_type.state (platf…modules/connectors/fedex/karrio/providers/fedex/units.py— Both sides have real, non-overlapping changes. KARRIO-ONLY (newer 2026.1.x fixes absent from platform): three new enums FedExPickupType/FedExPickupAddressType/FedExPackageLocation; new ShippingOption entries fedex_pickup_type (with help tex…modules/connectors/fedex/tests/fedex/test_shipment.py— NOT a reflow — the .rej hunk alone looks like black line-wrapping, but a full token-stream diff shows deep semantic divergence in the expected FedEx ShipmentRequest fixtures and in the test class itself. Karrio current has 3 test methods A…modules/connectors/landmark/tests/landmark/test_tracking.py— Platform's rejected hunks are pure formatting reflow (collapsing wrappedparsed_response = (...)and assert calls onto single lines). But the whitespace-insensitive diff reveals TWO karrio-only semantic fixes (present in origin/main and k…modules/connectors/smartkargo/karrio/providers/smartkargo/error.py— karrio current (== origin/main) is a newer, richer rewrite of the SmartKargo error parser. The platform's full file is the OLDER, simpler implementation and the .rej hunk only carries cosmetic intent (dropimport typing, use PEP 604 `dict…modules/connectors/smartkargo/karrio/providers/smartkargo/shipment/cancel.py— Platform's rejected hunk is pure reflow (wrapping the dict-comprehension across lines, movingif v is not None). BUT the platform's full file predates karrio's 2026.1.x fix: it lacks thesmartkargo_-prefixed meta-key fallback in TWO pla…modules/connectors/smartkargo/karrio/providers/smartkargo/shipment/create.py— karrio current carries 2026.1.x field-length fixes that the platform version lacks: lib.text(..., max=N) truncation on reference (trim=True, max=35), packageDescription (max=100), labelRef2 (max=20), all Shipper/Consignee participant fields…modules/connectors/smartkargo/karrio/providers/smartkargo/tracking.py— karrio current == origin/main and both strictly supersede the platform version. The platform's .rej hunks are pure reflow (typing.List/Tuple -> list/tuple, import reordering, line unwrapping, _has_valid_tracking helper extraction) with NO l…modules/core/karrio/server/core/apps.py— karrio current AND origin/main both import system checks (from karrio.server.core import checks # noqa: F401 — registers system checks) in CoreConfig.ready(). The platform version does NOT have this import — it predates karrio's checks-r…modules/core/karrio/server/core/datatypes.py— The only substantive divergence is theRateRequestblock. Platform wantstyping.List/typing.Dict->list/dict(pure reflow), but the platform version ALSO lacksis_return: bool = Falseon RateRequest, which exists in BOTH origin…modules/core/karrio/server/core/filters.py— Both sides carry real logic the other lacks, so neither version can be taken wholesale. KARRIO-ONLY feature that platform LACKS (would be dropped by take-platform => high regression risk): anis_archivedBooleanFilter on ShipmentFilters,…modules/core/karrio/server/core/serializers.py— The .rej hunks themselves are pure reflow (line-unwrapping of CharField/ChoiceField definitions on PickupDetails/TrackingEvent/TrackerDetails), but a full diff of karrio-current vs the platform version reveals real semantic divergence — and…modules/core/karrio/server/core/signals.py— karrio current + origin/main both carry an N+1 fix the platform lacks: a_batch_fetch_constance(keys)helper plus a batch-queryupdate_settings(single Constance query with pickle deserialization + CONSTANCE_CONFIG fallback, then a geta…modules/core/karrio/server/core/utils.py— Real divergence on BOTH sides. Karrio current (== origin/main) carries a runtime fix the platform lacks: a module-level bounded_ASYNC_EXECUTOR = futures.ThreadPoolExecutor(max_workers=4)with@atexit.registershutdown, plus `run_async(…modules/core/karrio/server/providers/migrations/0104_merge_0103.py— Not pure reflow. Beyond formatting (double quotes, no blank line,operations = []), the platform version adds a SECOND migration dependency: ("providers", "0103_rename_carrier_secret_refs_carrier_name_idx_carrier_sec_carrier_c84a81_idx_an…modules/core/karrio/server/providers/models/connection.py— Karrio current strictly supersedes the platform version. The platform's only real change (the rejected hunk: simplifying get_credentials/set_credentials to drop the credential_manager/SECRET_ENCRYPTION_ENABLED branch and return dict(self.cr…modules/core/karrio/server/providers/serializers/base.py— karrio-current already contains everything the .rej hunk intended (decorator swap @utils.pre_processing -> @utils.hookable on both CarrierConnectionModelSerializer and BrokeredConnectionModelSerializer, the `_create_new(validated_data, cont…modules/core/karrio/server/serializers/abstract.py— The .rej is a cosmetic reflow (any((x for ..)) -> any(x for ..), un-wrapping the item_instance ternary) that the platform authored against its OLDER copy of save_many_to_many_data. It failed to apply because karrio already rewrote that whol…modules/events/karrio/server/events/task_definitions/base/archiving.py— karrio current (origin/main) contains the GH periodic_data_archiving deletes accumulated backlog in a single unbatched transaction (first-run trap) #1125 OOM fix: a module-level BATCH_SIZE, _batched_delete() and _batched_delete_with_links() helpers, and all bulk_delete* functions now delete in bounded batches. The platform (jtl-main) versi…modules/events/karrio/server/events/task_definitions/base/tracking.py— Both sides have changes to keep, so take-platform would regress. Karrio (origin/main + current) carries fixes ABSENT from the platform full version: TRACKER_MAX_ACTIVE_DAYS constant, _get_max_active_days() (constance-backed), _retire_aged_o…modules/graph/karrio/server/graph/schemas/base/__init__.py— Logic is nearly identical and the rejected hunk itself is pure reflow (single-line vs multi-line metafield mutation signatures). BUT the platform version is stale: it predates two karrio-only additions present in karrio current/sync that ta…modules/graph/karrio/server/graph/schemas/base/inputs.py— Conflict is ~95% reflow (typing.Optional[X] -> X | None, typing.List -> list, dropped dead imports pydoc/typing/providers/serializers which have zero real usage in the file body). But there ARE real semantic deltas in BOTH directions, so th…modules/graph/karrio/server/graph/schemas/base/mutations.py— Semantic conflict, both sides have real logic to keep. Three substantive divergences: (1) UpdateCarrierConnectionMutation - platform addsmessages = _build_connection_messages(...)+messages=messagesin return (the rejected hunk); karr…modules/graph/karrio/server/graph/schemas/base/types.py— Both sides have real, non-overlapping logic, so neither blind take is safe. KARRIO-ONLY fixes that the platform version lacks (would be DROPPED by take-platform): (1) archived-records support — is_archived/archived_at fields + the all_objec…modules/graph/karrio/server/graph/serializers.py— The .rej hunks themselves are pure reflow (unwrapping 3 method signatures + one set() call in _RateSheetSerializerMixin), but the file as a whole is a SEMANTIC conflict. Whitespace-insensitive diff of karrio-current vs platform shows four m…modules/manager/karrio/server/manager/models.py— The platform's intended change (the .rej hunks) is pure reflow: collapsing multi-line JSONField(...) and HIDDEN_PROPS declarations onto single lines. But the conflict is semantic overall because karrio current carries a substantial feature …modules/manager/karrio/server/manager/tests/test_shipments.py— Semantic conflict, not reflow. Karrio current is a strict superset of the platform's content with TWO karrio-only post-sync additions the platform lacks entirely: (1) is_archived/archived_at fields in response fixtures (4+4 occurrences; pla…modules/manager/karrio/server/manager/tests/test_trackers.py— Every difference between the platform version and karrio current is a karrio-newer fix that the platform predates; taking the platform file would break the test suite. Authoritative diff (platform<vs karrio current>): 1. estimated_d…modules/manager/karrio/server/manager/views/shipments.py— The .rej hunk is import-block reflow only (reordering/regrouping imports + dropping the unusedexceptions as drf_exceptionsimport). The semantic divergence is in ShipmentCancel.post: karrio current AND origin/main carry a fix wherepk…modules/manager/karrio/server/manager/views/trackers.py— Genuine two-sided semantic conflict; both sides carry fixes the other lacks, so neither pure side is safe. KARRIO-only (in origin/main, DROPPED by platform): (1) URL path param renamed toidentifierwith<str:identifier>route + OpenAP…modules/orders/karrio/server/orders/models.py— The .rej hunk itself is pure reflow (collapsing options/metadata/shipments field defs onto single lines), but the file as a whole is a SEMANTIC conflict. Karrio current AND origin/main contain an archiving feature that the platform version …modules/pricing/karrio/server/pricing/signals.py— Both sides diverge from origin/main. Platform adds theenrich_brokered_rates_with_sheet_metacall in apply_custom_markups (live-carrier plan_costs parity) — karrio current lacks it. Karrio current has TWO newer fixes the platform never sa…modules/sdk/karrio/core/models.py— The .rej hunk itself is pure reflow (List->list, Dict->dict in RateRequest lines 163/170/171). But comparing karrio-current vs the platform full file reveals TWO additional differences that are karrio-only fixes the platform lacks, so take-…modules/sdk/karrio/core/utils/helpers.py— Semantic conflict, NOT reflow. Both sides have changes to keep, so blindly taking the platform version would drop three karrio-only fixes. Critically, karrio current is in a broken half-applied state: callers at lines 510/625 call urlopen…modules/sdk/karrio/core/utils/tracing.py— The platform version predates two karrio-only fixes and reintroduces an anti-pattern. (1) Thread-safety: karrio current addsself._recordings_lock = threading.Lock()and uses it to guardinner_recordingsin bothtrace()(submit) and `…