Skip to content

feat(workout): support skipping final repeat rest - #452

Open
MartinDejmal wants to merge 1 commit into
cyberjunky:masterfrom
MartinDejmal:add-skip-last-rest-step
Open

MartinDejmal wants to merge 1 commit into
cyberjunky:masterfrom
MartinDejmal:add-skip-last-rest-step

Conversation

@MartinDejmal

@MartinDejmal MartinDejmal commented Oct 5, 2026 •

Copy link
Copy Markdown

Adds skip_last_rest_step to create_repeat_group and serializes it as Garmin’s skipLastRestStep field.

The field remains absent by default, preserving existing workout payloads. Includes a serialization test for the enabled flag.

Summary by CodeRabbit

  • New Features
    • Repeat workout groups can now be configured to skip the final rest step.

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: cyberjunky/python-garminconnect/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9ccf7a0c-ea35-4151-92ad-9ce2ff7a949a
📥 Commits

Reviewing files that changed from the base of the PR and between 218e72c and afbfb94.

📒 Files selected for processing (2)
  • garminconnect/workout.py
  • tests/test_workout_targets.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The repeat-group model and factory now support an optional setting to skip the final recovery or rest step. A test verifies that True is serialized as skipLastRestStep: true.

Changes

Repeat group option

Layer / File(s) Summary
Add and verify the skip-rest setting
garminconnect/workout.py, tests/test_workout_targets.py
RepeatGroup adds nullable skipLastRestStep. create_repeat_group accepts and forwards skip_last_rest_step. A test checks that True is serialized.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Feature

Suggested reviewers: cyberjunky

Merge Risk: ⚪ Minimal · up to afbfb

Existing callers continue to omit the new field by default, and callers opting in serialize the enabled setting. No concrete merge-blocking issue is established.

Security Architecture Review

Security architecture risk: ⚪ Minimal · up to afbfb

The change adds an opt-in workout setting while preserving existing payloads by default. It uses the existing upload path without expanding access or privileges. No material security risk was identified; remote execution of the setting was not verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed input affects the repeat-group instruction within a caller-supplied workout using the existing upload route. No new independently reachable endpoint, credential authority, or cross-account access mechanism is introduced by this diff.

Trust Boundaries and Controls

  • observed — Typed upload consumers retain their workout-type checks and existing serialization path. The generic upload method already accepts caller-supplied JSON and is unchanged, providing counterevidence against a newly expanded payload authority or control bypass.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: support for skipping the final rest step in a repeat group.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mukhtadir-syed

Copy link
Copy Markdown

Tested the same field live on a strength workout, in case it helps review.

I'm on 0.3.17, so I didn't run this branch. I set skipLastRestStep = True by hand on the RepeatGroup returned by create_repeat_group (the model allows extra fields), which serializes to the same key this PR adds.

What I did (11 Oct 2026, fenix 9 Pro):

  • upload_strength_workout with one repeat group: 2 rounds of two exercise steps, with a 20 s rest as the last step in the group, and skipLastRestStep: true on the group.
  • get_workout_by_id readback: skipLastRestStep: true was still on the group.
  • schedule_workout and push_workout_to_device both succeeded, and the workout showed up on the watch.

Not verified: whether the watch actually skips that final rest during the workout. I only checked that Garmin accepts, stores and returns the flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants