fix: build command error and incorrect rule stub#1368
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v1.17.x #1368 +/- ##
========================================
Coverage 68.66% 68.66%
========================================
Files 281 281
Lines 17696 17698 +2
========================================
+ Hits 12151 12153 +2
Misses 5043 5043
Partials 502 502 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Greptile Overview
Greptile Summary
This PR fixes two critical issues: a build command error and incorrect validation stub signatures.
Build Command Fix (
console/console/build_command.go)ldflagssyntax that was missing proper quoting-s -wflags to strip debug information and reduce binary size-ldflags -extldflags -staticto-ldflags "-s -w -extldflags -static"Validation Stub Fix (
validation/console/stubs.go)RuleandFilterstub templates to match updated interface contractscontext.Contextparameter toPasses()andMessage()methods in Rule stubcontext.Contextparameter toHandle()method in Filter stubcontextimports to both stubscontracts/validationinterfacesTests Updated (
console/console/build_command_test.go)Confidence Score: 5/5
Important Files Changed
-s -w) for smaller binariescontext.Contextparameter to Rule and Filter stubs to match interface contractsSequence Diagram
sequenceDiagram participant User participant BuildCommand participant generateCommand participant Process participant GoCompiler User->>BuildCommand: Execute build command with --static flag BuildCommand->>BuildCommand: Check production environment alt Production environment BuildCommand->>User: Request confirmation User-->>BuildCommand: Confirm end BuildCommand->>User: Prompt for target OS (if not provided) User-->>BuildCommand: Select OS BuildCommand->>generateCommand: Call with name and static=true generateCommand->>generateCommand: Build args array generateCommand->>generateCommand: Add -ldflags "-s -w -extldflags -static" alt name provided generateCommand->>generateCommand: Add -o flag with name end generateCommand-->>BuildCommand: Return command string BuildCommand->>Process: Set environment (CGO_ENABLED=0, GOOS, GOARCH) BuildCommand->>Process: Execute go build with ldflags Process->>GoCompiler: Run build with static linking flags GoCompiler-->>Process: Build result alt Build failed Process-->>BuildCommand: Return error BuildCommand->>User: Display error else Build succeeded Process-->>BuildCommand: Return success BuildCommand->>User: Display success message end