fdl-cli 0.24.2__tar.gz → 0.24.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/CHANGELOG.md +21 -0
  2. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/PKG-INFO +1 -1
  3. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/spec/refs.md +2 -0
  4. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/spec/refs.md +2 -0
  5. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/pyproject.toml +1 -1
  6. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/repo.py +24 -1
  7. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/tests/test_repo.py +41 -0
  8. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/.github/workflows/docs.yml +0 -0
  9. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/.github/workflows/publish.yml +0 -0
  10. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/.github/workflows/release.yml +0 -0
  11. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/.github/workflows/test.yml +0 -0
  12. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/.gitignore +0 -0
  13. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/.node-version +0 -0
  14. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/.python-version +0 -0
  15. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/CLAUDE.md +0 -0
  16. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/CONTRIBUTING.md +0 -0
  17. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/LICENSE +0 -0
  18. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/README.md +0 -0
  19. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/SECURITY.md +0 -0
  20. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/blume.config.ts +0 -0
  21. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/cases/collection.json +0 -0
  22. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/concepts/meta.ts +0 -0
  23. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/concepts/repositories.md +0 -0
  24. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/concepts/versions-and-refs.md +0 -0
  25. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/concepts/working-catalogs.md +0 -0
  26. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/getting-started.md +0 -0
  27. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/guides/building-a-host.md +0 -0
  28. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/guides/meta.ts +0 -0
  29. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/guides/mirrors.md +0 -0
  30. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/guides/public-and-private.md +0 -0
  31. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/guides/reading-without-duckdb.md +0 -0
  32. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/guides/serving-over-http.md +0 -0
  33. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/guides/stores.md +0 -0
  34. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/index.md +0 -0
  35. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/internals/ducklake-formats.md +0 -0
  36. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/internals/from-write-to-read.md +0 -0
  37. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/internals/inside-a-repository.md +0 -0
  38. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/internals/meta.ts +0 -0
  39. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/concepts/meta.ts +0 -0
  40. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/concepts/repositories.md +0 -0
  41. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/concepts/versions-and-refs.md +0 -0
  42. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/concepts/working-catalogs.md +0 -0
  43. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/getting-started.md +0 -0
  44. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/guides/building-a-host.md +0 -0
  45. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/guides/meta.ts +0 -0
  46. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/guides/mirrors.md +0 -0
  47. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/guides/public-and-private.md +0 -0
  48. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/guides/reading-without-duckdb.md +0 -0
  49. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/guides/serving-over-http.md +0 -0
  50. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/guides/stores.md +0 -0
  51. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/index.md +0 -0
  52. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/internals/ducklake-formats.md +0 -0
  53. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/internals/from-write-to-read.md +0 -0
  54. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/internals/inside-a-repository.md +0 -0
  55. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/internals/meta.ts +0 -0
  56. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/reference/cli.md +0 -0
  57. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/reference/meta.ts +0 -0
  58. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/reference/python.md +0 -0
  59. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/spec/collection-cases.md +0 -0
  60. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/spec/data-files.md +0 -0
  61. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/spec/http.md +0 -0
  62. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/spec/index.md +0 -0
  63. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/spec/layout.md +0 -0
  64. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/spec/meta.ts +0 -0
  65. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/spec/reading.md +0 -0
  66. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/spec/versions.md +0 -0
  67. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/spec/writing.md +0 -0
  68. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/ja/stability.md +0 -0
  69. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/reference/cli.md +0 -0
  70. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/reference/meta.ts +0 -0
  71. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/reference/python.md +0 -0
  72. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/spec/collection-cases.md +0 -0
  73. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/spec/data-files.md +0 -0
  74. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/spec/http.md +0 -0
  75. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/spec/index.md +0 -0
  76. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/spec/layout.md +0 -0
  77. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/spec/meta.ts +0 -0
  78. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/spec/reading.md +0 -0
  79. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/spec/versions.md +0 -0
  80. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/spec/writing.md +0 -0
  81. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/docs/stability.md +0 -0
  82. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/package-lock.json +0 -0
  83. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/package.json +0 -0
  84. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/public/CNAME +0 -0
  85. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/__init__.py +0 -0
  86. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/catalog.py +0 -0
  87. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/cli.py +0 -0
  88. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/dataset.py +0 -0
  89. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/diff.py +0 -0
  90. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/layout.py +0 -0
  91. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/lineage.py +0 -0
  92. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/merge.py +0 -0
  93. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/objects.py +0 -0
  94. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/profiles.py +0 -0
  95. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/py.typed +0 -0
  96. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/refs.py +0 -0
  97. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/store.py +0 -0
  98. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/stores.py +0 -0
  99. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/src/fdl/version.py +0 -0
  100. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/tests/http_repo.py +0 -0
  101. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/tests/test_cli.py +0 -0
  102. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/tests/test_collection_cases.py +0 -0
  103. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/tests/test_dataset.py +0 -0
  104. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/tests/test_http.py +0 -0
  105. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/tests/test_merge.py +0 -0
  106. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/tests/test_objects.py +0 -0
  107. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/tests/test_profiles.py +0 -0
  108. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/tests/test_stores.py +0 -0
  109. {fdl_cli-0.24.2 → fdl_cli-0.24.3}/uv.lock +0 -0
