Skip to content

fix(build): pin the screenshot render JVM to UTC - #7803

Merged
jamesarich merged 2 commits into
mainfrom
fix/screenshot-timezone-pin
Oct 28, 2026
Merged

jamesarich merged 2 commits into
mainfrom
fix/screenshot-timezone-pin

Conversation

@jamesarich

@jamesarich jamesarich commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

CST pins the render JVM's locale but not its timezone, so a preview that formats an absolute date records a different day on a host east of UTC than CI renders. The sample node's lastHeard is 2023-11-14 22:13 UTC, and #7802's goldens read November 15 - one glyph, 0.0009 of the image, over the 0.0005 threshold.

🐛 Bug Fixes

  • AndroidScreenshotConventionPlugin sets user.timezone=UTC on every screenshot Test task, so update and validate render the same day on every host.

🧹 Chores

  • .skills/testing-ci notes the pin.

Testing Performed

TZ=Asia/Tokyo ./gradlew :screenshot-tests:validateDebugScreenshotTest --rerun --no-build-cache -Dorg.gradle.isolated-projects=false on main fails the 14 NodeItem goldens that show the date; on this branch all 359 pass.

Summary by CodeRabbit

  • Bug Fixes
    • Screenshot test tasks now run with the JVM timezone set to UTC. This applies to tasks whose names include “ScreenshotTest,” regardless of capitalization. CST continues to set only the locale, with no timezone change. The existing test-retry opt-out remains in place. These settings provide consistent timezone behavior for screenshot tests while preserving CST’s locale configuration.

CST pins the render JVM's locale but not its timezone, so a preview that
formats an absolute date records a different day on a host east of UTC
than CI renders, and the one glyph is enough to fail validate.
@github-actions github-actions Bot added bugfix PR tag build Build system changes labels Oct 28, 2026
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 51d4b87 and ff8cd45.

Files selected for processing: 1
  • build-logic/convention/src/main/kotlin/AndroidScreenshotConventionPlugin.kt
Files skipped from review as they are similar to previous changes: 1
  • build-logic/convention/src/main/kotlin/AndroidScreenshotConventionPlugin.kt

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

Walkthrough

The convention plugin sets the render JVM timezone to UTC for Test tasks whose names contain ScreenshotTest, ignoring case. The testing guidance documents this setting and notes that CST pins only the locale.

Changes: Screenshot test timezone

Layer / File(s) Summary
UTC timezone configuration
build-logic/convention/src/main/kotlin/AndroidScreenshotConventionPlugin.kt, .skills/testing-ci/SKILL.md
The plugin sets user.timezone to UTC for matching screenshot-test tasks. The existing test-retry opt-out remains. The documentation describes the UTC pin and states that CST pins only the locale.

Priority: Normal

Merge Risk: Minimal · up to ff8cd

No actionable merge risk is identified; the timezone pin can proceed with normal checks.

Pre-merge checks: Passed 7 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Regression Coverage For Changed Behavior Warning Missing regression coverage for the changed AndroidScreenshotConventionPlugin path. In tasks.withType<Test>().configureEach, matching ScreenshotTest task names now receive `systemProperty("user.… Add a Gradle TestKit or equivalent convention-plugin functional test. Apply meshtastic.android.screenshot in a fixture with the required Compose Screenshot plugin, create matching and non-matching Test tasks, and run the matching task w…
Passed Passed checks: 7 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: pinning the screenshot render JVM timezone to UTC.
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.
Sibling Call Sites And Presence Semantics Passed The pull request changes only screenshot JVM timezone configuration and related documentation. The diff does not change NodeItem, NodeItemCompact, metric nullability, zero guards, presence checks, or …
Tests Prove The Path, Not The End State Passed PASS. The pull request changes only .skills/testing-ci/SKILL.md and AndroidScreenshotConventionPlugin.kt. It adds no tests and changes no test assertions, so the check's failure conditions do not …
Moved Code Diffed Against Its Original Passed The PR does not move or extract a type or function. The diff modifies the existing AndroidScreenshotConventionPlugin KDoc and adds systemProperty("user.timezone", "UTC") inside the existing screen…
Full details: Sibling Call Sites And Presence Semantics

Explanation

The pull request changes only screenshot JVM timezone configuration and related documentation. The diff does not change NodeItem, NodeItemCompact, metric nullability, zero guards, presence checks, or physical-value defaults. Therefore, the sibling-call-site and zero-default checks do not apply.

Full details: Tests Prove The Path, Not The End State

Explanation

PASS. The pull request changes only .skills/testing-ci/SKILL.md and AndroidScreenshotConventionPlugin.kt. It adds no tests and changes no test assertions, so the check's failure conditions do not apply.

Full details: Moved Code Diffed Against Its Original

Explanation

The PR does not move or extract a type or function. The diff modifies the existing AndroidScreenshotConventionPlugin KDoc and adds systemProperty("user.timezone", "UTC") inside the existing screenshot Test task configuration. It also updates documentation. No declaration is deleted, no replacement location is added, and no moved-code call-site comparison is required.

Full details: Regression Coverage For Changed Behavior

Explanation

Missing regression coverage for the changed AndroidScreenshotConventionPlugin path. In tasks.withType&lt;Test&gt;().configureEach, matching ScreenshotTest task names now receive systemProperty("user.timezone", "UTC") (plugin lines 51–60). This affects the JVM timezone used by screenshot rendering and can change absolute-date output across host timezones. The diff changes only the plugin and documentation; it adds no functional test. The reported TZ=Asia/Tokyo run is manual evidence, and the existing golden comparison does not directly verify task configuration or run under a non-UTC timezone. A matching task could lose the property without a codified test, and the non-matching-task boundary is also untested.

Resolution

Add a Gradle TestKit or equivalent convention-plugin functional test. Apply meshtastic.android.screenshot in a fixture with the required Compose Screenshot plugin, create matching and non-matching Test tasks, and run the matching task with a non-UTC host timezone. Assert inside the test process that TimeZone.getDefault().id is UTC or assert the task system property is UTC. Assert that the unrelated Test task is unchanged. The matching assertion must fail when the new systemProperty("user.timezone", "UTC") line is removed.

  • Autofix · 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.

@github-actions

This comment has been minimized.

@jamesarich
jamesarich added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 2f3fd43 Oct 28, 2026
17 checks passed
@jamesarich
jamesarich deleted the fix/screenshot-timezone-pin branch October 28, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag build Build system changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant