Skip to content

fix(deps): update krm-stream to 0.10.0 - #45

Merged
sunib merged 2 commits into
mainfrom
fix/krm-stream-0.10
Oct 6, 2026
Merged

sunib merged 2 commits into
mainfrom
fix/krm-stream-0.10

Conversation

@sunib

@sunib sunib commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Moves krm-foyer from krm-stream 0.7.0 to 0.10.0: the Go gateway (gateway, gateway/kube) and the browser bundle vendored into the hello example, together. Pages still read through the gateway's SSE stream at /stream/v1 (protocol 1, unchanged); nothing switches to native watches.

Changes

  • Go: gateway.Options takes the shared settings (Authorizer, Clients, Projections, Diagnostics, WriteTimeout) inside StreamConfig. The shared-stream overrides keep working through field promotion. NewSharedBackendWithOptions is now NewSharedBackend.
  • Browser: KRM_STREAM_VERSION/KRM_STREAM_INTEGRITY pin 0.10.0, and the bundle is re-vendored (task vendor-check passes). In examples/hello/web/app.js, the removed connectManagedResourceStream(url, store, {onSynced, onStateChange}) is replaced by connectResourceStream(url, event => applyStreamEvent(store, event)), with subscribe(showConnection) for state and a synced event for the first snapshot. A rejected closed is now reported on the page (since 0.8.0, a throwing callback stops the stream).
  • Docs: the hello README snippet and the pinned version in docs/watches.md.
  • Investigations (separate commit): adopting krm-stream's native watches (step 1 of that plan is this PR), could /k8s share watches transparently, and an update to the native-connector request. Nothing in them is implemented.

The server's behaviour does not change. The existing unit, e2e and browser specs are the check that nothing moved.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • The hello example can now connect to native Kubernetes watches, load an initial resource list, and resume watches from saved checkpoints when possible.
    • The example’s live resource view now prunes resources absent from a completed snapshot and protects managed fields and the last-applied annotation during edits.
  • Documentation
    • Updated the documented gateway version to 0.10.0 and added investigation guides covering native watches, adoption considerations, and potential watch sharing. The guides distinguish current capabilities from proposed work.

sunib and others added 2 commits October 6, 2026 09:51
The Go gateway and the vendored browser bundle move from 0.7.0 to 0.10.0
together, still over the gateway's SSE stream (protocol 1).

- gateway.Options: the shared settings move into StreamConfig;
  NewSharedBackendWithOptions is NewSharedBackend.
- hello example: connectManagedResourceStream is gone; the page feeds the
  store through connectResourceStream and applyStreamEvent, shows state
  through subscribe, and reports a rejected closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 26974672-a814-4050-be6d-3dcdfbbec1ca
📥 Commits

Reviewing files that changed from the base of the PR and between fae70b6 and 620170a.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (11)
  • Taskfile.yml
  • docs/investigations/adopting-krm-stream-native-watches.md
  • docs/investigations/krm-stream-native-connector-request.md
  • docs/investigations/stream-investigate.md
  • docs/watches.md
  • examples/hello/README.md
  • examples/hello/web/app.js
  • examples/hello/web/krm-stream.js
  • go.mod
  • internal/stream/shared.go
  • internal/stream/stream.go

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


📝 Walkthrough

Walkthrough

The change upgrades krm-stream to 0.10.0, updates the browser stream API, and adds a native Kubernetes LIST-then-WATCH connector with checkpoint resumption. It also changes store event handling and adds investigation documents on native-watch adoption and proposed watch sharing.

Changes

Stream integration and native watches

Layer / File(s) Summary
Dependency and gateway integration
go.mod, Taskfile.yml, internal/stream/*, docs/watches.md
The krm-stream dependency and documented bundle version change from 0.7.0 to 0.10.0. Gateway construction and configuration use the updated API without changing configured values.
Callback-based stream lifecycle
examples/hello/web/krm-stream.js, examples/hello/web/app.js, examples/hello/README.md
The SSE connector now delivers events through a callback and shared connection lifecycle handling. The hello example applies events to its store and observes connection state and closure.
Native watch and store updates
examples/hello/web/krm-stream.js
The browser bundle adds a native LIST-then-WATCH connector, checkpoint resumption, and Kubernetes URL builders. Store updates separate stream snapshot membership from save and reconciliation updates. Effective edit regions protect machinery and redacted paths.
Native-watch investigations and adoption documentation
docs/investigations/*
The documents describe native-watch operation and limits, compare native and gateway streams, and outline proposed shared-watch behavior and follow-up work.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant HelloPage
  participant connectNativeWatch
  participant K8sAPI as /k8s
  participant applyStreamEvent
  participant LiveResourceStore
  HelloPage->>connectNativeWatch: Start collection watch with event callback
  connectNativeWatch->>K8sAPI: LIST collection
  K8sAPI-->>connectNativeWatch: Collection and resource version
  connectNativeWatch->>HelloPage: Deliver reset and added events
  HelloPage->>applyStreamEvent: Apply delivered events
  applyStreamEvent->>LiveResourceStore: Update resource state
  connectNativeWatch->>K8sAPI: WATCH from resource version
  K8sAPI-->>connectNativeWatch: Watch events
  connectNativeWatch->>HelloPage: Deliver watch events
Loading

Merge Risk: ⚪ Minimal · up to 62017

This updates the stream library and adjusts the gateway setup and hello example to its new API. Pages still use the existing gateway stream, and no behavior regression was identified. The native-watch material is documentation only, so the change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 4 files. (7 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: updating krm-stream to version 0.10.0.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 21.62% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 37 functions across 4 files. (7 skipped: 7 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • 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.

@sunib
sunib merged commit 3d4b8f0 into main Oct 6, 2026
11 checks passed
@sunib
sunib deleted the fix/krm-stream-0.10 branch October 6, 2026 10:03
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.

1 participant