@@ -1,6 +1,27 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v0.24.3 (2026-11-13)
5
+
6
+ ### Bug Fixes
7
+
8
+ - Write the ref again when a push finds it already at the version
9
+ ([#56](https://github.com/queria-io/fdl/pull/56),
10
+ [`a11abaf`](https://github.com/queria-io/fdl/commit/a11abaf3643d914167ee4ef41421daa68b769955))
11
+
12
+ * fix: write the ref again when a push finds it already at the version
13
+
14
+ A host that does its own work when a ref moves may stop after moving it. Pushing again returned
15
+ early because the ref already held the version, so the host never finished. The writer now writes
16
+ the ref again, to the same version and on condition of the ETag it read.
17
+
18
+ * fix: write the ref again after a retried write and in forward
19
+
20
+ A ref write whose first attempt moved the ref, with its answer lost, may leave the host stopped
21
+ after the move. forward returned early on the same version as push did. Both now write the ref
22
+ again, and the test checks the write is conditional on the ETag read.
23
+
24
+
4
25
  ## v0.24.2 (2026-11-13)
5
26
 
6
27
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: fdl-cli
3
- Version: 0.24.2
3
+ Version: 0.24.3
4
4
  Summary: Versions of a DuckLake catalog on object storage, kept the way Git keeps commits
5
5
  Project-URL: Homepage, https://fdl.queria.io/
6
6
  Project-URL: Documentation, https://fdl.queria.io/
@@ -57,3 +57,5 @@ HEAD ref: refs/heads/main\n
57
57
  ## 送り直した書き込み
58
58
 
59
59
  最初の返事を受け取れずに ref の書き込みを送り直した書き手は、自分の最初の書き込みのせいで条件が合わず断られることがあります。そのとき ref が、動かそうとしていたバージョンを指していれば、動かすのは成功しています。
60
+
61
+ 動かそうとしているバージョンを ref が既に指していたら(書き込む前でも、送り直した書き込みが断られた後でも)、書き手は ref を同じバージョンで書き直します。条件には読んだときの ETag を付けます。ref を動かすときに自分の処理(新しいバージョンの記録など)をするホストは、ref を動かした後で止まっていることがあり、この書き込みで処理を終えられます。ホストは、ref を動かさない書き込みも受け付けます。読んだ後に ref が動いていたら、書き手はそのままにします。
@@ -57,3 +57,5 @@ A reader over plain HTTP cannot list the store, so it cannot find branches and t
57
57
  ## Retried writes
58
58
 
59
59
  A writer that sends a ref write again after losing the answer to the first one may find the condition refused by its own first attempt. If the ref now holds the version it was moving to, the move succeeded.
60
+
61
+ A writer that finds the ref already holding the version it is moving the ref to, before its write or after a retried one, writes the ref again, to the same version and on condition of the ETag it read. A host that does its own work when a ref moves (recording the new version, say) may have stopped after moving the ref, and this write lets it finish. A host accepts a write that leaves a ref where it is. If the ref has moved since it was read, the writer leaves it.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fdl-cli"
3
- version = "0.24.2"
3
+ version = "0.24.3"
4
4
  description = "Versions of a DuckLake catalog on object storage, kept the way Git keeps commits"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -462,7 +462,10 @@ def push(
462
462
  current_ref = refs.read(store, layout.check_ref(ref))
463
463
  if current_ref is not None and current_ref.target == version.id:
464
464
  # This push again, after a run whose answer was lost. That run may
465
- # have stopped before rewriting refs.json.
465
+ # have stopped before rewriting refs.json, and a host that does its
466
+ # own work when a ref moves may have stopped after moving it.
467
+ if move_ref:
468
+ _write_ref_again(store, current_ref)
466
469
  update_refs_index(store)
467
470
  return
468
471
  _refuse_unless_fast_forward(store, current_ref, version)
@@ -489,9 +492,26 @@ def push(
489
492
  now = refs.read(store, ref)
490
493
  if now is None or now.target != version.id:
491
494
  raise NotFastForward(f"{ref} moved during the push. Pull and build again.") from exc
495
+ # The first attempt moved it, but its answer was lost: the host may
496
+ # have stopped after the move.
497
+ _write_ref_again(store, now)
492
498
  update_refs_index(store)
493
499
 
494
500
 
501
+ def _write_ref_again(store: Store, ref: refs.Ref) -> None:
502
+ """Write ``ref`` to the version it holds, so a host finishes the move.
503
+
504
+ A ref that moved meanwhile was moved by a later push, which did the
505
+ host's work for its own version: nothing is left to finish.
506
+ """
507
+ if not ref.etag:
508
+ return
509
+ try:
510
+ refs.write(store, ref.name, ref.target, expected=ref)
511
+ except refs.RefConflict:
512
+ pass
513
+
514
+
495
515
  def tag(store: Store, name: str, version_id: str) -> None:
496
516
  """Create ``refs/tags/<name>`` at a version. Tags are created, never moved."""
497
517
  ref = layout.check_ref(f"refs/tags/{name}")
@@ -1060,6 +1080,8 @@ def forward(store: Store, ref: str, version: Version) -> None:
1060
1080
  """
1061
1081
  current = refs.read(store, layout.check_ref(ref))
1062
1082
  if current is not None and current.target == version.id:
1083
+ # As in `push`: a host may have stopped after a lost move.
1084
+ _write_ref_again(store, current)
1063
1085
  update_refs_index(store)
1064
1086
  return
1065
1087
  _refuse_unless_fast_forward(store, current, version)
@@ -1070,6 +1092,7 @@ def forward(store: Store, ref: str, version: Version) -> None:
1070
1092
  now = refs.read(store, ref)
1071
1093
  if now is None or now.target != version.id:
1072
1094
  raise NotFastForward(f"{ref} moved meanwhile. Pull and merge again.") from exc
1095
+ _write_ref_again(store, now)
1073
1096
  update_refs_index(store)
1074
1097
 
1075
1098
 
@@ -17,6 +17,8 @@ from fdl import catalog, diff, layout, refs, repo
17
17
  from fdl.stores import LocalStore
18
18
  from fdl.version import is_id, new_id, parse
19
19
 
20
+ REAL_READ = refs.read
21
+
20
22
  AUTHOR = {"name": "tester"}
21
23
 
22
24
 
@@ -138,6 +140,45 @@ def test_pushing_the_same_version_again_is_accepted(tmp_path: Path, remote) -> N
138
140
  assert repo.head(remote) == first
139
141
 
140
142
 
143
+ def test_a_push_sent_again_writes_the_ref_again(tmp_path: Path, remote, monkeypatch) -> None:
144
+ """A host that does its work when the ref moves may have stopped after
145
+ moving it. The second push gives it the write again."""
146
+ build(tmp_path / "work.sqlite", remote, "CREATE TABLE lake.main.towns AS SELECT 1 AS id")
147
+ version = commit(tmp_path, remote)
148
+ repo.push(remote, tmp_path / "local" / version.id, version)
149
+ seen = refs.read(remote, "refs/heads/main")
150
+ written: list[tuple[str, str | None]] = []
151
+ put = remote.put
152
+ monkeypatch.setattr(
153
+ remote,
154
+ "put",
155
+ lambda key, *a, **kw: written.append((key, kw.get("if_match"))) or put(key, *a, **kw),
156
+ )
157
+
158
+ repo.push(remote, tmp_path / "local" / version.id, version)
159
+
160
+ # Written on condition of the ETag read, so a ref moved since is left.
161
+ assert ("refs/heads/main", seen.etag) in written
162
+ assert repo.head(remote) == version
163
+
164
+
165
+ def test_a_push_sent_again_leaves_a_ref_moved_since(tmp_path: Path, remote, monkeypatch) -> None:
166
+ build(tmp_path / "work.sqlite", remote, "CREATE TABLE lake.main.towns AS SELECT 1 AS id")
167
+ version = commit(tmp_path, remote)
168
+ repo.push(remote, tmp_path / "local" / version.id, version)
169
+ later = new_id()
170
+ seen = refs.read(remote, "refs/heads/main")
171
+ # Another push moves main between this one's read and its write.
172
+ monkeypatch.setattr(
173
+ refs, "read", lambda store, name: seen if name == "refs/heads/main" else REAL_READ(store, name)
174
+ )
175
+ refs.write(remote, "refs/heads/main", later, expected=seen)
176
+
177
+ repo.push(remote, tmp_path / "local" / version.id, version)
178
+
179
+ assert REAL_READ(remote, "refs/heads/main").target == later
180
+
181
+
141
182
  def test_push_without_moving_the_ref_leaves_readers_where_they_were(
142
183
  tmp_path: Path, remote
143
184
  ) -> None:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes