Conversation
The GoModFile code path in generateSetupStep was hardcoding 'cache: false' independently, while the non-GoModFile path was already using the runtime.ExtraWithFields merge to apply the same setting (added in #19865). Unify both paths to use the same ExtraWithFields merge logic, so the GoModFile path consistently picks up all runtime-level 'with' fields rather than only user-specified ExtraFields. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR simplifies recently modified code from #19865 to improve consistency and maintainability while preserving all functionality.
Files Simplified
pkg/workflow/runtime_step_generator.go— unified the Gogo-mod-filecode path to useExtraWithFieldsmerge, same as the standard version pathImprovements Made
Removed inconsistency introduced alongside #19865
PR #19865 added
cache: falsetoruntime.ExtraWithFieldsfor the Go runtime definition — the correct, data-driven way to configure this. However,generateSetupStepstill had a separate code path for theGoModFilecase that hardcodedcache: falseas a literal string with an inline comment, while only mergingreq.ExtraFields(user fields), notruntime.ExtraWithFields(runtime-level defaults).This created two inconsistencies:
cache: falsewas produced by a hardcoded string in one path, and byExtraWithFieldsin the otherruntime.ExtraWithFieldsfor Go would be silently skipped in the GoModFile pathFix: removed the hardcoded
cache: falseline and replaced it with the samemaps.Copy(allExtraFields, runtime.ExtraWithFields)merge pattern already used in the standard path.Changes Based On
Recent changes from:
Testing
go test -run "TestGenerateRuntime" ./pkg/workflow/)make build)make fmt)cache: falsestill present viaExtraWithFields)Review Focus
Please verify:
cache: false(now sourced fromruntime.ExtraWithFieldsinstead of hardcoded)ExtraWithFieldswill now be automatically applied in both code pathsAutomated by Code Simplifier Agent — analyzing code from the last 24 hours