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

[feature] Added hook to track task output size #442

Merged
merged 5 commits into from
Jan 21, 2024
Merged

Conversation

KCarretto
Copy link
Collaborator

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds a new field to Task, "output_size", which stores the size of the task's output. It adds a new schema hook to maintain this value any time tasks are updated with new output. This will effectively serve as a "has_output" check as well by filtering for tasks with size > 0. Ideally this implementation would also allow API callers to filter out large task outputs etc. if desired.

Which issue(s) this PR fixes:

Fixes #427

Copy link

codecov bot commented Jan 19, 2024

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (6c77394) 71.46% compared to head (63d805b) 71.43%.

Files Patch % Lines
tavern/internal/ent/schema/task.go 63.33% 10 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #442      +/-   ##
==========================================
- Coverage   71.46%   71.43%   -0.03%     
==========================================
  Files         115      115              
  Lines        8835     8865      +30     
==========================================
+ Hits         6314     6333      +19     
- Misses       2412     2422      +10     
- Partials      109      110       +1     

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

Copy link
Collaborator

@cmp5987 cmp5987 left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, happy to have this feature :)

side note: it would be a nice addition to have this mocked in test data

@KCarretto
Copy link
Collaborator Author

side note: it would be a nice addition to have this mocked in test data

It will be available on all tasks (automatically derived) 😄

@KCarretto KCarretto merged commit e59b69b into main Jan 21, 2024
6 checks passed
@KCarretto KCarretto deleted the task-output-size branch January 21, 2024 05:49
KCarretto added a commit that referenced this pull request Feb 1, 2024
 
[feature] Added hook to track task output size (#442)

* added hook to track task output size

* Rename order field to OUTPUT_SIZE
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.

Add a Boolean for has output to improve front end loading
2 participants