Repository navigation
chore(licensing): add --ignore-transitive-version flag and use it on PR builds - #4693
Merged
Yicong-Huang merged 2 commits intoMay 2, 2026
Merged
Conversation
…PR builds Resolves apache#4691. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4693 +/- ##
============================================
+ Coverage 46.16% 46.75% +0.58%
- Complexity 1996 2080 +84
============================================
Files 1013 1013
Lines 38165 39571 +1406
Branches 3712 3847 +135
============================================
+ Hits 17619 18501 +882
- Misses 19775 20285 +510
- Partials 771 785 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@Yicong-Huang please review it. Should this change also go to release v1.1.0-incubating ? |
…irect deps Operator-only deps (e.g. torch, scikit-learn, transformers) live in amber/operator-requirements.txt. Without this file in the primary list they were being mis-classified as transitive, so a torch version bump would no longer block PRs even though it is a direct dep of the operator runtime. Also skip pip-flag lines (`-r`, `--extra-index-url`, ...) so the parser does not try to canonicalize them as package names. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Contributor
|
yes |
Yicong-Huang
enabled auto-merge (squash)
May 2, 2026 22:28
Yicong-Huang
reviewed
May 2, 2026
Yicong-Huang
pushed a commit
that referenced
this pull request
May 2, 2026
…PR builds (#4693) ### What changes were proposed in this PR? This PR relaxes the per-PR license-binary check so transitive-only version bumps no longer block unrelated PRs, while still enforcing the parts of the check that need legal review. Sub-task implementation for #4691; broader context in #4688. **Script (`bin/licensing/check_binary_deps.py`).** - New flag `--ignore-transitive-version`. Without it, behavior is unchanged (exact match). - Added direct-dependency loaders per ecosystem, reading the primary requirement files: - `python` → `amber/requirements.txt` (PEP 503 canonical names) - `npm` → `frontend/package.json` (`dependencies` + `devDependencies` + `peer*` + `optional*`) - `agent-npm` → `agent-service/package.json` - `jar` → every `*.sbt` and `Dependencies.scala` in the repo - Refactored the diff to surface four classes instead of just two: - `added` (new package not claimed) — **always fails** - `stale` (claimed but no longer bundled) — **always fails** - `drift_direct` (claimed direct dep, version changed) — **always fails** (a version bump can carry a license change) - `drift_transitive` (claimed transitive dep, version changed) — **fails by default; informational with `--ignore-transitive-version`** - For jars, the script bridges sbt-native-packager's `<groupId>.<artifactId>-<version>.jar` naming and SBT's bare artifactId by matching the trailing artifact segment after the last `.`, with Scala-version suffix stripping for `%%`/`%%%` libs. **CI (`.github/workflows/build.yml`).** - All four `check_binary_deps.py` invocations (frontend npm, jar, python, agent-npm) now pass `--ignore-transitive-version`. The exact-match check is preserved as the default and will be reused by the planned nightly job (sub-task #4692) so transitive drift remains visible and actionable on `main`. ### Any related issues, documentation, discussions? Resolves #4691. Sibling sub-task: #4692 (nightly exact-match job). Original report: #4688. ### How was this PR tested? End-to-end smoke tests run locally against the real combined LICENSE-binary built via `concat_license_binary.py` (113 python claims, 112 npm claims, 566 jar claims). For each ecosystem the four behavior modes were exercised by mutating a synthetic `pip-licenses.csv` / `3rdpartylicenses.json` / `lib/` directory: Verified on the CI job: https://github.com/apache/texera/actions/runs/25263088078/job/74073452760?pr=4693 <img width="1027" height="260" alt="Screenshot 2026-05-02 at 3 19 05 PM" src="https://github.com/user-attachments/assets/38bef6c0-9d1b-4869-baf7-5204a93313e7" /> ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (claude-opus-4-7) --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> (backported from commit b98c863)
This was referenced May 3, 2026
bobbai00
added a commit
to bobbai00/texera
that referenced
this pull request
May 3, 2026
* ci: nightly strict license-binary check that files a tracking issue on drift Resolves apache#4692. PR builds run check_binary_deps.py with --ignore-transitive-version (apache#4693) so a benign upstream version bump on a transitive dep does not block merges. This workflow runs the same checks **without** that flag every night on `main` so transitive drift is still visible and actionable before each release. On non-zero exit it files (or updates) one tracking issue identified by the stable label `license-binary-drift`; on a clean run it closes the issue if one is open. Workflow shape: - frontend-npm | agent-npm | python | jar — one job per ecosystem, each rebuilds its dist exactly the way build.yml does and runs the strict check; failures don't fail the workflow (continue-on-error) so all four still run. - jar uses the unified check across every dist's lib/ rather than a per-service matrix; per-service placement errors are still caught by build.yml on every PR, and the nightly's job is exact-version drift which the unified check surfaces just as well. - report — aggregates per-ecosystem results from artifacts and creates / updates / closes the tracking issue via actions/github-script. Skips issue management when not on the default branch (so workflow_dispatch on feature branches still runs the checks but does not surface issues). Trigger: schedule (07:00 UTC daily) + workflow_dispatch. Permissions: issues:write for the report job. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * fix(ci): repair direct-backport-push YAML and post backport result comments (apache#4846) ### What changes were proposed in this PR? Three changes to `.github/workflows/direct-backport-push.yml`. **1. Repair YAML.** The inline `python3 -c '<source>'` from apache#4696 put Python at column 0 inside a `run: |` block indented at column 10. YAML treats `import re, sys` as a top-level key, so every push to `main` failed in 0 seconds with 0 jobs (e.g. [run 25271247473](https://github.com/apache/texera/actions/runs/25271247473)). Python can't be re-indented (top-level statements reject leading whitespace), so the script moves to `.github/scripts/compose-backport-message.py`. Behavior unchanged. **2. Surface backport status on the original commit + PR.** Cherry-picks produce a new SHA, so the release branch never appears in the auto-derived branch badge on the main commit. Three channels instead — commit status badge, commit comment, PR comment — on success; commit status + PR comment on failure with an inline conflict diagnosis. Success PR comment: > Backport to [`release/0.4`](…/tree/release/0.4) succeeded as [`a1b2c3d`](…/commit/a1b2c3d…). [Run](…) Failure PR comment (when cherry-pick conflicts): > Backport to `release/0.4` failed. See [job log](…/job/…). > > **Conflicts in:** > - `f.txt` > > **Likely-missing prerequisites on main** (commits that touched these files between merge-base `6343a1bc` and `c027f3b2^` — consider backporting these first): > - `958b8e8 main: prereq edit f` Capped at 5 files / 10 commits; full detail stays in the job log. Rebase-race conflicts get the same shape but list the racing commits on `origin/<target>` instead. **3. Retry + structured logging.** `git push` retries 5x with `[0, 5, 15, 30, 60]s` backoff and rebases on `origin/<target>` between attempts to absorb push races. Annotation API calls retry with `[0, 2, 5, 15]s` and degrade to warnings on final failure (a 5xx on a comment shouldn't undo a successful cherry-pick). Every phase is wrapped in `::group::` markers with a `[backport <target>] ...` prefix. ### Any related issues, documentation, discussions? Fixes the regression introduced in apache#4696. ### How was this PR tested? `yaml.safe_load` parses the workflow. `compose-backport-message.py` round-trips through `git interpret-trailers --parse` with `Co-authored-by` preserved. The conflict diagnosis output above came verbatim from a throwaway repo where main introduces a prerequisite edit + feature commit and the release branch touches the same lines. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.7, 1M context) --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> * ci: reuse build.yml for nightly via ignore_transitive_version input Per review on apache#4734: instead of duplicating build.yml's dist-producing steps in the nightly workflow, parametrize build.yml with a new `ignore_transitive_version` input and have the nightly call it as a reusable workflow with that input flipped to false. PR builds keep the default (true). This guarantees PR and nightly runs go through identical code paths — the only difference between them is the value of one input. Changes: - build.yml: add `ignore_transitive_version: boolean = true` input. Replace each of the 6 hard-coded `--ignore-transitive-version` flags (frontend/amber/platform/python/agent-service license checks) with `${{ inputs.ignore_transitive_version && '--ignore-transitive-version' || '' }}`. The platform job's check previously didn't pass the flag at all (strict on PRs); this commit unifies it with the rest so all five ecosystems behave the same: relaxed on PRs, strict on nightly. - license-binary-nightly.yml: drop the per-ecosystem job copies. The workflow now has just two jobs: - build: `uses: ./.github/workflows/build.yml` with `ignore_transitive_version: false`, `secrets: inherit`. - report: walks the current run's jobs via listJobsForWorkflowRun, identifies license-check step failures (regex matches step names containing "license-binary" or "binary licenses"), and creates / updates / closes the tracking issue accordingly. Non-license step failures (flaky tests, network blips) are ignored so they don't spuriously surface as drift. The report step's six branches (drift+new, drift+existing, clean+existing, clean+nothing, non-license-failure-only, default-branch guard) were exercised end-to-end with stubbed github/context/core under Node before push. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * test(workflow-core): add unit test coverage for VFSURIFactory (apache#4757) ### What changes were proposed in this PR? Add `VFSURIFactorySpec` covering URI construction and decoding in `VFSURIFactory`: - `createResultURI` includes wid/eid/globalportid and the result resource type - Result URIs round-trip through `decodeURI` - `createRuntimeStatisticsURI` omits the `opid/` segment - `createConsoleMessagesURI` embeds the operator id and the `consoleMessages` resource type - `decodeURI` rejects non-vfs schemes, URIs missing required segments, and unknown resource-type tails ### Any related issues, documentation, discussions? Closes apache#4756 ### How was this PR tested? `sbt "WorkflowCore/testOnly org.apache.texera.amber.core.storage.VFSURIFactorySpec"` — 7/7 tests pass. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 4.7) --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> * ci: rename ignore_transitive_version input to mode (PR | release) Per review on apache#4734: replace the boolean input with a string "mode" so the call sites name *what* they are (PR-time relaxed vs. release-time strict) instead of *what flag they pass*. build.yml: inputs.mode: string, default "PR" "PR" -> --ignore-transitive-version (relaxed) "release" -> no flag (strict exact-match) The five license-check invocations now read ${{ inputs.mode == 'PR' && '--ignore-transitive-version' || '' }} so any value other than "PR" falls through to strict, which is the safer side. workflow_call inputs cannot enforce string enums; the valid values are documented inline. license-binary-nightly.yml: Pass `mode: release` instead of `ignore_transitive_version: false`. Updated the inline comment + tracking-issue body wording to match. required-checks.yml is unchanged: it doesn't pass this input, so PR builds keep the default ("PR") and behave exactly as before. Re-ran the three representative report scenarios (drift+new, clean+existing, non-license failure only) under Node with stubbed github/context/core; all three still behave correctly. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * ci(nightly): move schedule to 11:00 UTC (04:00 PDT / 03:00 PST) Per review on apache#4734: 07:00 UTC was midnight PDT, when many people are still working. Move to 11:00 UTC so it lands outside US-Pacific working hours. GitHub cron is fixed UTC; the local clock-time shifts by an hour at DST transitions. Daily cadence is fine for now; if it turns out to be too frequent we can drop to every 48–72 h. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> Co-authored-by: Yicong Huang <[email protected]> Co-authored-by: Xinyuan Lin <[email protected]>
bobbai00
added a commit
that referenced
this pull request
May 3, 2026
…ion diff (#4711) ### What changes were proposed in this PR? Fixes a latent bug in `bin/licensing/check_binary_deps.py` — the internal indexers used `dict[name, version]` (one version per name), so when the same name appeared with two different versions the second assignment silently overwrote the first. Concretely, particularly, this PR switches all three indexers to the same shape: ```python _index_npm : dict[str, set[str]] # name -> versions _index_python : dict[str, set[str]] # name -> versions _index_jar : dict[str, set[str]] # artifact -> versions ``` `diff_simple` / `diff_jars` are updated to emit per-version `added` / `stale` and per-name `drift` tuples shaped `(name, sorted_claimed, sorted_real)`. Multi-version drift renders as ``` ~ jetty-server: LICENSE-binary=9.4.20.v20190813, 11.0.20 bundled=9.4.20.v20190813, 11.0.21 ``` falling back to the existing single-version form when there's only one version on each side. As a side benefit, `added` / `stale` lines now include the version (this regressed in #4693 which printed bare names). This PR also adds several **unit tests** for the `check_license_binary` script. Wired into the `amber` job in `build.yml` right after Python setup (before any `check_binary_deps.py` invocation): ```yaml - name: Unit-test licensing scripts run: python3 -m unittest discover -s bin/licensing -p "test_*.py" -v ``` ### Any related issues, documentation, discussions? Follow-up to #4693 ### How was this PR tested? `python3 -m unittest discover -s bin/licensing -p "test_*.py" -v` runs 27 tests in 4ms, all passing. The new step in CI runs the same command on every PR that exercises the `amber` job. Manually verified end-to-end against the real combined LICENSE-binary built via `concat_license_binary.py`. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (claude-opus-4-7) --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Yicong-Huang
pushed a commit
that referenced
this pull request
May 3, 2026
…ion diff (#4711) ### What changes were proposed in this PR? Fixes a latent bug in `bin/licensing/check_binary_deps.py` — the internal indexers used `dict[name, version]` (one version per name), so when the same name appeared with two different versions the second assignment silently overwrote the first. Concretely, particularly, this PR switches all three indexers to the same shape: ```python _index_npm : dict[str, set[str]] # name -> versions _index_python : dict[str, set[str]] # name -> versions _index_jar : dict[str, set[str]] # artifact -> versions ``` `diff_simple` / `diff_jars` are updated to emit per-version `added` / `stale` and per-name `drift` tuples shaped `(name, sorted_claimed, sorted_real)`. Multi-version drift renders as ``` ~ jetty-server: LICENSE-binary=9.4.20.v20190813, 11.0.20 bundled=9.4.20.v20190813, 11.0.21 ``` falling back to the existing single-version form when there's only one version on each side. As a side benefit, `added` / `stale` lines now include the version (this regressed in #4693 which printed bare names). This PR also adds several **unit tests** for the `check_license_binary` script. Wired into the `amber` job in `build.yml` right after Python setup (before any `check_binary_deps.py` invocation): ```yaml - name: Unit-test licensing scripts run: python3 -m unittest discover -s bin/licensing -p "test_*.py" -v ``` ### Any related issues, documentation, discussions? Follow-up to #4693 ### How was this PR tested? `python3 -m unittest discover -s bin/licensing -p "test_*.py" -v` runs 27 tests in 4ms, all passing. The new step in CI runs the same command on every PR that exercises the `amber` job. Manually verified end-to-end against the real combined LICENSE-binary built via `concat_license_binary.py`. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (claude-opus-4-7) --------- (backported from commit 9ece88e) Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
bobbai00
added a commit
to bobbai00/texera
that referenced
this pull request
May 3, 2026
* ci: nightly strict license-binary check that files a tracking issue on drift Resolves apache#4692. PR builds run check_binary_deps.py with --ignore-transitive-version (apache#4693) so a benign upstream version bump on a transitive dep does not block merges. This workflow runs the same checks **without** that flag every night on `main` so transitive drift is still visible and actionable before each release. On non-zero exit it files (or updates) one tracking issue identified by the stable label `license-binary-drift`; on a clean run it closes the issue if one is open. Workflow shape: - frontend-npm | agent-npm | python | jar — one job per ecosystem, each rebuilds its dist exactly the way build.yml does and runs the strict check; failures don't fail the workflow (continue-on-error) so all four still run. - jar uses the unified check across every dist's lib/ rather than a per-service matrix; per-service placement errors are still caught by build.yml on every PR, and the nightly's job is exact-version drift which the unified check surfaces just as well. - report — aggregates per-ecosystem results from artifacts and creates / updates / closes the tracking issue via actions/github-script. Skips issue management when not on the default branch (so workflow_dispatch on feature branches still runs the checks but does not surface issues). Trigger: schedule (07:00 UTC daily) + workflow_dispatch. Permissions: issues:write for the report job. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * ci: reuse build.yml for nightly via ignore_transitive_version input Per review on apache#4734: instead of duplicating build.yml's dist-producing steps in the nightly workflow, parametrize build.yml with a new `ignore_transitive_version` input and have the nightly call it as a reusable workflow with that input flipped to false. PR builds keep the default (true). This guarantees PR and nightly runs go through identical code paths — the only difference between them is the value of one input. Changes: - build.yml: add `ignore_transitive_version: boolean = true` input. Replace each of the 6 hard-coded `--ignore-transitive-version` flags (frontend/amber/platform/python/agent-service license checks) with `${{ inputs.ignore_transitive_version && '--ignore-transitive-version' || '' }}`. The platform job's check previously didn't pass the flag at all (strict on PRs); this commit unifies it with the rest so all five ecosystems behave the same: relaxed on PRs, strict on nightly. - license-binary-nightly.yml: drop the per-ecosystem job copies. The workflow now has just two jobs: - build: `uses: ./.github/workflows/build.yml` with `ignore_transitive_version: false`, `secrets: inherit`. - report: walks the current run's jobs via listJobsForWorkflowRun, identifies license-check step failures (regex matches step names containing "license-binary" or "binary licenses"), and creates / updates / closes the tracking issue accordingly. Non-license step failures (flaky tests, network blips) are ignored so they don't spuriously surface as drift. The report step's six branches (drift+new, drift+existing, clean+existing, clean+nothing, non-license-failure-only, default-branch guard) were exercised end-to-end with stubbed github/context/core under Node before push. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * ci: rename ignore_transitive_version input to mode (PR | release) Per review on apache#4734: replace the boolean input with a string "mode" so the call sites name *what* they are (PR-time relaxed vs. release-time strict) instead of *what flag they pass*. build.yml: inputs.mode: string, default "PR" "PR" -> --ignore-transitive-version (relaxed) "release" -> no flag (strict exact-match) The five license-check invocations now read ${{ inputs.mode == 'PR' && '--ignore-transitive-version' || '' }} so any value other than "PR" falls through to strict, which is the safer side. workflow_call inputs cannot enforce string enums; the valid values are documented inline. license-binary-nightly.yml: Pass `mode: release` instead of `ignore_transitive_version: false`. Updated the inline comment + tracking-issue body wording to match. required-checks.yml is unchanged: it doesn't pass this input, so PR builds keep the default ("PR") and behave exactly as before. Re-ran the three representative report scenarios (drift+new, clean+existing, non-license failure only) under Node with stubbed github/context/core; all three still behave correctly. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * ci(nightly): move schedule to 11:00 UTC (04:00 PDT / 03:00 PST) Per review on apache#4734: 07:00 UTC was midnight PDT, when many people are still working. Move to 11:00 UTC so it lands outside US-Pacific working hours. GitHub cron is fixed UTC; the local clock-time shifts by an hour at DST transitions. Daily cadence is fine for now; if it turns out to be too frequent we can drop to every 48–72 h. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * ci: rename nightly workflow to License Binary Checker; add nightly mode Per review on apache#4734: - build.yml mode input now documents three values: PR (default, relaxed) | nightly (strict, scheduled checker) | release (strict, cutting an RC). Both `nightly` and `release` fall through to no flag — the existing conditional `inputs.mode == 'PR' && '...' || ''` already handles them correctly, only the doc needed updating. - Renamed license-binary-nightly.yml → license-binary-checker.yml (via git mv). Workflow `name:` now "License Binary Checker"; top-of- file comment + concurrency group updated to match. - Calls build.yml with `mode: nightly` (was `release`). - Stripped "(nightly)" from the issue title; reworded the body to say "scheduled job" instead of "nightly job"; the close-issue comment says "scheduled run". - Issue body now follows ISSUE_TEMPLATE/task-template.yaml's rendered shape: ### Task Summary, ### Task Type (with DevOps/CI box checked), Apache CoC footer. Added the `triage` label that the template applies by default, alongside the workflow's stable `license-binary-drift` and `ci`. - Made the github-token explicit on the github-script step (`secrets.GITHUB_TOKEN`) to match issue-triage.yml's convention; the issue creator will appear as `github-actions[bot]`. Workflow-level `permissions: { issues: write, actions: read }` is enough — no PAT needed. Re-ran the three representative report scenarios under Node with stubbed github/context/core; drift+new now files an issue with the templated body shape and triage label, clean+existing closes with the reworded comment, non-license failures stay no-ops. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
…PR builds (apache#4693) ### What changes were proposed in this PR? This PR relaxes the per-PR license-binary check so transitive-only version bumps no longer block unrelated PRs, while still enforcing the parts of the check that need legal review. Sub-task implementation for apache#4691; broader context in apache#4688. **Script (`bin/licensing/check_binary_deps.py`).** - New flag `--ignore-transitive-version`. Without it, behavior is unchanged (exact match). - Added direct-dependency loaders per ecosystem, reading the primary requirement files: - `python` → `amber/requirements.txt` (PEP 503 canonical names) - `npm` → `frontend/package.json` (`dependencies` + `devDependencies` + `peer*` + `optional*`) - `agent-npm` → `agent-service/package.json` - `jar` → every `*.sbt` and `Dependencies.scala` in the repo - Refactored the diff to surface four classes instead of just two: - `added` (new package not claimed) — **always fails** - `stale` (claimed but no longer bundled) — **always fails** - `drift_direct` (claimed direct dep, version changed) — **always fails** (a version bump can carry a license change) - `drift_transitive` (claimed transitive dep, version changed) — **fails by default; informational with `--ignore-transitive-version`** - For jars, the script bridges sbt-native-packager's `<groupId>.<artifactId>-<version>.jar` naming and SBT's bare artifactId by matching the trailing artifact segment after the last `.`, with Scala-version suffix stripping for `%%`/`%%%` libs. **CI (`.github/workflows/build.yml`).** - All four `check_binary_deps.py` invocations (frontend npm, jar, python, agent-npm) now pass `--ignore-transitive-version`. The exact-match check is preserved as the default and will be reused by the planned nightly job (sub-task apache#4692) so transitive drift remains visible and actionable on `main`. ### Any related issues, documentation, discussions? Resolves apache#4691. Sibling sub-task: apache#4692 (nightly exact-match job). Original report: apache#4688. ### How was this PR tested? End-to-end smoke tests run locally against the real combined LICENSE-binary built via `concat_license_binary.py` (113 python claims, 112 npm claims, 566 jar claims). For each ecosystem the four behavior modes were exercised by mutating a synthetic `pip-licenses.csv` / `3rdpartylicenses.json` / `lib/` directory: Verified on the CI job: https://github.com/apache/texera/actions/runs/25263088078/job/74073452760?pr=4693 <img width="1027" height="260" alt="Screenshot 2026-05-02 at 3 19 05 PM" src="https://github.com/user-attachments/assets/38bef6c0-9d1b-4869-baf7-5204a93313e7" /> ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (claude-opus-4-7) --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
yangzhang75
pushed a commit
to yangzhang75/texera
that referenced
this pull request
Jun 22, 2026
…ion diff (apache#4711) ### What changes were proposed in this PR? Fixes a latent bug in `bin/licensing/check_binary_deps.py` — the internal indexers used `dict[name, version]` (one version per name), so when the same name appeared with two different versions the second assignment silently overwrote the first. Concretely, particularly, this PR switches all three indexers to the same shape: ```python _index_npm : dict[str, set[str]] # name -> versions _index_python : dict[str, set[str]] # name -> versions _index_jar : dict[str, set[str]] # artifact -> versions ``` `diff_simple` / `diff_jars` are updated to emit per-version `added` / `stale` and per-name `drift` tuples shaped `(name, sorted_claimed, sorted_real)`. Multi-version drift renders as ``` ~ jetty-server: LICENSE-binary=9.4.20.v20190813, 11.0.20 bundled=9.4.20.v20190813, 11.0.21 ``` falling back to the existing single-version form when there's only one version on each side. As a side benefit, `added` / `stale` lines now include the version (this regressed in apache#4693 which printed bare names). This PR also adds several **unit tests** for the `check_license_binary` script. Wired into the `amber` job in `build.yml` right after Python setup (before any `check_binary_deps.py` invocation): ```yaml - name: Unit-test licensing scripts run: python3 -m unittest discover -s bin/licensing -p "test_*.py" -v ``` ### Any related issues, documentation, discussions? Follow-up to apache#4693 ### How was this PR tested? `python3 -m unittest discover -s bin/licensing -p "test_*.py" -v` runs 27 tests in 4ms, all passing. The new step in CI runs the same command on every PR that exercises the `amber` job. Manually verified end-to-end against the real combined LICENSE-binary built via `concat_license_binary.py`. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (claude-opus-4-7) --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
This was referenced Nov 24, 2026
renovate-bot
pushed a commit
to renovate-bot/apache-_-texera
that referenced
this pull request
Nov 25, 2026
) ### What changes were proposed in this PR? Remove unused imports, bindings, helpers and fields, and settings that repeat a default or another entry, from the Amber Python runtime, the Python test resources of the workflow compiler and operators, the `bin/` licensing, local-dev and observability scripts, repository configuration, and three GitHub workflows (**+102/-172 lines**). There is no behavior change. - **Amber Python runtime:** `StatisticsManager` uses `defaultdict` instead of the deprecated `typing.DefaultDict`, and `BroadcastPartitioner` builds its batch with `[]`. `LargeBinaryOutputStream` raises and documents `OSError` (which `IOError` aliases), wraps its best-effort cleanup delete in `contextlib.suppress`, and drops the `pass` after `flush`'s docstring. - **Operator verification test resources:** `py_op_driver.py` drops ten `pytexera` imports and `RAW_TYPE_MAPPING` that it never reads. User code runs in its own namespace seeded by `from pytexera import *`, so the "used dynamically" note on those imports did not hold. `compare.py` drops the uncalled `_string_columns` helper and two dict copies of `double_kinds_a`/`double_kinds_e`, and `hf_parse_probe.py` drops unused `io` and `re` imports. Quoted annotations, `open(..., "r")`, `startswith` plus a slice, and a placeholder-free f-string take their plain forms here and in `standalone_worker.py`, `py_compile_worker.py` and `hf_binary_value_probe.py`. - **`bin/` scripts:** the licensing tools use a tuple `startswith`, read the one regex group they need instead of unpacking all four, print plain strings where f-strings had no placeholders, return a `bool` expression directly, drop annotation quotes under `from __future__ import annotations`, use `removesuffix`, and name unused loop values `_`. Two licensing tests drop `# noqa: E402` comments that suppress nothing under Ruff, and `test_local_dev_tui.py` drops the never-passed `version` parameter of `_seed_jvm_layout` together with the docstring sentence about a jar it never wrote. `bin/observability/smoke_test.py` stops returning an unread status from `_post`, builds the trace id from one `uuid4().hex` (the first 32 hex digits of two concatenated ones were always the first), and drops a `leaked = False` that both branches of the following `try` overwrite. - **Repository configuration:** `amber/pyproject.toml` drops `line-length = 88` and `max-complexity = 10`, which are Ruff's defaults (and `C901` is not selected). `.dockerignore` drops a root `user-resources/` entry that its first rule, `**/user-resources/`, already covers. `bin/fix-format.sh` drops the `""` case that `TARGET="${1:-all}"` makes unreachable, and `bin/frontend-proto-gen.sh` drops a `--proto_path` that repeats its `-I`. `bin/k8s/templates/aws/.gitkeep` goes, since the folder holds `s3-credentials-secret.yaml`. `bin/y-websocket-server/package.json` drops npm-init's `main` and placeholder `test` script (the image runs `npx y-websocket`), and a `bin/observability/docker-compose.yml` comment stops pointing at a `start_app.sh` that the repository does not have. - **GitHub workflows:** `comment-commands.yml` drops `github.event_name == 'issue_comment' && github.event.action == 'created'` from three job conditions, because the workflow only runs on `issue_comment: [created]`. `pr-assignment.yml` drops a `|| ''` that follows a `typeof ... === 'string'` guard. `benchmarks-pr-comment.yml` stops storing per-benchmark commit and date, a sample count and delta labels that nothing reads, takes each row's status from the deltas it already computed instead of a second `deltaInfo` pass, reuses each metric's 7-day delta, and builds the PR-only CSV table only when there is no comparison to show. | Event | PR / Commit | | --- | --- | | Introduced by | Amber Python runtime: apache#1891 (2023-05-01), apache#3262 (2025-02-18), apache#4100 (2025-12-15), apache#4707 (2026-05-03), apache#5249 (2026-06-06), apache#8260 (2026-11-18); test resources: apache#7207 (2026-08-14), apache#8617 (2026-10-15), apache#9306 (2026-11-10), apache#8357 (2026-11-17), apache#8358 (2026-11-18), apache#8359 (2026-11-19); `bin/` scripts: apache#4387 (2026-04-29), apache#4668 (2026-05-02), apache#4693 (2026-05-02), apache#4711 (2026-05-03), apache#5057 (2026-05-15), apache#5417 (2026-06-10), apache#5961 (2026-06-28), apache#5377 (2026-10-28); configuration: apache#3019 (2024-11-20), apache#3335 (2025-03-23), apache#3441 (2025-05-19), apache#3890 (2025-10-14), apache#4005 (2025-10-29), apache#4105 (2025-12-05), apache#5757 (2026-06-24); workflows: apache#4885 (2026-05-03), apache#4986 (2026-05-08), apache#5148 (2026-05-22), apache#5557 (2026-06-11), apache#5639 (2026-06-12) | | Usage removed by | `issue_comment` checks: apache#4899 (2026-05-04, `ci: drop the triage label, use is:open no:assignee filter`) moved `/take` out of `issue-triage.yml`, which also ran on `issues` events, into a workflow that only runs on created comments, and apache#4986 and apache#5148 copied the checks into two new jobs; `aws/.gitkeep`: apache#5932 (2026-07-01, `feat(k8s): make app-tier object storage configurable via storage.s3`) added the folder's first template; PR-only CSV table: apache#5639 (2026-06-12, `ci: compare benchmark PRs with main`) shows it only when there is no comparison; everything else: unused or redundant since introduction | As of 2026-11-23, the unread test-resource code is under a week old, the `.gitkeep` placeholder and the unread benchmark fields have been redundant for about 5 months, the `issue_comment` checks for over 6 months, and the duplicate `.dockerignore` entry and `--proto_path` for 20 and 24 months. ### Any related issues, documentation, discussions? Closes apache#9676. ### How was this PR tested? Ran on `525f8ce3fb` and on `main` at `89a492f97e` (Windows 11, Python 3.12 with CI's pinned `ruff` 0.14.7, `pytest` 9.0.3 and `textual` 8.2.8, JDK 17): ```bash cd amber ruff check src/main/python src/test/python ruff format --check src/main/python src/test/python pytest -m "not integration" cd .. ruff check $(git diff --name-only origin/main -- '*.py' ':!amber/') python -m pytest bin/ -v --tb=short sbt "WorkflowCompilingService/testOnly org.apache.texera.amber.translator.verify.ComparatorSpec org.apache.texera.amber.translator.verify.HarnessSpec org.apache.texera.amber.translator.verify.PyOpExecHarnessSpec org.apache.texera.amber.translator.verify.VisualizationJsonComparatorSpec" sbt "WorkflowOperator/testOnly org.apache.texera.amber.operator.huggingFace.codegen.HuggingFaceBinaryValueBehaviorSpec org.apache.texera.amber.operator.huggingFace.codegen.HuggingFaceParseBehaviorSpec org.apache.texera.amber.util.PythonCodeRawInvalidTextSpec" ``` - Ruff: passed on `amber/` (218 files already formatted) and on the 14 changed Python files outside `amber/`. - `pytest -m "not integration"` in `amber/` (JUnit XML): each of the 1,524 tests has the same outcome as on `main`: 1,496 passed, 10 skipped, and the same 18 platform-dependent tests (Iceberg catalog on PostgreSQL and `s3fs`, time zones, object reprs) fail on this Windows machine on both. - `python -m pytest bin/` (JUnit XML): each of the 196 tests has the same outcome as on `main`: 186 passed, and nine `bin/mounter` tests plus `test_stamp_dir_for_matches_shell_sha1`, which assume POSIX paths and shells, fail on Windows on both. - sbt (JUnit XML, `UDF_PYTHON_PATH` set to Python 3.12 because Windows has no `python3`): these seven suites load the edited test resources. `WorkflowCompilingService` passed 52 of 52 in 4 suites and `WorkflowOperator` 11 of 11 in 3 suites, with 0 canceled, the same as on `main`. - Licensing scripts: `concat_license_binary.py` writes byte-identical combined licenses for the Python and frontend images, and `check_binary_deps.py jar` prints byte-identical reports and exit codes for a synthetic lib folder with missing, extra and version-mismatched jars, with and without `--ignore-transitive-version`. - Workflows: the three edited workflows run only from the default branch (`issue_comment`, `pull_request_target` and `workflow_run`), so this PR's CI cannot run them. Each edited `github-script` body ran before and after under Node with recording stubs for `github`, `core`, `fs` and `fetch`, over 496 fixtures (missing or malformed CSV and baseline data, failed API calls, body edits with and without closing references). Every API call, comment body and log line is identical, and a one-line change to each script does show up in its traces. The `comment-commands.yml` conditions differ from `main` only by the two removed checks. - `bash -n` passes on `bin/fix-format.sh` and `bin/frontend-proto-gen.sh`, and the edited YAML, TOML and JSON files parse. - After review, `f84888ca6c` changes only three docstrings in `large_binary_output_stream.py` and inlines one local in `py_op_driver.py`. On it, Ruff passes as above, each of the 1,524 `amber` tests again has the same outcome as on `main`, the four `WorkflowCompilingService` suites pass 52 of 52, and `_jsonify` returns the same strings as on `525f8ce3fb` for seven `BINARY` inputs, with and without the pickle marker. ### Was this PR authored or co-authored using generative AI tooling? Generated-by: Claude Code (Claude Opus 5.5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
This PR relaxes the per-PR license-binary check so transitive-only version bumps no longer block unrelated PRs, while still enforcing the parts of the check that need legal review. Sub-task implementation for #4691; broader context in #4688.
Script (
bin/licensing/check_binary_deps.py).--ignore-transitive-version. Without it, behavior is unchanged (exact match).python→amber/requirements.txt(PEP 503 canonical names)npm→frontend/package.json(dependencies+devDependencies+peer*+optional*)agent-npm→agent-service/package.jsonjar→ every*.sbtandDependencies.scalain the repoadded(new package not claimed) — always failsstale(claimed but no longer bundled) — always failsdrift_direct(claimed direct dep, version changed) — always fails (a version bump can carry a license change)drift_transitive(claimed transitive dep, version changed) — fails by default; informational with--ignore-transitive-version<groupId>.<artifactId>-<version>.jarnaming and SBT's bare artifactId by matching the trailing artifact segment after the last., with Scala-version suffix stripping for%%/%%%libs.CI (
.github/workflows/build.yml).check_binary_deps.pyinvocations (frontend npm, jar, python, agent-npm) now pass--ignore-transitive-version.The exact-match check is preserved as the default and will be reused by the planned nightly job (sub-task #4692) so transitive drift remains visible and actionable on
main.Any related issues, documentation, discussions?
Resolves #4691. Sibling sub-task: #4692 (nightly exact-match job). Original report: #4688.
How was this PR tested?
End-to-end smoke tests run locally against the real combined LICENSE-binary built via
concat_license_binary.py(113 python claims, 112 npm claims, 566 jar claims). For each ecosystem the four behavior modes were exercised by mutating a syntheticpip-licenses.csv/3rdpartylicenses.json/lib/directory:Verified on the CI job: https://github.com/apache/texera/actions/runs/25263088078/job/74073452760?pr=4693
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (claude-opus-4-7)