You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/07/05 05:24:36 UTC
[PR] test(workflow-core): cover JGitVersionControl and GitVersionControlLocalFileStorage [texera]
aglinxinyuan opened a new pull request, #6134:
URL: https://github.com/apache/texera/pull/6134
### What changes were proposed in this PR?
Adds unit-test coverage for the two local-git dataset version-control utilities in `common/workflow-core` (`org.apache.texera.amber.core.storage.util.dataset`), which Codecov reports as almost entirely uncovered:
- **`JGitVersionControlSpec`** (new) — drives `JGitVersionControl` against a temp git repo: `initRepo` (happy path + already-exists guard), `add`/`commit` (40-hex hash), `getRootFileNodeOfCommit` with a top-level file and a nested directory (sizes + relative paths, including subtree recursion), `readFileContentOfCommitAsInputStream`/`AsOutputStream` round-trips, the guard branches on both read methods (outside-repo path, in-repo directory, missing file), `rm`, and `hasUncommittedChanges`/`discardUncommittedChanges`.
- **`GitVersionControlLocalFileStorageSpec`** (extended) — adds a full versioned lifecycle (`initRepo` → `writeFileToRepo` → `withCreateVersion` → `retrieveRootFileNodesOfVersion` → `retrieveFileContentOfVersion`/`AsInputStream` → `writeVersionedFileToTempFile`), plus `hasUncommittedChanges`/`discardUncommittedChanges` and `removeFileFromRepo` (directory guard + delete). The existing `deleteRepo` test and its `deleteIfExists` helper are reused.
No production code is changed; this is test-only.
Note: `JGitVersionControl.add` stages via `repoPath.relativize(filePath).toString()`, whose pathspec uses the OS separator; JGit's matcher rejects the Windows `dir\file` form, so nested-path staging in the tests is done with the portable `add(".")` pattern, and temp-dir teardown is best-effort (JGit can hold Windows file handles). Both are test-side accommodations; behavior on the Linux CI path is unchanged.
### Any related issues, documentation, discussions?
Coverage gaps identified from the Codecov report for `apache/texera`.
### How was this PR tested?
New/extended ScalaTest specs, run locally:
```
sbt "WorkflowCore/testOnly *JGitVersionControlSpec *GitVersionControlLocalFileStorageSpec"
```
All 16 pass. `scalafmt` and `scalafixAll --check` are clean.
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.8 [1M context])
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-core): cover JGitVersionControl and GitVersionControlLocalFileStorage [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #6134:
URL: https://github.com/apache/texera/pull/6134#discussion_r3524362432
##########
common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/util/dataset/GitVersionControlLocalFileStorageSpec.scala:
##########
@@ -56,4 +75,99 @@ class GitVersionControlLocalFileStorageSpec extends AnyFlatSpec {
deleteIfExists(repoDir)
}
}
+
+ "GitVersionControlLocalFileStorage" should "support a full versioned lifecycle over a temp repo" in {
+ // Create then delete the temp dir so initRepo exercises its createDirectories branch.
+ val repoDir = Files.createTempDirectory("texera-vc-lifecycle")
+ deleteIfExists(repoDir)
+ assert(!Files.exists(repoDir))
+
+ try {
+ val branch = GitVersionControlLocalFileStorage.initRepo(repoDir)
+ assert(branch != null)
+ assert(Files.exists(repoDir.resolve(".git")))
+ setIdentity(repoDir)
+
+ // Write a top-level file (hello.txt) into the repo and commit it as version "v1".
+ // A nested path would exercise JGitVersionControl.add's OS-separator pathspec, which
+ // JGit rejects on Windows; the versioned-storage surface is covered with a root file.
+ val relative = repoDir.resolve("hello.txt")
+ val content = "hello-versioned-content"
Review Comment:
The variable name `relative` is misleading here: `repoDir.resolve("hello.txt")` produces an absolute path under the repo, not a relative path. This makes the test harder to follow (especially since some Javadocs mention “relative” paths). Consider renaming it to something like `helloFile`/`filePathInRepo` and updating its usages accordingly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-core): cover JGitVersionControl and GitVersionControlLocalFileStorage [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #6134:
URL: https://github.com/apache/texera/pull/6134
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-core): cover JGitVersionControl and GitVersionControlLocalFileStorage [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #6134:
URL: https://github.com/apache/texera/pull/6134#issuecomment-4884961961
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/6134?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 59.12%. Comparing base ([`3a12e62`](https://app.codecov.io/gh/apache/texera/commit/3a12e6214c5f45477042374ae3a4a569835d1fda?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`368e433`](https://app.codecov.io/gh/apache/texera/commit/368e4336a1c1cfbf6e2106b17e9f3470fb337751?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #6134 +/- ##
=========================================
Coverage 59.12% 59.12%
Complexity 3208 3208
=========================================
Files 1132 1132
Lines 43681 43681
Branches 4734 4734
=========================================
Hits 25828 25828
Misses 16417 16417
Partials 1436 1436
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
|---|---|---|---|
| [access-control-service](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.00% <ø> (ø)` | | |
| [agent-service](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `44.59% <ø> (ø)` | | Carriedforward from [3a12e62](https://app.codecov.io/gh/apache/texera/commit/3a12e6214c5f45477042374ae3a4a569835d1fda?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [amber](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `63.16% <ø> (ø)` | | Carriedforward from [3a12e62](https://app.codecov.io/gh/apache/texera/commit/3a12e6214c5f45477042374ae3a4a569835d1fda?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `0.00% <ø> (ø)` | | Carriedforward from [3a12e62](https://app.codecov.io/gh/apache/texera/commit/3a12e6214c5f45477042374ae3a4a569835d1fda?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [config-service](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `52.30% <ø> (ø)` | | Carriedforward from [3a12e62](https://app.codecov.io/gh/apache/texera/commit/3a12e6214c5f45477042374ae3a4a569835d1fda?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [file-service](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `62.81% <ø> (ø)` | | Carriedforward from [3a12e62](https://app.codecov.io/gh/apache/texera/commit/3a12e6214c5f45477042374ae3a4a569835d1fda?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [frontend](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `51.31% <ø> (ø)` | | Carriedforward from [3a12e62](https://app.codecov.io/gh/apache/texera/commit/3a12e6214c5f45477042374ae3a4a569835d1fda?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.57% <ø> (ø)` | | Carriedforward from [3a12e62](https://app.codecov.io/gh/apache/texera/commit/3a12e6214c5f45477042374ae3a4a569835d1fda?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [pyamber](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `91.19% <ø> (ø)` | | Carriedforward from [3a12e62](https://app.codecov.io/gh/apache/texera/commit/3a12e6214c5f45477042374ae3a4a569835d1fda?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/6134/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.14% <ø> (ø)` | | Carriedforward from [3a12e62](https://app.codecov.io/gh/apache/texera/commit/3a12e6214c5f45477042374ae3a4a569835d1fda?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/6134?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-core): cover JGitVersionControl and GitVersionControlLocalFileStorage [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6134:
URL: https://github.com/apache/texera/pull/6134#issuecomment-4884967810
<!-- texera-benchmarks-comment -->
## ⚠️ Benchmark changes need a look
🟢 4 better · 🔴 1 worse · ⚪ 10 noise (<±5%) · 0 without baseline
> Compared against main `3a12e62` benchmarked on **this same runner**, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.
[Dashboard](https://apache.github.io/texera/dev/bench/) · [Run](https://github.com/apache/texera/actions/runs/28730628390)
| | config | throughput | MB/s | latency | max Δ latest / 7d |
|---|---|---:|---:|---:|---:|
| 🔴 | bs=10 sw=10 sl=64 | 440 | 0.268 | 22,303/29,288/29,288 us | 🟢 -15.1% / 🔴 +93.4% |
| 🟢 | bs=100 sw=10 sl=64 | 929 | 0.567 | 106,038/139,052/139,052 us | 🟢 -11.9% / 🔴 +28.8% |
| ⚪ | bs=1000 sw=10 sl=64 | 1,086 | 0.663 | 921,173/973,448/973,448 us | ⚪ within ±5% / 🟢 -8.2% |
<details><summary>Baseline details</summary>
Latest main `3a12e62` from same runner
| config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
|---|---|---:|---:|---:|---:|---:|
| bs=10 sw=10 sl=64 | throughput | 440 tuples/sec | 451 tuples/sec | 776.36 tuples/sec | -2.4% | -43.3% |
| bs=10 sw=10 sl=64 | MB/s | 0.268 MB/s | 0.275 MB/s | 0.474 MB/s | -2.5% | -43.4% |
| bs=10 sw=10 sl=64 | p50 | 22,303 us | 20,960 us | 12,636 us | +6.4% | +76.5% |
| bs=10 sw=10 sl=64 | p95 | 29,288 us | 34,505 us | 15,143 us | -15.1% | +93.4% |
| bs=10 sw=10 sl=64 | p99 | 29,288 us | 34,505 us | 18,954 us | -15.1% | +54.5% |
| bs=100 sw=10 sl=64 | throughput | 929 tuples/sec | 940 tuples/sec | 985.33 tuples/sec | -1.2% | -5.7% |
| bs=100 sw=10 sl=64 | MB/s | 0.567 MB/s | 0.574 MB/s | 0.601 MB/s | -1.2% | -5.7% |
| bs=100 sw=10 sl=64 | p50 | 106,038 us | 101,314 us | 101,671 us | +4.7% | +4.3% |
| bs=100 sw=10 sl=64 | p95 | 139,052 us | 157,753 us | 107,939 us | -11.9% | +28.8% |
| bs=100 sw=10 sl=64 | p99 | 139,052 us | 157,753 us | 113,798 us | -11.9% | +22.2% |
| bs=1000 sw=10 sl=64 | throughput | 1,086 tuples/sec | 1,082 tuples/sec | 1,016 tuples/sec | +0.4% | +6.8% |
| bs=1000 sw=10 sl=64 | MB/s | 0.663 MB/s | 0.66 MB/s | 0.62 MB/s | +0.5% | +6.9% |
| bs=1000 sw=10 sl=64 | p50 | 921,173 us | 924,878 us | 989,693 us | -0.4% | -6.9% |
| bs=1000 sw=10 sl=64 | p95 | 973,448 us | 976,898 us | 1,028,327 us | -0.4% | -5.3% |
| bs=1000 sw=10 sl=64 | p99 | 973,448 us | 976,898 us | 1,059,969 us | -0.4% | -8.2% |
</details>
<details><summary>Raw CSV</summary>
```csv
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,454.64,200,128000,440,0.268,22303.10,29288.39,29288.39
1,100,10,64,20,2153.79,2000,1280000,929,0.567,106037.99,139052.11,139052.11
2,1000,10,64,20,18421.74,20000,12800000,1086,0.663,921173.35,973447.71,973447.71
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-core): cover JGitVersionControl and GitVersionControlLocalFileStorage [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #6134:
URL: https://github.com/apache/texera/pull/6134#issuecomment-4884957705
<!-- texera-reviewer-suggestion -->
### Automated Reviewer Suggestions
Based on the `git blame` history of the changed files, we recommend the following reviewers:
- **Contributors with relevant context:** `@lie18uci`
You can notify them by mentioning `@lie18uci` in a comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] test(workflow-core): cover JGitVersionControl and GitVersionControlLocalFileStorage [texera]
Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan commented on code in PR #6134:
URL: https://github.com/apache/texera/pull/6134#discussion_r3524376731
##########
common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/util/dataset/GitVersionControlLocalFileStorageSpec.scala:
##########
@@ -56,4 +75,99 @@ class GitVersionControlLocalFileStorageSpec extends AnyFlatSpec {
deleteIfExists(repoDir)
}
}
+
+ "GitVersionControlLocalFileStorage" should "support a full versioned lifecycle over a temp repo" in {
+ // Create then delete the temp dir so initRepo exercises its createDirectories branch.
+ val repoDir = Files.createTempDirectory("texera-vc-lifecycle")
+ deleteIfExists(repoDir)
+ assert(!Files.exists(repoDir))
+
+ try {
+ val branch = GitVersionControlLocalFileStorage.initRepo(repoDir)
+ assert(branch != null)
+ assert(Files.exists(repoDir.resolve(".git")))
+ setIdentity(repoDir)
+
+ // Write a top-level file (hello.txt) into the repo and commit it as version "v1".
+ // A nested path would exercise JGitVersionControl.add's OS-separator pathspec, which
+ // JGit rejects on Windows; the versioned-storage surface is covered with a root file.
+ val relative = repoDir.resolve("hello.txt")
+ val content = "hello-versioned-content"
Review Comment:
Renamed `relative` -> `filePathInRepo` (it's an absolute path under the repo, not a relative one) and updated its usages (842b10d).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org