-
Notifications
You must be signed in to change notification settings - Fork 64
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
Only apply cache result progress if resulted in diff #778
Conversation
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.
Looks good, just one question
return execResult, nil, errors.Wrap(err, "getting changed files in step") | ||
// If the previous steps made any modifications in the workspace yet, | ||
// apply them. | ||
if opts.task.CachedResult.Diff != "" { |
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.
Are there existing tests to cover when CachedResult.Diff
is blank and not blank?
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.
Another PR just found this bug, and it has a test for it so will merge this and then in the next PR you'll get that test :)
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.
Wow we were REALLY swallowing that error in volume mode, huh? 😬 Thanks for pulling it back out, and fixing the error itself haha.
This was reported by a user, we store execution step results in the cache also when no diff was generated (rightfully), but then we should only apply the patch when there is actually anything to do. Also, I initially couldn't reproduce this locally because we swallowed this error in volume mode. It would only happen in bind mode.
dedd19b
to
cfc2e91
Compare
This was reported by a user, we store execution step results in the cache also when no diff was generated (rightfully), but then we should only apply the patch when there is actually anything to do. Also, I initially couldn't reproduce this locally because we swallowed this error in volume mode. It would only happen in bind mode.
A user reported this, we store execution step results in the cache also when no diff was generated (rightfully), but then we should only apply the patch when there is actually anything to do.
Also, I initially couldn't reproduce this locally because we swallowed this error in volume mode. It would only happen in bind mode.
Closes #755
Test plan
Verified this does properly fail in volume mode now, too and don't fail anymore at all.