treeverse/lakeFS

Unable to get imported objects in pre-commit hook

itaiad200 opened this issue · 0 comments

The import operation is performed using a commit, which allows it to integrate with both pre-commit and post-commit hooks. However, in pre-commit hooks, it is not possible to iterate over the objects introduced as part of the import.

Options I tried:

  • diff_refs(repository_id, left_reference_id, right_reference_id, ..): This returns an object-wise diff between left_reference_id and right_reference_id. However, in the pre-commit event, the commit ID for the import is not available.
    • A potential quick fix would be to modify the event to also pass the commit ID. However, this would introduce a discrepancy in the pre-commit event between Commit and Import operations, which may not be ideal since a commit does not exist before it is actually created.
  • diff_branch(repository_id, branch_id, ..): This returns an object-wise diff of uncommitted changes on branch_id. However, unlike with the Commit operation, there are no uncommitted objects in the branch when using Import.