Skip to content

feat(webdav): surface If-Match source evidence - #294

Merged
seonghobae merged 1 commit into
masterfrom
phase/data-source-sovereignty-20260529
May 28, 2026
Merged

feat(webdav): surface If-Match source evidence#294
seonghobae merged 1 commit into
masterfrom
phase/data-source-sovereignty-20260529

Conversation

@seonghobae

@seonghobae seonghobae commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add source-safe WebDAV etag_value evidence and expose it as etag/if_match without provider URLs, usernames, credentials, or sequential account ids.
  • Carry If-Match evidence through WebDAV writeback and self-sent knowledge materialization intent responses.
  • Update Data UI tests, E2E mocks, README, AGENTS, and plans to keep WebDAV source-sovereignty docs aligned.

Verification

  • python -m pytest tests/test_webdav_api.py tests/test_bootstrap_db.py -q
  • npm test -- src/app/data/page.test.tsx
  • npm run typecheck
  • npm run lint
  • NEXT_TELEMETRY_DISABLED=1 NODE_OPTIONS=--max-old-space-size=4096 NEXT_BUILD_CPUS=2 POSTCSS_WORKERS=1 DISABLE_POSTCSS_WORKERS=true NEXT_STATIC_GENERATION_MAX_CONCURRENCY=1 NEXT_STATIC_GENERATION_MIN_PAGES_PER_WORKER=100 npm run build
  • PLAYWRIGHT_PORT=18142 NEXT_BUILD_CPUS=2 POSTCSS_WORKERS=1 DISABLE_POSTCSS_WORKERS=true npm run test:e2e -- --project=desktop -g "renders data WebDAV writeback intent status|validates mobile hamburger composition"
  • PLAYWRIGHT_PORT=18143 NEXT_BUILD_CPUS=2 POSTCSS_WORKERS=1 DISABLE_POSTCSS_WORKERS=true npm run test:e2e -- --project=desktop -g "renders data quality surface"
  • Screenshot review: Data WebDAV desktop/mobile/mobile-scroll, Data quality tablet/mobile-scroll/mobile-hamburger, mobile workspace menu.

Summary by CodeRabbit

  • New Features

    • Enhanced WebDAV writeback operations with improved concurrency control and conflict handling for safer multi-client scenarios.
  • Documentation

    • Clarified WebDAV writeback governance, security boundaries, and data materialization capabilities.
    • Updated scope documentation detailing source identification, eligibility criteria, and conflict resolution behavior.

Review Change Stack

@seonghobae
seonghobae temporarily deployed to phase/data-source-sovereignty-20260529 - naruon PR #294 May 28, 2026 23:16 — with Render Destroyed
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a0da21b1-a8e0-4f2c-8e4f-45a03dda4a35

📥 Commits

Reviewing files that changed from the base of the PR and between cd78524 and b91018f.

📒 Files selected for processing (13)
  • AGENTS.md
  • README.md
  • backend/api/webdav.py
  • backend/db/models.py
  • backend/scripts/bootstrap_db.py
  • backend/services/webdav_service.py
  • backend/tests/test_bootstrap_db.py
  • backend/tests/test_webdav_api.py
  • docs/plans/2026-05-27-data-webdav-writeback-intent-ui.md
  • docs/plans/2026-05-29-webdav-if-match-source-evidence.md
  • frontend/src/app/data/page.test.tsx
  • frontend/tests/e2e/dashboard-branding.spec.ts
  • frontend/tests/e2e/helpers.ts

📝 Walkthrough

Walkthrough

This PR adds optional ETag persistence and If-Match propagation to the WebDAV writeback stack, enabling client-side concurrency control for conditional updates without executing provider mutations. The database model gains etag_value, API response schemas expose etag and if_match fields, the service layer flows ETag values from accounts through intents, and tests/documentation are updated end-to-end.

Changes

WebDAV If-Match / ETag source evidence slice

Layer / File(s) Summary
Database model and schema migration
backend/db/models.py, backend/scripts/bootstrap_db.py, backend/tests/test_bootstrap_db.py
WebdavAccount model adds nullable etag_value column; bootstrap migration idempotently adds column to webdav_accounts table; test asserts migration coverage.
API response schemas for ETag and If-Match
backend/api/webdav.py
WebdavAccountResponse adds optional etag field; WritebackIntentResponse and KnowledgeMaterializationIntentResponse each add optional if_match field for conditional request support.
Service layer ETag propagation
backend/services/webdav_service.py
Service queries WebdavAccount.etag_value, includes etag in returned account dictionaries, and computes if_match in both writeback and knowledge-materialization intent responses from the selected account's ETag.
Backend test coverage for ETag mocking and assertions
backend/tests/test_webdav_api.py
Service stubs updated to return etag for demo accounts; writeback and knowledge-materialization endpoint tests assert if_match presence; PostgreSQL smoke tests model etag_value schema, persist values on insert, and verify response ETag matching.
Frontend and E2E test updates for ETag visibility
frontend/src/app/data/page.test.tsx, frontend/tests/e2e/dashboard-branding.spec.ts, frontend/tests/e2e/helpers.ts
Frontend test mocks include if_match in writeback-intent response and assert /api/webdav/accounts uses signed auth headers; E2E mocks add if_match to intent responses; E2E test asserts etag-webdav-primary element visibility and signed authorization on accounts endpoint.
Documentation and governance updates
AGENTS.md, README.md, docs/plans/2026-05-27-data-webdav-writeback-intent-ui.md, docs/plans/2026-05-29-webdav-if-match-source-evidence.md
Governance clarifies WebDAV readiness exposes only source-safe labels and ETag evidence; scope contract specifies source_uid/etag_value identifiers and 409 conflict semantics; UI documentation and new plan document describe ETag visibility in UI, mock updates, and test coverage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • Seongho-Bae/naruon#283: Overlaps on modifying WebDAV response schemas and service mappings in backend/api/webdav.py and backend/services/webdav_service.py; this PR adds ETag/If-Match fields while that PR refactors source labels.
  • Seongho-Bae/naruon#242: Code-level overlap on the /api/webdav/knowledge-materialization-intent flow; this PR extends it to propagate ETag-derived if_match evidence.
  • Seongho-Bae/naruon#247: Related to the ETag plumbing in the WebDAV writeback intent computation and API wiring that enables opaque source selection and conflict handling.

Poem

🐇 A rabbit's ode to ETags fair,
Where If-Match checks hang in the air,
No overwrites, just source-safe signs,
Concurrency flows on opaque lines,
Server-first proof, neat and square!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch phase/data-source-sovereignty-20260529

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown
Contributor

PR governance metadata gate is not ready for b91018f198ce531a37d4870099bb18ab5be5704c:

  • Current-head CodeRabbit issue comment has blocking warning/failure evidence on b91018f.

@seonghobae
seonghobae merged commit 8ea7f5e into master May 28, 2026
15 of 16 checks passed
@seonghobae
seonghobae deleted the phase/data-source-sovereignty-20260529 branch May 28, 2026 23:18
@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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