Skip to content

feat(weave): write explicit 'latest' alias on every obj_create (WB-32435)#6481

Closed
rgao-coreweave wants to merge 10 commits intomasterfrom
rgao/explicit-latest-alias-v2
Closed

feat(weave): write explicit 'latest' alias on every obj_create (WB-32435)#6481
rgao-coreweave wants to merge 10 commits intomasterfrom
rgao/explicit-latest-alias-v2

Conversation

@rgao-coreweave
Copy link
Copy Markdown
Contributor

Summary

  • Writes an explicit "latest" alias to the aliases table on every obj_create, so re-publishing old content promotes it to "latest" — matching W&B Artifacts behavior
  • Updates _maybe_resolve_alias to resolve "latest" from the aliases table first, falling back to computed is_latest for legacy objects
  • Updates the query builder so alias-based filtering for "latest" checks both the explicit alias and the computed is_latest

Changes

  • ClickHouse obj_create: calls _insert_aliases("latest") after every insert
  • _maybe_resolve_alias: resolves "latest" from aliases table with _resolve_computed_latest fallback
  • _enrich_objs_with_tags_and_aliases: only synthesizes "latest" from is_latest for objects without an explicit alias row
  • Query builder add_aliases_condition: includes "latest" in alias subquery alongside is_latest = 1 OR fallback
  • SQLite obj_create: writes "latest" alias in both dedup and new-insert paths

Test plan

  • test_obj_create_writes_latest_alias — verifies alias is written
  • test_obj_create_moves_latest_alias_on_new_version — alias moves on new version
  • test_obj_create_moves_latest_alias_on_dedup — alias moves on re-publish (dedup)
  • test_resolve_latest_falls_back_to_computed — legacy objects without alias still work
  • test_resolve_computed_latest_returns_none_for_missing — nonexistent object returns None
  • Updated query builder SQL expectations
  • Updated alias list tests to expect "latest"
  • Full trace_server shard (CH): 776 passed
  • Full alias tests (SQLite): 145 passed
  • Ruff check + format: clean

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@wandbot-3000
Copy link
Copy Markdown

wandbot-3000 Bot commented Mar 28, 2026

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 28, 2026

Codecov Report

❌ Patch coverage is 93.93939% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ve/trace_server/clickhouse_trace_server_batched.py 94.11% 0 Missing and 1 partial ⚠️
weave/trace_server/sqlite_trace_server.py 91.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@rgao-coreweave
Copy link
Copy Markdown
Contributor Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@rgao-coreweave
Copy link
Copy Markdown
Contributor Author

Code review

Found 1 issue:

  1. SQLite _maybe_resolve_alias was not updated to resolve "latest" from the aliases table. It still has if digest == "latest": return None (line 4760), which bypasses the alias table entirely. The ClickHouse version was updated to resolve "latest" from aliases with a computed fallback, but the SQLite path was missed. This means the core PR semantic (re-publishing old content promotes to latest) does not work for SQLite obj_read("latest"). The dedup test (test_obj_create_moves_latest_alias_on_dedup) only runs against ClickHouse via ch_server.

# content hashes are real digests that don't need resolution.
if digest == "latest":
return None
(is_version, _) = digest_is_version_like(digest)

@github-actions
Copy link
Copy Markdown
Contributor

This PR has been inactive for 14 days. It will be closed in 7 days unless there is new activity.

@github-actions github-actions Bot added the Stale label Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Closing this PR due to inactivity.

@github-actions github-actions Bot closed this Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant