Skip to content

feat(polar): ✨ adding Polar Flow #52#134

Merged
dvorka merged 9 commits into
dev/1.60.0from
feat-52/polar-flow
Jul 23, 2026
Merged

feat(polar): ✨ adding Polar Flow #52#134
dvorka merged 9 commits into
dev/1.60.0from
feat-52/polar-flow

Conversation

@dvorka

@dvorka dvorka commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

Tasks:

  • Polar Flow manual testing for RV
  • ZIP manual testing for RV
  • Polar Flow manual testing for MD (device is needed)
  • ZIP manual testing for MD (no data imported)

This PR brings Polar Flow integration:

  • API sync of last month data.
  • ZIP export.

Related:

@dvorka dvorka self-assigned this Jul 5, 2026
Copilot AI review requested due to automatic review settings July 5, 2026 20:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Polar Flow integration to MyTraL, covering both incremental sync of newly recorded exercises via Polar AccessLink (transaction model) and historical backfill via the Polar GDPR export ZIP, integrated into the UI, background tasks, and import plugin architecture.

Changes:

  • Added Polar Flow AccessLink API client + OAuth flow, plus tasks to sync new activities and purge/re-sync.
  • Added Polar GDPR export ZIP parser + import task, wired into Tools > Import UI.
  • Added activity-type mapping for Polar sports, feature-flag gating, and a test suite covering credentials, rate limiting, transaction semantics, import mapping, and dedup.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_tool_polar_flow.py New tests for Polar Flow client/task utilities (credentials, rate-limit backoff, transaction behavior, dedup).
tests/test_plugin_import_polar_flow.py New tests validating plugin mappings for API summaries and GDPR export sessions.
mytral/templates/tools-import.html Adds Polar Flow as an import source plus GDPR export ZIP upload UI (feature-flagged).
mytral/templates/polar-flow-secrets.html New page for configuring Polar Flow client credentials.
mytral/templates/polar-flow-developer.html New developer dashboard for Polar Flow auth status and sync actions.
mytral/templates/layout.html Adds a Polar Flow navbar shortcut icon when feature-flagged and configured.
mytral/tasks/do/polar_flow_sync.py New background task to sync newly available Polar exercises via transactions.
mytral/tasks/do/polar_flow_resync_all.py New background task to purge all Polar-sourced activities and re-pull from AccessLink.
mytral/tasks/do/polar_flow_export_import.py New background task to import historical data from a GDPR export ZIP.
mytral/tasks/do/polar_flow_commons.py Shared sync/pull utilities including recording import and cross-channel dedup.
mytral/settings.py Extends UserProfile persistence model to store Polar Flow credentials/linking fields.
mytral/run.py Registers the new Polar Flow URI space blueprint in the server entrypoint.
mytral/run_desktop.py Registers the new Polar Flow URI space blueprint in the desktop entrypoint.
mytral/releng.py Adds POLAR_FLOW_IMPORT feature flag (default off).
mytral/integrations/polar_flow.py New Polar AccessLink client + OAuth helpers + import plugins for API summaries.
mytral/integrations/polar_flow_export.py New GDPR export ZIP/directory parser that normalizes sessions to AccessLink-like summaries.
mytral/integrations/icommons.py Adds Polar sport-to-activity-type mapping helper.
mytral/forms.py Adds forms for Polar secrets configuration and GDPR export ZIP upload + conflict strategy.
mytral/blueprints/polar_flow_uri_space.py New Polar Flow routes for secrets, auth, sync, resync, and export import task submission.
mytral/blueprints/import_uri_space.py Wires the new Polar export form into the import page rendering context.
docs/ARCHITECTURE.md Updates architecture docs to include Polar Flow as an external integration.
CREDITS.md Adds attribution for Polar AccessLink example repo used as a reference.
CHANGELOG.md Adds release notes describing the new Polar Flow integration and feature flag.

Comment thread mytral/blueprints/polar_flow_uri_space.py
Comment thread mytral/integrations/polar_flow.py
Comment thread mytral/templates/polar-flow-secrets.html
Comment thread docs/ARCHITECTURE.md
Comment thread CHANGELOG.md Outdated
@dvorka
dvorka changed the base branch from dev/1.58.0 to dev/1.59.0 July 8, 2026 12:19
@dvorka
dvorka requested a review from Copilot July 17, 2026 15:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dvorka
dvorka requested a review from Copilot July 18, 2026 17:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dvorka
dvorka requested a review from Copilot July 19, 2026 05:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@dvorka
dvorka changed the base branch from dev/1.59.0 to dev/1.60.0 July 20, 2026 07:12
@dvorka
dvorka merged commit 16073b8 into dev/1.60.0 Jul 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants