Skip to content

Electrical report: contract list, @ReadyWhen pattern, snapshot workflow - #96

Merged
tblank1024 merged 1 commit into
mainfrom
electrical-report
Nov 10, 2026
Merged

tblank1024 merged 1 commit into
mainfrom
electrical-report

Conversation

@tblank1024

@tblank1024 tblank1024 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Adds the electrical contract report and its web-tool workflow to the template, so the 2027 repo starts with them.

The library side is SeriouslyCommonLib #692, released as 20261109.020802. main already uses that version, so this PR doesn't change the version.

Changes

  • ElectricalContract implements XElectricalReportContract. isReady(String) and getHardwareNames() map to the Hardware enum. The class comment shows the pattern: tag each getter with @ReadyWhen("Shooter") and so on.
  • getAdditionalPDHConnections() and getAdditionalPowerBranches() moved from ElectricalContract into the library interface. Contract2026 overrides them as before.
  • Contract2026 uses the library's CanBusOrderEntry, so its nested record is removed.
  • electrical/report/Main.java holds the robot list for the existing ./gradlew electricalReport task, mirroring the Robot switch. --args="--all -d out" writes every robot.
  • .github/workflows/electrical-snapshots.yml runs on merges to main that touch the contracts or the exporter, or when run by hand. It publishes JSON to the electrical-snapshots branch, where the web tool reads it. It needs no secrets.
  • A README section, next to the new Development setup section.

Rebased on main after #95 (fluent builders), #97, #98 and #99 (Spotless). There's one commit, formatted with spotlessApply.

Verified locally with JDK 25, against SeriouslyCommonLib 20261109.020802 from GitHub releases:

  • ./gradlew build passes, including tests, checkstyle and spotlessCheck.

  • electricalReport --args="--all -d out" writes 4 robots plus index.json:

    Robot CAN devices Notes
    Competition 14 Swerve, Pigeon and CANdle; all in the CAN order, no warnings
    2023 12
    Robox 14
    2025 0 That contract turns off all hardware

    The earlier description said Competition had 39 CAN devices. That was wrong: the template's Contract2026 only defines these 14.

🤖 Generated with Claude Code

https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp

- ElectricalContract implements XElectricalReportContract (from
  SeriouslyCommonLib); Hardware names back @ReadyWhen.
- Contract2026 uses the library's CanBusOrderEntry.
- electrical/report/Main.java lists the robots for ./gradlew electricalReport.
- GitHub Action publishes JSON snapshots to the electrical-snapshots branch
  on merges to main, for the electrical contract web tool.

Needs a SeriouslyCommonLib release containing XElectricalReportContract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WRhH1b6vqCkLNMXaAbvnp
@tblank1024
tblank1024 marked this pull request as ready for review November 10, 2026 00:50
@tblank1024
tblank1024 requested a review from a team as a code owner November 10, 2026 00:50
@tblank1024
tblank1024 merged commit 7602779 into main Nov 10, 2026
1 check passed
@tblank1024
tblank1024 deleted the electrical-report branch November 10, 2026 04:26
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