-
Notifications
You must be signed in to change notification settings - Fork 696
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
Remove Deck URI when OutputReader
is nil
#6223
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -92,23 +92,25 @@ | |||||
} | ||||||
|
||||||
func (p *pluginRequestedTransition) RemoveDeckURIIfDeckNotExists(ctx context.Context, tCtx *taskExecutionContext) error { | ||||||
// If there's no output info, nothing to do. | ||||||
if p.execInfo.OutputInfo == nil { | ||||||
return nil | ||||||
} | ||||||
|
||||||
reader := tCtx.ow.GetReader() | ||||||
if reader == nil { | ||||||
p.execInfo.OutputInfo.DeckURI = nil | ||||||
return nil | ||||||
} | ||||||
|
||||||
exists, err := reader.DeckExists(ctx) | ||||||
if err != nil { | ||||||
if p.execInfo.OutputInfo != nil { | ||||||
p.execInfo.OutputInfo.DeckURI = nil | ||||||
} | ||||||
return regErrors.Wrapf(err, "failed to check existence of deck file") | ||||||
} | ||||||
|
||||||
if !exists && p.execInfo.OutputInfo != nil { | ||||||
if err != nil || !exists { | ||||||
p.execInfo.OutputInfo.DeckURI = nil | ||||||
} | ||||||
|
||||||
if err != nil { | ||||||
return regErrors.Wrapf(err, "failed to check existence of deck file") | ||||||
} | ||||||
return nil | ||||||
} | ||||||
|
||||||
|
@@ -775,7 +777,7 @@ | |||||
return pluginTrns.FinalTransition(ctx) | ||||||
} | ||||||
|
||||||
func (t *Handler) ValidateOutput(ctx context.Context, nodeID v1alpha1.NodeID, i io.InputReader, | ||||||
func (t Handler) ValidateOutput(ctx context.Context, nodeID v1alpha1.NodeID, i io.InputReader, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider keeping pointer receiver for consistency
Consider keeping the pointer receiver Code suggestionCheck the AI-generated fix before applying
Suggested change
Code Review Run #54fd06 Is this a valid issue, or was it incorrectly flagged by the Agent?
|
||||||
r io.OutputReader, outputCommitter io.OutputWriter, executionConfig v1alpha1.ExecutionConfig, | ||||||
tr ioutils.SimpleTaskReader) (*io.ExecutionError, error) { | ||||||
|
||||||
|
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.
Consider separating error handling from existence check to improve code clarity. The current combined condition
if err != nil || !exists {
makes the error handling less explicit.Code suggestion
Code Review Run #54fd06
Is this a valid issue, or was it incorrectly flagged by the Agent?