-
Notifications
You must be signed in to change notification settings - Fork 378
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
split the result filed to metadata and inspect #3043
split the result filed to metadata and inspect #3043
Conversation
9937bd7
to
f52119f
Compare
Codecov Report
@@ Coverage Diff @@
## master #3043 +/- ##
==========================================
+ Coverage 17.37% 17.40% +0.02%
==========================================
Files 1361 1361
Lines 140447 140449 +2
==========================================
+ Hits 24401 24441 +40
+ Misses 113500 113474 -26
+ Partials 2546 2534 -12
|
817c577
to
0d670f0
Compare
3e321a9
to
549a654
Compare
@@ -0,0 +1 @@ | |||
ALTER TABLE `pipeline_tasks` ADD COLUMN `inspect` text COMMENT 'task的调度信息' AFTER `result`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mediumtext
@@ -62,6 +62,7 @@ type TaskContainer struct { | |||
ContainerID string `json:"containerID"` | |||
} | |||
|
|||
// PipelineTaskResult spec.pipeline task only use metadata, task dto has all fields | |||
type PipelineTaskResult struct { | |||
Metadata Metadata `json:"metadata,omitempty"` | |||
Errors []*PipelineTaskErrResponse `json:"errors,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use embed struct
@@ -195,7 +203,7 @@ func (o orderedResponses) Len() int { return len(o) } | |||
func (o orderedResponses) Less(i, j int) bool { return o[i].Ctx.EndTime.Before(o[j].Ctx.EndTime) } | |||
func (o orderedResponses) Swap(i, j int) { o[i], o[j] = o[j], o[i] } | |||
|
|||
func (t *PipelineTaskResult) AppendError(newResponses ...*PipelineTaskErrResponse) []*PipelineTaskErrResponse { | |||
func (t *PipelineTaskInspect) AppendError(newResponses ...*PipelineTaskErrResponse) []*PipelineTaskErrResponse { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use result is still ok
meta := latestTask.Result.Metadata | ||
var meta apistructs.Metadata | ||
if latestTask.Result != nil { | ||
meta = (*latestTask.Result).Metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a function for spec.task to get metadata.
judge nil
each time is bad.
549a654
to
57a87aa
Compare
57a87aa
to
f1c18b8
Compare
What type of this PR
Add one of the following kinds:
/kind bugfix
What this PR does / why we need it:
split the result filed to metadata and inspect, update metadata only when task callback
Which issue(s) this PR fixes:
Specified Reviewers:
/assign @your-reviewer
ChangeLog
Need cherry-pick to release versions?
Add comment like
/cherry-pick release/1.0
when this PR is merged.