apiVersion: jenkins.io/v1 kind: PipelineActivity metadata: annotations: lighthouse.jenkins-x.io/cloneURI: https://github.com/greencapitaltrade/bifrost.git lighthouse.jenkins-x.io/job: release pipeline.jenkins-x.io/traceID: f50e410ff497a520dbb51c05f574b09c creationTimestamp: "2026-07-29T11:33:43Z" generation: 8 labels: branch: main build: "159" context: release created-by-lighthouse: "true" event-GUID: 565a3eb0-8b41-11f1-8f7b-afdde0ece7b6 lighthouse.jenkins-x.io/baseSHA: fa7a1f1373ad2a489064eb80b6c52f8ff4daf94c lighthouse.jenkins-x.io/branch: main lighthouse.jenkins-x.io/buildNum: "1785324823721" lighthouse.jenkins-x.io/context: release lighthouse.jenkins-x.io/id: apitaltrade-bifrost-main-release-9zhm8 lighthouse.jenkins-x.io/job: release lighthouse.jenkins-x.io/lastCommitSHA: fa7a1f1373ad2a489064eb80b6c52f8ff4daf94c lighthouse.jenkins-x.io/refs.org: greencapitaltrade lighthouse.jenkins-x.io/refs.repo: bifrost lighthouse.jenkins-x.io/type: postsubmit owner: greencapitaltrade podName: apitaltrade-bifrost-main-release-shp6c-from-build-pack-pod provider: github repository: bifrost tekton.dev/pipeline: apitaltrade-bifrost-main-release managedFields: - apiVersion: jenkins.io/v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:labels: f:branch: {} f:context: {} f:owner: {} f:provider: {} f:repository: {} f:spec: f:lastCommitMessage: {} f:lastCommitSHA: {} f:releaseNotesURL: {} f:version: {} manager: jx-changelog-0.10.29 operation: Update time: "2026-07-29T11:51:40Z" - apiVersion: jenkins.io/v1 fieldsType: FieldsV1 fieldsV1: f:metadata: f:annotations: .: {} f:lighthouse.jenkins-x.io/cloneURI: {} f:lighthouse.jenkins-x.io/job: {} f:labels: .: {} f:build: {} f:created-by-lighthouse: {} f:event-GUID: {} f:lighthouse.jenkins-x.io/baseSHA: {} f:lighthouse.jenkins-x.io/branch: {} f:lighthouse.jenkins-x.io/buildNum: {} f:lighthouse.jenkins-x.io/context: {} f:lighthouse.jenkins-x.io/id: {} f:lighthouse.jenkins-x.io/job: {} f:lighthouse.jenkins-x.io/lastCommitSHA: {} f:lighthouse.jenkins-x.io/refs.org: {} f:lighthouse.jenkins-x.io/refs.repo: {} f:lighthouse.jenkins-x.io/type: {} f:podName: {} f:tekton.dev/pipeline: {} f:spec: .: {} f:baseSHA: {} f:batchPipelineActivity: {} f:build: {} f:completedTimestamp: {} f:context: {} f:gitBranch: {} f:gitOwner: {} f:gitRepository: {} f:gitUrl: {} f:message: {} f:pipeline: {} f:startedTimestamp: {} f:status: {} f:steps: {} manager: jx-build-controller operation: Update time: "2026-07-29T11:53:33Z" name: greencapitaltrade-bifrost-main-159 namespace: jx resourceVersion: "226178621" uid: 07ff988f-ad73-4d45-aaab-356a824c6777 spec: baseSHA: fa7a1f1373ad2a489064eb80b6c52f8ff4daf94c batchPipelineActivity: {} build: "159" buildLogsUrl: s3://logs-gct-prod-20260425045301534100000007/jenkins-x/logs/greencapitaltrade/bifrost/main/159.log completedTimestamp: "2026-07-29T11:53:31Z" context: release gitBranch: main gitOwner: greencapitaltrade gitRepository: bifrost gitUrl: https://github.com/greencapitaltrade/bifrost.git lastCommitMessage: | fix(asset): stop telemetry writes contending on a shared current-location row Fixes bifrost#411 and four related defects in the IoT telemetry write path in addons/asset_management/, all verified against production logs. 1. SerializationFailure dropping telemetry (main fix, bifrost#411). `_update_current_location()` cleared the previous `is_current_location` holder and set the new one on every position write — a read-modify-write against one shared row per device. Odoo runs at REPEATABLE READ, so two positions for the same device arriving together both UPDATE that row and Postgres aborts the second with "could not serialize access due to concurrent update". Deadpool classified the resulting InFailedSqlTransaction as permanent and discarded the frame, losing telemetry. "Current location" is now derived from the newest valid fix via a new `_current_fix_ids()` helper (one indexed DISTINCT ON). The write path is append-only and performs no UPDATE, removing the contention instead of merely making it rarer. `is_current_location` is retained but deprecated (no longer written or read); drop it later. 2. `store_child_data` never ran — silent total data loss. `create_from_normalized_data` called a bare `timescale_manager`, a name never assigned anywhere in the file: a guaranteed NameError swallowed by a broad `except Exception`. Every fuel, temperature, accelerometer and event reading was discarded. Now calls `self.env['asset.timescale.iot.manager']`. 3. `_ensure_tables` ran DDL on every single telemetry write. The guard was `hasattr(self, '_tables_ensured')` followed by `self._tables_ensured = True`. Neither half worked: `self` is a fresh recordset per call so the check was always False, and `BaseModel.__slots__` is ('env', '_ids', '_prefetch_ids') so the assignment raised AttributeError anyway (verified in the prod container). Replaced with a class-level, lock-guarded set keyed by target database name. 4. `fuel_level` referenced but not a field on `asset.iot.data`. It only exists as a TimescaleDB column. `get_current_locations`, `get_device_locations`, `get_location_history` and `create_from_iot_device` all referenced it, raising AttributeError whenever those methods returned any row. Removed (child data lives in TimescaleDB by design). 5. `current_driver_name` does not exist on `asset.asset`. Same methods raised AttributeError. Now uses `driver_id.name`; response key renamed `driver_name` -> `operator_name` per house convention. Safe: the method always raised, so nothing can depend on the old key. Also updates the critical-command safety gate in asset_iot_command.py (speed check before engine cutoff), which selected the row by `is_current_location`; it now selects the newest valid fix by timestamp. Behaviourally equivalent. New test file addons/asset_management/tests/test_iot_data_current_location.py (8 tests) registered in tests/__init__.py. Baseline vs branch, both run in the devcontainer: - clean origin/main baseline: 17 failed, 136 errors of 401 tests - this branch: 17 failed, 136 errors of 409 tests Zero regressions, +8 new passing tests. The pre-existing 17+136 failures on main are out of scope and untouched. Co-Authored-By: Claude Opus 5 (1M context) lastCommitSHA: c3d36bd05de8e74003f768c1cd5516730425e71e message: 'Tasks Completed: 1 (Failed: 0, Cancelled 0), Skipped: 0' pipeline: greencapitaltrade/bifrost/main releaseNotesURL: https://github.com/greencapitaltrade/bifrost/releases/tag/v6.84.4 startedTimestamp: "2026-07-29T11:33:43Z" status: Succeeded steps: - kind: Stage stage: completedTimestamp: "2026-07-29T11:53:31Z" name: from build pack startedTimestamp: "2026-07-29T11:47:37Z" status: Succeeded steps: - completedTimestamp: "2026-07-29T11:47:59Z" name: Git Clone startedTimestamp: "2026-07-29T11:47:37Z" status: Succeeded - completedTimestamp: "2026-07-29T11:48:04Z" name: Next Version startedTimestamp: "2026-07-29T11:48:00Z" status: Succeeded - completedTimestamp: "2026-07-29T11:48:08Z" name: Jx Variables startedTimestamp: "2026-07-29T11:48:05Z" status: Succeeded - completedTimestamp: "2026-07-29T11:48:09Z" name: Setup Npm Nexus startedTimestamp: "2026-07-29T11:48:09Z" status: Succeeded - completedTimestamp: "2026-07-29T11:48:13Z" name: Setup Pip Cache startedTimestamp: "2026-07-29T11:48:10Z" status: Succeeded - completedTimestamp: "2026-07-29T11:48:14Z" name: Process Config Templates startedTimestamp: "2026-07-29T11:48:13Z" status: Succeeded - completedTimestamp: "2026-07-29T11:48:15Z" name: Update Asset Management Version startedTimestamp: "2026-07-29T11:48:15Z" status: Succeeded - completedTimestamp: "2026-07-29T11:48:17Z" name: Check Registry startedTimestamp: "2026-07-29T11:48:15Z" status: Succeeded - completedTimestamp: "2026-07-29T11:51:30Z" name: Build Container Build startedTimestamp: "2026-07-29T11:48:17Z" status: Succeeded - completedTimestamp: "2026-07-29T11:51:40Z" name: Promote Changelog startedTimestamp: "2026-07-29T11:51:30Z" status: Succeeded - completedTimestamp: "2026-07-29T11:51:44Z" name: Promote Helm Release startedTimestamp: "2026-07-29T11:51:40Z" status: Succeeded - completedTimestamp: "2026-07-29T11:52:53Z" name: Promote Jx Promote startedTimestamp: "2026-07-29T11:51:44Z" status: Succeeded - completedTimestamp: "2026-07-29T11:53:31Z" name: Publish Org Kb startedTimestamp: "2026-07-29T11:52:53Z" status: Succeeded - kind: Promote promote: environment: staging pullRequest: pullRequestURL: https://github.com/greencapitaltrade/mcu/pull/4986 startedTimestamp: "2026-07-29T11:52:25Z" status: Succeeded startedTimestamp: "2026-07-29T11:52:25Z" status: Succeeded - kind: Promote promote: environment: production pullRequest: pullRequestURL: https://github.com/greencapitaltrade/mcu/pull/4987 startedTimestamp: "2026-07-29T11:52:50Z" status: Succeeded startedTimestamp: "2026-07-29T11:52:50Z" status: Succeeded version: 6.84.4 status: {}