You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "Ma77Ball (via GitHub)" <gi...@apache.org> on 2026/10/10 18:33:11 UTC

[PR] refactor(frontend): extract HuggingFace field bindings into a helper [texera]

Ma77Ball opened a new pull request, #8946:
URL: https://github.com/apache/texera/pull/8946

   ### What changes were proposed in this PR?
   - Extracted the ~185-line HuggingFace-specific field block out of `operator-property-edit-frame.component.ts` into a pure helper `applyHuggingFaceFieldBindings(field)` in `workspace/util/hugging-face-field-bindings.ts`, beside the existing `custom-formly-type.ts` that owns the sibling "which widget a field renders as" concern.
   - The component now calls the helper under a single `operatorType === "HuggingFace"` guard; the helper reproduces both original guards (`key === "task"` hide, then the string-key gate), so the task lists, `hide` expressions, required-validators, and `validation.show` flags are byte-identical to before.
   - Added `hugging-face-field-bindings.spec.ts` with direct unit tests for the hide/validator logic per task (image/audio inputs and their columns, prompt column, text-generation-only controls, context, candidate labels, sentences), coverage that was impossible while the logic was inline.
   ### Any related issues, documentation, discussions?
   Closes: #8944
   ### How was this PR tested?
   - Run `cd frontend && npx ng test --include='**/hugging-face-field-bindings.spec.ts'`, expect 15 tests to pass.
   - Run `cd frontend && npx ng test --include='**/operator-property-edit-frame.component.spec.ts'`, expect the existing suite to pass unchanged (262 pass, 1 pre-existing skip).
   - In the workflow editor, add a HuggingFace operator and change its Task: confirm the image upload / input image column appear only for image tasks, the audio upload / input audio column only for audio tasks, the prompt column hides for image-only and audio tasks, systemPrompt/maxNewTokens/temperature show only for text-generation, and the required-field validators still block running when a needed input is empty.
   ### Was this PR authored or co-authored using generative AI tooling?
   Co-authored with Claude Opus 4.8 in compliance with ASF
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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] refactor(frontend): extract HuggingFace field bindings into a helper [texera]

Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #8946:
URL: https://github.com/apache/texera/pull/8946


-- 
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] refactor(frontend): extract HuggingFace field bindings into a helper [texera]

Posted by "Ma77Ball (via GitHub)" <gi...@apache.org>.
Ma77Ball commented on PR #8946:
URL: https://github.com/apache/texera/pull/8946#issuecomment-6112123225

   /request-review @aicam @mengw15 
   


-- 
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] refactor(frontend): extract HuggingFace field bindings into a helper [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8946:
URL: https://github.com/apache/texera/pull/8946#issuecomment-6100837852

   <!-- 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:** `@kz930`
     You can notify them by mentioning `@kz930` 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] refactor(frontend): extract HuggingFace field bindings into a helper [texera]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #8946:
URL: https://github.com/apache/texera/pull/8946#issuecomment-6100891466

   ## [Codecov](https://app.codecov.io/gh/apache/texera/pull/8946?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 92.58%. Comparing base ([`2cd44ee`](https://app.codecov.io/gh/apache/texera/commit/2cd44ee0d8219a7cc0f16e8c4ee869c0bad9feec?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`1076554`](https://app.codecov.io/gh/apache/texera/commit/1076554fbc541ff804678e2fe91d1fd5749b9939?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 17 commits behind head on main.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##               main    #8946      +/-   ##
   ============================================
   - Coverage     92.59%   92.58%   -0.02%     
     Complexity     5043     5043              
   ============================================
     Files          1252     1255       +3     
     Lines         53583    53541      -42     
     Branches       6672     6671       -1     
   ============================================
   - Hits          49617    49571      -46     
   - Misses         2319     2321       +2     
   - Partials       1647     1649       +2     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/texera/pull/8946/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/8946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `77.38% <ø> (ø)` | | Carriedforward from [2cd44ee](https://app.codecov.io/gh/apache/texera/commit/2cd44ee0d8219a7cc0f16e8c4ee869c0bad9feec?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [agent-service](https://app.codecov.io/gh/apache/texera/pull/8946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `99.16% <ø> (ø)` | | Carriedforward from [2cd44ee](https://app.codecov.io/gh/apache/texera/commit/2cd44ee0d8219a7cc0f16e8c4ee869c0bad9feec?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/8946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `88.07% <ø> (ø)` | | Carriedforward from [2cd44ee](https://app.codecov.io/gh/apache/texera/commit/2cd44ee0d8219a7cc0f16e8c4ee869c0bad9feec?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/8946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `60.41% <ø> (ø)` | | Carriedforward from [2cd44ee](https://app.codecov.io/gh/apache/texera/commit/2cd44ee0d8219a7cc0f16e8c4ee869c0bad9feec?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/8946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `87.37% <ø> (ø)` | | Carriedforward from [2cd44ee](https://app.codecov.io/gh/apache/texera/commit/2cd44ee0d8219a7cc0f16e8c4ee869c0bad9feec?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/8946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `81.53% <ø> (ø)` | | Carriedforward from [2cd44ee](https://app.codecov.io/gh/apache/texera/commit/2cd44ee0d8219a7cc0f16e8c4ee869c0bad9feec?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/8946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `96.57% <100.00%> (-0.03%)` | :arrow_down: | |
   | [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/8946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `83.73% <ø> (ø)` | | Carriedforward from [2cd44ee](https://app.codecov.io/gh/apache/texera/commit/2cd44ee0d8219a7cc0f16e8c4ee869c0bad9feec?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/8946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `98.58% <ø> (ø)` | | Carriedforward from [2cd44ee](https://app.codecov.io/gh/apache/texera/commit/2cd44ee0d8219a7cc0f16e8c4ee869c0bad9feec?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/8946/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `74.09% <ø> (ø)` | | Carriedforward from [2cd44ee](https://app.codecov.io/gh/apache/texera/commit/2cd44ee0d8219a7cc0f16e8c4ee869c0bad9feec?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/8946?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