Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flyteagent] Add Output Prefix to GetTaskRequest #6265

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Future-Outlier
Copy link
Member

@Future-Outlier Future-Outlier commented Feb 21, 2025

Tracking issue

#3936

Why are the changes needed?

What changes were proposed in this pull request?

How was this patch tested?

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Summary by Bito

This PR introduces a new output_prefix field to the GetTaskRequest message in the Flyte agent protocol, enabling specification of task output data locations. The implementation spans multiple language implementations including TypeScript, Go, Python, and Rust, with corresponding protobuf definition updates. The changes enhance task output handling by allowing clients to define output destinations through the new field.

Unit tests added: False

Estimated effort to review (1-5, lower is better): 3

@flyte-bot
Copy link
Collaborator

flyte-bot commented Feb 21, 2025

Code Review Agent Run #89414c

Actionable Suggestions - 2
  • flyteidl/gen/pb-js/flyteidl.js - 1
  • flyteidl/gen/pb-js/flyteidl.d.ts - 1
Review Details
  • Files reviewed - 9 · Commit Range: d86225a..d86225a
    • flyteidl/gen/pb-es/flyteidl/admin/agent_pb.ts
    • flyteidl/gen/pb-go/flyteidl/admin/agent.pb.go
    • flyteidl/gen/pb-js/flyteidl.d.ts
    • flyteidl/gen/pb-js/flyteidl.js
    • flyteidl/gen/pb_python/flyteidl/admin/agent_pb2.py
    • flyteidl/gen/pb_python/flyteidl/admin/agent_pb2.pyi
    • flyteidl/gen/pb_rust/flyteidl.admin.rs
    • flyteidl/protos/flyteidl/admin/agent.proto
    • flyteplugins/go/tasks/plugins/webapi/agent/plugin.go
  • Files skipped - 1
    • flyteidl/gen/pb-go/gateway/flyteidl/service/agent.swagger.json - Reason: Filter setting
  • Tools
    • Golangci-lint (Linter) - ✖︎ Failed
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

AI Code Review powered by Bito Logo

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 36.86%. Comparing base (03b96e8) to head (d86225a).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
flyteidl/gen/pb-go/flyteidl/admin/agent.pb.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6265      +/-   ##
==========================================
- Coverage   36.86%   36.86%   -0.01%     
==========================================
  Files        1318     1318              
  Lines      134767   134788      +21     
==========================================
+ Hits        49685    49686       +1     
- Misses      80752    80770      +18     
- Partials     4330     4332       +2     
Flag Coverage Δ
unittests-datacatalog 51.58% <ø> (ø)
unittests-flyteadmin 51.87% <ø> (ø)
unittests-flytecopilot 30.99% <ø> (ø)
unittests-flytectl 62.29% <ø> (ø)
unittests-flyteidl 7.22% <0.00%> (-0.01%) ⬇️
unittests-flyteplugins 53.99% <100.00%> (-0.05%) ⬇️
unittests-flytepropeller 42.78% <ø> (ø)
unittests-flytestdlib 55.35% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@flyte-bot
Copy link
Collaborator

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Feature Improvement - Add Output Prefix Field to GetTaskRequest

agent_pb2.py - Updated protobuf serialization with output_prefix field

agent_pb2.pyi - Added output_prefix field to GetTaskRequest type definitions

flyteidl.admin.rs - Added output_prefix field to GetTaskRequest struct in Rust

agent.proto - Added output_prefix field to GetTaskRequest message definition

plugin.go - Updated plugin to set output_prefix in GetTaskRequest

agent.pb.go - Updated protobuf definitions and added new fields for task management

flyteidl.d.ts - Added TypeScript definitions for outputPrefix field in GetTaskRequest

flyteidl.js - Added JavaScript implementation for outputPrefix field in GetTaskRequest

agent_pb.ts - Added output_prefix field to GetTaskRequest class with TypeScript definitions

* @memberof flyteidl.admin.GetTaskRequest
* @instance
*/
GetTaskRequest.prototype.outputPrefix = "";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider null initialization for nullable property

Consider initializing outputPrefix with null instead of an empty string since the property is defined as nullable in the JSDoc comment. This would make the implementation consistent with the type definition.

Code suggestion
Check the AI-generated fix before applying
Suggested change
GetTaskRequest.prototype.outputPrefix = "";
GetTaskRequest.prototype.outputPrefix = null;

Code Review Run #89414c


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Comment on lines +10064 to +10065
/** GetTaskRequest outputPrefix */
outputPrefix?: (string|null);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making outputPrefix property required

Consider making the outputPrefix property required in IGetTaskRequest interface since it appears to be non-optional in the class implementation. The interface shows it as optional with ? but the class property is defined without optional modifier.

Code suggestion
Check the AI-generated fix before applying
Suggested change
/** GetTaskRequest outputPrefix */
outputPrefix?: (string|null);
/** GetTaskRequest outputPrefix */
outputPrefix: string;

Code Review Run #89414c


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants