• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

FlexMeasures / flexmeasures / 36192278468
86%

Build:
DEFAULT BRANCH: main
Ran 25 Sep 2026 09:44PM UTC
Jobs 1
Files 187
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Sep 2026 09:34PM UTC coverage: 86.051% (-0.05%) from 86.102%
36192278468

push

github

web-flow
Feat: when copying assets, copy their automations, too (#2531)

* data/services: copy an asset subtree's automations, left inactive

Context:
- Issue #2528: copying an asset kept its sensor structure but dropped the
  recurring forecasts, schedules and reports that make it operational.

Change:
- Added `copy_automations`, which copies every automation on a copied asset onto
  the corresponding new asset, keeping its name, type, cron expression and
  timezone, but starting it inactive and with a fresh cursor, so it inherits
  neither the original's run history nor its queued jobs.
- References to sensors, assets, organisations and data sources are remapped by
  walking the marshmallow schema that describes the data generator's
  configuration and parameters, so the same code serves automation types and
  plugin generators beyond forecasts.
- A reference outside the copied subtree is kept only where the destination
  organisation may read it; otherwise the automation is skipped, as it is when
  its data generator is unavailable or the remapped configuration no longer
  validates.
- Each automation is copied inside its own savepoint, so a skipped one leaves
  behind neither a partial automation nor a stray generator data source, and the
  asset copy itself goes ahead regardless.

Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>

* api/v3_0: copy an asset's automations and report the ones left out

Context:
- Issue #2528: the copy endpoint duplicated assets and sensors only, so a copied
  site arrived without the automations that made it run.

Change:
- `copy_asset` now tracks the new asset IDs alongside the new sensor IDs, hands
  both to `copy_automations`, and returns an `AssetCopy` naming the copied asset
  and the automations that were skipped.
- `POST /assets/<id>/copy` reports those under a new `skipped_automations` field,
  each with its id, name, asset and reason, and says so in the message; the audit
  log record on the copy ... (continued)

204 of 252 new or added lines in 3 files covered. (80.95%)

20302 of 23593 relevant lines covered (86.05%)

0.86 hits per line

Uncovered Changes

Lines Coverage ∆ File
48
78.85
flexmeasures/data/services/automation_copies.py
Jobs
ID Job ID Ran Files Coverage
1 36192278468.1 25 Sep 2026 09:44PM UTC 187
86.05
GitHub Action Run
Source Files on build 36192278468
  • Tree
  • List 187
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #36192278468
  • 1e9897dc on github
  • Prev Build on main (#36191867000)
  • Next Build on main (#36196790197)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc