ci: fix unit test#6418
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates Go to version 1.26.1, upgrades multiple dependencies, refactors string builder operations to use fmt.Fprintf, and introduces a state rollback mechanism in createreleasepr.go when library release preparation, building, or testing fails. It also adds logic to ignore skipped checks when waiting for pull request readiness. However, the code review points out a critical issue: while the library state is restored in memory upon failure, the rollback is never persisted to disk because savePipelineState is not called, which could leave incorrect state on disk.
I am having trouble creating individual review comments. Click here to see my feedback.
internal/librarian/createreleasepr.go (276)
When a library release preparation fails, the in-memory state is restored to originalLib, but this rollback is never persisted to disk because savePipelineState(state) is not called. If this is the last library or the only library being processed, the incorrect/modified state will remain on disk.
Please save the pipeline state after restoring the original library state.
libraries[i] = originalLib
if err := savePipelineState(state); err != nil {
return nil, err
}internal/librarian/createreleasepr.go (285)
When the library build fails, the in-memory state is restored to originalLib, but this rollback is never persisted to disk because savePipelineState(state) is not called. If this is the last library or the only library being processed, the incorrect/modified state will remain on disk.
Please save the pipeline state after restoring the original library state.
libraries[i] = originalLib
if err := savePipelineState(state); err != nil {
return nil, err
}internal/librarian/createreleasepr.go (296)
When the library integration tests fail, the in-memory state is restored to originalLib, but this rollback is never persisted to disk because savePipelineState(state) is not called. If this is the last library or the only library being processed, the incorrect/modified state will remain on disk.
Please save the pipeline state after restoring the original library state.
libraries[i] = originalLib
if err := savePipelineState(state); err != nil {
return nil, err
}
Update dependencies and fix unit test CI.
Fixes #6388