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

FlexMeasures / flexmeasures / 24340361528
81%

Build:
DEFAULT BRANCH: main
Ran 13 Apr 2026 11:26AM UTC
Jobs 1
Files 163
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

13 Apr 2026 11:13AM UTC coverage: 79.333% (+0.06%) from 79.277%
24340361528

push

github

web-flow
Support coupling data sources to accounts, and preserve user ID and account ID references in audit logs and data sources (#2058)

* Initial plan

* data_sources: add account_id field to DataSource model

- Add account_id column (FK to account.id, nullable) to DataSource
- Add account relationship (backref 'data_sources' on Account)
- Update __table_args__ UniqueConstraint to include account_id
- Set self.account from user.account in __init__ when user is provided

* migration: add account_id to data_source table (9877450113f6)

- Add account_id column (nullable, FK to account.id)
- Data migration: populate account_id from user's account where user_id IS NOT NULL
- Update UniqueConstraint to include account_id column
- down_revision: 8b62f8129f34

* migration: replace N+1 loop with single UPDATE...FROM for account_id backfill

* tests/sensor_data: verify account_id is set on data source when posting sensor data

Context:
- DataSource.__init__ now sets self.account = user.account when a user is provided
- The POST sensor data endpoint calls get_or_create_source(current_user)
- Need to verify account_id is populated correctly on the resulting data source

Change:
- Added test_post_sensor_data_sets_account_id_on_data_source
- Posts sensor data as test_supplier_user_4@seita.nl
- Asserts data_source.account_id == user.account_id

* migration: use correlated subquery for account_id data migration; add changelog entry

Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Agent-Logs-Url: https://github.com/FlexMeasures/flexmeasures/sessions/7969297e-88c2-4ace-99c9-ec74109f03c8

* data_sources: fix account_id assignment to avoid SAWarning and handle unflushed users

Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Agent-Logs-Url: https://github.com/FlexMeasures/flexmeasures/sessions/7969297e-88c2-4ace-99c9-ec74109f03c8

* agents/architecture: add migration checklist and DataSource account_id invariants

Context:
- PR #2058 added ac... (continued)

18 of 19 new or added lines in 4 files covered. (94.74%)

12019 of 15150 relevant lines covered (79.33%)

0.79 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
77.27
-0.85% flexmeasures/data/services/data_sources.py
Jobs
ID Job ID Ran Files Coverage
1 24340361528.1 13 Apr 2026 11:26AM UTC 163
79.33
GitHub Action Run
Source Files on build 24340361528
  • Tree
  • List 163
  • Changed 6
  • Source Changed 5
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #24340361528
  • 8934f229 on github
  • Prev Build on main (#24336803701)
  • Next Build on main (#24358456370)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc