Skip to content

feat(opgaver): rename gRPC surface from microting.opgaver.Opgaver to backend_configuration.Events#802

Merged
renemadsen merged 3 commits into
stablefrom
feat/opgaver-to-events-rename
May 11, 2026
Merged

feat(opgaver): rename gRPC surface from microting.opgaver.Opgaver to backend_configuration.Events#802
renemadsen merged 3 commits into
stablefrom
feat/opgaver-to-events-rename

Conversation

@renemadsen
Copy link
Copy Markdown
Member

Summary

Plugin side of the opgave→event Danish→English migration per docs/superpowers/specs/2026-05-11-opgave-to-event-migration.md.

Renamed wire surface:

  • Proto file: opgaver.protoevents.proto
  • Package: microting.opgaverbackend_configuration
  • Service: OpgaverEvents
  • csharp_namespace: BackendConfiguration.Pn.Grpc.Opgaver…Grpc.Events
  • Messages: OpgaveEvent, OpgaveChangeEventChange, CompleteOpgaveRequest/ResponseCompleteEventRequest/Response
  • RPC methods: ListOpgaverListEvents, StreamOpgaveChangesStreamEventChanges, CompleteOpgaveCompleteEvent

C# handler:

  • File: OpgaverGrpcService.csEventsGrpcService.cs (via git mv)
  • Class: OpgaverGrpcServiceEventsGrpcService
  • Base: Opgaver.OpgaverBaseEvents.EventsBase
  • MapGrpcService<EventsGrpcService>() at EformBackendConfigurationPlugin.cs:790
  • csproj <Protobuf Include="…events.proto"/> updated
  • 2 stale comment refs updated

Smallest-viable-diff carve-out

Intentionally stays Danish in this PR — tracked for follow-up phases:

  • Proto field names (opgave_id, tavle_id, ejendom_id, opgaver, rode-prefixed) — keeps generated C# accessors stable, no handler property cascade.
  • Ejendom, Tavle messages.
  • Helper method names (LoadOpgaverAsync, BuildIdempotentCompleteOpgaveResponse, SynthesiseMinimalOpgave, ParseOpgaveId).
  • Private JSON envelope classes (OpgaverCustomEnvelope, OpgaverCommentBody, OpgaverPhotoBody).
  • Private C# locals.
  • RPCs unrelated to opgave noun (UploadPhoto, RemovePhoto, SetComment, SetFieldValue, ListTaskTracker, ListEjendomme, ListTavler).

Mixed-language proto flagged with a top-of-file comment for future readers.

Lockstep

Merge order: this PR (toward `stable`) FIRST, then deploy the new backend image, then merge the flutter-eform consumer PR (forthcoming) which regenerates Dart stubs against the renamed proto. The Helm chart already routes BOTH /microting.opgaver.Opgaver/* (legacy) and /backend_configuration.Events/* (new) to the same backend service.

Verification

  • Pre-commit dual-subagent gate clean. Code-reviewer caught 6 Eventr* typos from the original mechanical rename (overshot into the carved-out JSON envelope classes) → restored to Opgaver* in commit 66e9721e. Code-simplifier trimmed the top-of-file migration comment in events.proto.
  • dotnet clean && dotnet build against the embedded copy: 0 errors, only pre-existing CS8632/NU1510 warnings.

Known follow-ups (not in this PR)

  • Proto field rename phase (still Danish wire fields).
  • Helper method + private envelope class English rename.
  • Ejendom→Property, Tavle→Board, rode→Overdue migrations (own PRs).

🤖 Generated with Claude Code

renemadsen and others added 3 commits May 11, 2026 10:38
…backend_configuration.Events

Plugin side of the Danish->English migration per
docs/superpowers/specs/2026-05-11-opgave-to-event-migration.md.
Renames proto package, service, the opgave-noun messages
(Opgave->Event, OpgaveChange->EventChange, CompleteOpgave*->CompleteEvent*),
and the corresponding C# handler class + registration. The proto file
itself moves opgaver.proto->events.proto.

Intentionally mixed-language: Ejendom, Tavle, rode fields stay Danish
this PR -- they're tracked in follow-up phases. Private locals inside
the handler are also out of scope per the plan's smallest-viable diff
ceiling. Helm chart already routes /backend_configuration.Events/ as
h2c so the mobile client cutover is lockstep but the wire path is
already wired through Traefik on the cluster.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The prior mechanical Opgaver->Event rename overshot and produced 6
references to non-existent Eventr* types. The private JSON envelope
classes (OpgaverCustomEnvelope, OpgaverCommentBody, OpgaverPhotoBody)
are explicitly carved out of the smallest-viable-diff per the migration
plan - they stay Danish. Restore the references.
Simplifier pass: trimmed redundant header + collapsed paragraph
structure from 16 to 11 lines. Same load-bearing info: spec link,
exact noun scope (opgave only), Ejendom/Tavle/rode deferral, field-
name preservation rationale, smallest-viable-diff framing.
Copilot AI review requested due to automatic review settings May 11, 2026 08:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Backend Configuration plugin’s gRPC contract and server implementation to support the ongoing Danish “opgave” → English “event” migration by renaming the public wire surface (proto package/service/RPCs and generated C# namespace) and aligning the ASP.NET Core gRPC endpoint mapping accordingly.

Changes:

  • Renamed the gRPC proto surface to backend_configuration.Events (new events.proto, new C# generated namespace).
  • Renamed the server implementation to EventsGrpcService and updated endpoint registration to map the new service.
  • Updated a few related inline references/comments in calendar/task models to point at EventsGrpcService.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/GrpcServices/EventsGrpcService.cs Renames the gRPC service implementation and swaps generated types from Opgave* to Event* where applicable.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/BackendConfigurationCalendarService/BackendConfigurationCalendarService.cs Updates a comment reference from OpgaverGrpcService to EventsGrpcService.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Protos/events.proto Introduces the renamed proto surface (backend_configuration package, Events service, Event* messages/RPCs).
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Infrastructure/Models/Calendar/CalendarTaskRequestModel.cs Updates documentation to reference EventsGrpcService as the actionable-only consumer.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/EformBackendConfigurationPlugin.cs Updates endpoint registration to map EventsGrpcService.
eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/BackendConfiguration.Pn.csproj Switches the protobuf include from opgaver.proto to events.proto.
Comments suppressed due to low confidence (3)

eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/GrpcServices/EventsGrpcService.cs:853

  • Inside StreamEventChanges, there are still log-message prefixes referring to the old service/method name (e.g., "OpgaverGrpcService.StreamOpgaveChanges ..."). This makes production logs hard to grep and can mislead during incident triage; update those strings to "EventsGrpcService.StreamEventChanges" (or a consistent new prefix) to match the renamed gRPC surface.
    eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/GrpcServices/EventsGrpcService.cs:1603
  • This comment still describes synthesizing a minimal "completed" Opgave, but the code now synthesizes an Event instance. Please update the wording (e.g., Event/task) to keep the inline documentation consistent with the renamed API surface.
    eFormAPI/Plugins/BackendConfiguration.Pn/BackendConfiguration.Pn/Services/GrpcServices/EventsGrpcService.cs:186
  • The new/renamed Events gRPC surface (ListEvents/StreamEventChanges/CompleteEvent) currently has no unit tests, while other gRPC services in this repo do (e.g., CalendarGrpcServiceTests, PropertiesGrpcServiceTests). Adding a few focused tests (permission denied, service-failure mapping, and basic response shape) would help prevent regressions during the ongoing opgave→event migration.

@renemadsen renemadsen merged commit 8703e4b into stable May 11, 2026
21 checks passed
renemadsen added a commit that referenced this pull request May 11, 2026
Previously the test tampered the LAST base64url char of the JWT
signature. For a 32-byte HMAC-SHA256 → 43 base64url chars (no
padding), the last char encodes only 4 significant bits of byte 31;
the other 2 bits are padding bits the encoder always emits as 00.
.NET's Convert.FromBase64String silently ignores those padding
bits — so flipping the last char between 'A' (000000) and 'B'
(000001) is a no-op for the decoded signature byte whenever byte
31's low-4-bits == 0. That happens ~1/16 of the time (uniform
random HMAC output). Empirically: 6.33% undetected over 10000
trials.

CI manifested the bug on
https://github.com/microting/eform-backendconfiguration-plugin/actions/runs/25660940289
(stable HEAD after PR #802) — not a regression introduced by that
rename, just a long-standing 6% flake that finally rolled
snake-eyes.

Fix: tamper a char in the MIDDLE of the signature segment instead.
Middle chars use all 6 bits as data, so any flip is guaranteed to
mutate the decoded signature. Empirically 0/10000 false-passes.

Production verifier in GoogleDriveAuthService.VerifyEnvelopeJwt is
correct as-is (FixedTimeEquals on the decoded byte arrays); only
the test's tamper logic was unsound.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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