The GitHub Actions job "Required Checks" on texera.git/main has succeeded.
Run started by GitHub user github-merge-queue[bot] (triggered by 
github-merge-queue[bot]).

Head commit for run:
9b3c63aa20b07060abb964b1ca2bfb925795575f / Tanishq Gandhi 
<[email protected]>
refactor(file-service): make the file-tree builder resource-aware for model 
upload (#7762)

### What changes were proposed in this PR?

Refactoring groundwork so model upload can reuse the dataset file-tree
builder. No new
features and no change to dataset behavior.

`fromLakeFSRepositoryCommittedObjects` hardcoded the resource type as
the leading path
segment of the tree. `FileResolver` uses that segment to pick the
backing table, so a model
tree built by it would report `/dataset/...` paths and resolve against
the dataset table.
`resourceType` is now a required parameter, so each call site says which
resource it is
building. The three dataset call sites pass `ResourceType.Dataset`, the
value that was
hardcoded before, so datasets are unaffected.

Folded in from review:

- The class is renamed `DatasetFileNode` → `LakeFSFileNode`, with its
serializer and specs,
and moved out of `type/dataset/` since the package was already
`service.type`. This was
queued for the model PRs and pulled forward here, where the class
becomes
  resource-neutral.
- File-vs-directory is now decided positionally rather than by value.
Previously a path
repeating its final segment (`model/model`) made the intermediate
directory the leaf, so
  it took the object's size and the real file hung underneath it.

A promote-on-collision change was also tried here and then reverted: for
a version holding
both `model` and `model/weights.bin` it dropped the colliding object
from the tree and from
the reported size. The pre-existing behaviour is kept instead — two
siblings with the same
name, untidy but every object listed, sized and downloadable — and a
test now pins that
property. Representing both unambiguously, or rejecting such uploads, is
worth its own
issue.

The JSON contract is unchanged, so the frontend is unaffected: the
serializer writes
explicit field names, and the tree component sets `displayField: "name"`
with no `idField`,
so nodes carry generated ids and selection keys off node data rather
than name.

### Any related issues, documentation, discussions?

Part of #6494, groundwork for #6498. Based directly on `main` and
independent of the other
open PRs in the model stack.

### How was this PR tested?

`sbt "FileService/test"` — 323 tests, 13 suites, 0 failures. `sbt
"WorkflowCore/test"` —
787 tests, 0 failures. scalafmt and scalafix clean.

The dataset side is pinned by the existing tree test, unchanged, still
asserting
`/dataset/[email protected]/twitter/v1/b/1.csv` — that is what demonstrates
the no-op. Added:

- a model tree rooted at `/model/`, and the `model/model` case — each
verified to fail
  without its fix;
- the object/directory collision, which characterizes current behaviour
rather than a fix,
  so it also guards against re-introducing the promote;
- coverage for `retrieveDatasetVersionRootFileNodes` and
`retrieveLatestDatasetVersion`,
  which had none, pinning the dataset prefix end-to-end.

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 5)

---------

Co-authored-by: Claude Opus 5 <[email protected]>
Co-authored-by: ali <[email protected]>

Report URL: https://github.com/apache/texera/actions/runs/32756218237

With regards,
GitHub Actions via GitBox

Reply via email to