lancedb-update-lance-dependency

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

LanceDB Update Lance Dependency

LanceDB 更新Lance依赖

Scope

适用范围

Use this skill in the
lancedb/lancedb
repository when updating the Lance dependency to a specific Lance version or tag.
Inputs can be a version (
7.2.0-beta.1
), a tag (
v7.2.0-beta.1
), a tag ref (
refs/tags/v7.2.0-beta.1
), or
latest
.
lancedb/lancedb
仓库中,当将Lance依赖更新至特定Lance版本或标签时使用该技能。
输入可以是版本(如
7.2.0-beta.1
)、标签(如
v7.2.0-beta.1
)、标签引用(如
refs/tags/v7.2.0-beta.1
)或
latest

Workflow

工作流程

  1. Confirm the worktree status with
    git status --short
    .
  2. Resolve the target Lance version:
    • If the input is
      latest
      , empty, or omitted, run:
      bash
      python3 ci/check_lance_release.py
      Parse the JSON output. If
      needs_update
      is not
      true
      , stop without creating a PR. Otherwise use
      latest_tag
      .
    • If the input is explicit, use it directly.
  3. Compute update metadata without changing files:
    bash
    python3 ci/update_lance_dependency.py "$TAG_OR_VERSION" --metadata-only
    Before making changes, check for an existing open PR with the emitted
    pr_title
    :
    bash
    gh pr list --search "\"$PR_TITLE\" in:title" --state open --limit 1 --json number,url,title
    If a matching open PR exists, stop and report it instead of creating a duplicate.
  4. Run the deterministic update entrypoint:
    bash
    python3 ci/update_lance_dependency.py "$TAG_OR_VERSION"
    This updates the Rust workspace Lance dependencies through
    ci/set_lance_version.py
    , updates
    java/pom.xml
    , refreshes Cargo metadata, and prints JSON metadata containing
    branch_name
    ,
    commit_message
    , and
    pr_title
    .
  5. Run validation:
    bash
    cargo clippy --quiet --workspace --tests --all-features -- -D warnings
    cargo fmt --all --quiet
    Fix real diagnostics and rerun clippy until it succeeds. Do not skip warnings.
  6. Inspect
    git status --short
    and
    git diff
    to ensure only the Lance dependency update and required compatibility fixes are present.
  7. If the task only asks to prepare local changes, stop here and report the changed files and validation result.
  8. If the task asks to publish the update, create a branch using the printed
    branch_name
    , stage all relevant files, and commit using the printed
    commit_message
    . Do not amend or rewrite existing commits.
  9. Push to
    origin
    . Before creating the PR, check that the current token has push permission:
    bash
    gh api repos/lancedb/lancedb --jq .permissions.push
    If the remote branch already exists for the same generated branch name, delete the remote ref with
    gh api -X DELETE repos/lancedb/lancedb/git/refs/heads/$BRANCH_NAME
    , then push. Do not force-push.
  10. Create a PR targeting
    main
    with the printed
    pr_title
    . If there is no PR template, keep the body to two or three concise sentences: state the Lance dependency bump, note any required compatibility fixes, and link the triggering Lance tag or release.
  11. Read back the remote PR title after creation. If it is not a Conventional Commit title, fix it immediately.
  12. When running in GitHub Actions after creating the LanceDB PR, trigger the Sophon dependency update:
    bash
    gh workflow run codex-bump-lancedb-lance.yml \
      --repo lancedb/sophon \
      -f lance_ref="$LANCE_TAG" \
      -f lancedb_ref="$BRANCH_NAME"
    gh run list --repo lancedb/sophon --workflow codex-bump-lancedb-lance.yml --limit 1 --json databaseId,url,displayTitle
    Use the emitted metadata
    tag
    value as
    LANCE_TAG
    . Do this only after a new LanceDB PR has been created. If the update was skipped because no update is needed or an open PR already exists, do not trigger Sophon.
  1. 使用
    git status --short
    确认工作区状态。
  2. 解析目标Lance版本:
    • 若输入为
      latest
      、空值或未提供,执行:
      bash
      python3 ci/check_lance_release.py
      解析JSON输出。若
      needs_update
      不为
      true
      ,则停止操作,不创建PR。否则使用
      latest_tag
    • 若输入为明确值,则直接使用该值。
  3. 在不修改文件的情况下计算更新元数据:
    bash
    python3 ci/update_lance_dependency.py "$TAG_OR_VERSION" --metadata-only
    在进行修改前,检查是否存在标题与输出的
    pr_title
    匹配的已开放PR:
    bash
    gh pr list --search "\"$PR_TITLE\" in:title" --state open --limit 1 --json number,url,title
    若存在匹配的已开放PR,则停止操作并告知该PR,避免创建重复内容。
  4. 执行确定性更新入口命令:
    bash
    python3 ci/update_lance_dependency.py "$TAG_OR_VERSION"
    该命令会通过
    ci/set_lance_version.py
    更新Rust工作区的Lance依赖,更新
    java/pom.xml
    ,刷新Cargo元数据,并打印包含
    branch_name
    commit_message
    pr_title
    的JSON元数据。
  5. 执行验证:
    bash
    cargo clippy --quiet --workspace --tests --all-features -- -D warnings
    cargo fmt --all --quiet
    修复实际诊断问题并重新运行clippy,直至成功。请勿忽略警告。
  6. 通过
    git status --short
    git diff
    检查,确保仅存在Lance依赖更新及必要的兼容性修复内容。
  7. 若任务仅要求准备本地修改,则在此步骤停止,并报告已修改的文件和验证结果。
  8. 若任务要求发布更新,则使用打印的
    branch_name
    创建分支,暂存所有相关文件,并使用打印的
    commit_message
    提交。请勿修改或重写现有提交。
  9. 推送到
    origin
    。创建PR前,检查当前令牌是否拥有推送权限:
    bash
    gh api repos/lancedb/lancedb --jq .permissions.push
    若对应生成的分支名称已存在远程分支,使用
    gh api -X DELETE repos/lancedb/lancedb/git/refs/heads/$BRANCH_NAME
    删除远程引用,然后推送。请勿强制推送。
  10. 创建以
    main
    为目标分支的PR,标题使用打印的
    pr_title
    。若无PR模板,PR正文保持2-3句简洁内容:说明Lance依赖升级情况,标注必要的兼容性修复,并关联触发本次更新的Lance标签或版本。
  11. PR创建后查看远程PR标题。若不符合Conventional Commit规范,立即修正。
  12. 在GitHub Actions中创建LanceDB PR后,触发Sophon依赖更新:
    bash
    gh workflow run codex-bump-lancedb-lance.yml \
      --repo lancedb/sophon \
      -f lance_ref="$LANCE_TAG" \
      -f lancedb_ref="$BRANCH_NAME"
    gh run list --repo lancedb/sophon --workflow codex-bump-lancedb-lance.yml --limit 1 --json databaseId,url,displayTitle
    使用输出元数据中的
    tag
    值作为
    LANCE_TAG
    。仅在创建新的LanceDB PR后执行此操作。若因无需更新或已存在开放PR而跳过更新,则不触发Sophon更新。

GitHub Actions

GitHub Actions

When this skill is used from GitHub Actions,
TAG
,
GH_TOKEN
, and
GITHUB_TOKEN
may already be set. Resolve
latest
first when
TAG
is empty. Once an explicit tag or version is known, use:
bash
python3 ci/update_lance_dependency.py "$TAG" --github-output "$GITHUB_OUTPUT"
Then use the emitted
branch_name
,
commit_message
, and
pr_title
values for branch, commit, and PR creation.
当在GitHub Actions中使用该技能时,
TAG
GH_TOKEN
GITHUB_TOKEN
可能已预先设置。若
TAG
为空,先解析
latest
。确定明确的标签或版本后,执行:
bash
python3 ci/update_lance_dependency.py "$TAG" --github-output "$GITHUB_OUTPUT"
随后使用输出的
branch_name
commit_message
pr_title
值进行分支创建、提交和PR创建。