Skip to content

refactor!: drop ID mapping file in v2.0.0 - #166

Merged
KinjiKawaguchi merged 2 commits into
mainfrom
refactor/111-drop-id-mapping
Sep 21, 2026
Merged

KinjiKawaguchi merged 2 commits into
mainfrom
refactor/111-drop-id-mapping

Conversation

@KinjiKawaguchi

Copy link
Copy Markdown
Member

Summary

  • Removes the deprecated google_calendar_mappings.json file and IdMapper struct
  • Removes GOOGLE_CALENDAR_MAPPINGS_FILE environment variable from AppConfig and configuration
  • Simplifies find_by_id and delete operations to directly use derived event IDs
  • Updates documentation with v2.0.0 migration guidance

Why

Since #109, all event IDs are deterministically derivable from reservation IDs (UUID hex representation). The mapping file was only needed for old reservations created before this change, which are now extremely rare. This removes unnecessary complexity while maintaining backward compatibility for the few remaining cases.

Test plan

  • Code compiles cleanly: cargo clippy --all-targets -- -D warnings
  • All tests pass: cargo test
  • Doctests updated and passing
  • Configuration loading tested with modified loader
  • Repository operations (find, delete) tested in both mapped and unmapped paths

Migration notes

This is a BREAKING CHANGE for v2.0.0:

  • Operators must remove GOOGLE_CALENDAR_MAPPINGS_FILE from /etc/default/lab-resource-manager
  • The google_calendar_mappings.json file can be safely deleted
  • All active reservations must be from v1.9.0 or later (described in MIGRATION.md)

🤖 Generated with Claude Code

Since #109, all event IDs are derivable from reservation IDs, making the
google_calendar_mappings.json file obsolete. Reservations from before this
change that still require mapping are now extremely rare in production,
and those created after #109 need no mapping at all.

This removes:
- id_mapper.rs module and IdMapper struct
- GOOGLE_CALENDAR_MAPPINGS_FILE environment variable
- calendar_mappings_file from AppConfig
- CALENDAR_MAPPINGS_FILE default configuration
- All mapping lookups from repository operations

The simplification reduces complexity: find_by_id and delete now directly
use event IDs derived from reservation IDs, with fallback to scan all
calendars only when needed.

For reservations still carrying old mappings, the caveat from #111 applies:
they will update to use their event ID upon next modification, as event
descriptions are regenerated at that time.

Addresses #111 for v2.0.0 release.

BREAKING CHANGE: Removed GOOGLE_CALENDAR_MAPPINGS_FILE environment variable
and google_calendar_mappings.json file. All reservations active at deployment
time must have been created with v1.9.0 or later.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 21, 2026 10:15
@KinjiKawaguchi KinjiKawaguchi added this to the v2.0.0 milestone Sep 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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.

The note claimed the derivation boundary was v1.9.0, a version that never
existed — event ids derive from reservation ids since v1.5.1 — and framed
leftover pre-boundary reservations as breaking when they are renumbered
and settle on update, as #111 records. Also drop the env var from the
install script's summary, remove the dead resource-context helper instead
of keeping it behind allow(dead_code), and give the fenced block the
blank line markdownlint requires.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings September 21, 2026 10:20

Copilot AI left a comment

Copy link
Copy Markdown

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.

@KinjiKawaguchi
KinjiKawaguchi merged commit 88570ee into main Sep 21, 2026
10 checks passed
@KinjiKawaguchi
KinjiKawaguchi deleted the refactor/111-drop-id-mapping branch September 21, 2026 10:24
KinjiKawaguchi pushed a commit that referenced this pull request Sep 21, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.0.0](v1.8.0...v2.0.0)
(2026-09-21)


### ⚠ BREAKING CHANGES

* google_calendar_mappings.json is no longer read and the
GOOGLE_CALENDAR_MAPPINGS_FILE environment variable is gone (both are
ignored if left in place; reservation ids copied from pre-v1.5.1 event
descriptions stop resolving). In the library API,
GoogleCalendarUsageRepository::new no longer takes the mappings path.
* existing resources.toml files stop loading until calendar_id entries
are moved into the [storage] section (see the migration guide). In the
library API, load_config returns a (ResourceConfig, StorageConfig) pair,
ServerConfig and RoomConfig lose their calendar_id field, and
GoogleCalendarUsageRepository::new takes the StorageConfig.
* TemplateConfig gains a conflict_item field, so struct-literal
construction outside this crate needs updating.
* DetectIdleReservationsUseCase loses its IdentityLinkRepository type
parameter and constructor argument; judge_reservation_activity drops its
owner_identities parameter; GpuUsageReport gains a required unattributed
field; NotificationError gains a RecipientUnknown variant; public error
enums are non_exhaustive, so external matches need a wildcard arm.

### Features

* improve how multiple reservation conflicts are presented
([#164](#164))
([bbfb86b](bbfb86b))
* judge idle reservations by the reserved device, not process identity
([#161](#161))
([6141e74](6141e74))


### Code Refactoring

* drop the id-mapping file for calendar events
([#166](#166))
([88570ee](88570ee))
* separate the storage mapping from resource definitions
([#165](#165))
([cbc3fdc](cbc3fdc))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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