-
Notifications
You must be signed in to change notification settings - Fork 9
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
Server post #24
Server post #24
Conversation
PR Analysis
PR Feedback
How to useInstructions
|
func hasStdinInput(yamlContent []byte) bool { | ||
// Parse YAML as a map to handle top-level keys as steps | ||
var yamlMap map[string]map[string]interface{} | ||
if err := yaml.Unmarshal(yamlContent, &yamlMap); err != nil { |
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.
In the hasStdinInput
function, consider logging or handling the error from yaml.Unmarshal
to provide better insights into potential parsing issues. [medium]
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.
I'm going to make better parser feedback a focus on a coming soon PR - needs more focus throughout
PR Type:
Enhancement
PR Description:
PR Main Files Walkthrough:
files:
cmd/process.go
: Added logic to check for and read data from STDIN, storing it for use in processing YAML files. If STDIN data is present, it is set as the initial output for the processor.cmd/serve.go
: Introduced a function to check if a YAML file uses STDIN as input. Modified the server to allow POST requests for such files and updated the list endpoint to show supported methods for each file.utils/input/handler.go
: Added a new input type for STDIN and a method to handle STDIN input, storing it in the handler's input list.utils/processor/dsl.go
: Added a method to set the last output of the processor, enabling initialization with STDIN data..github/workflows/release.yml
: Created a GitHub Actions workflow for building and releasing binaries. It includes steps for testing, version bumping, and creating release artifacts for multiple platforms.README.md
: Updated to include new server capabilities, installation instructions for pre-built binaries, and details on using POST requests with the server.examples/README.md
: Added descriptions and usage instructions for new server examples, specifically focusing on STDIN input handling.examples/server-examples/stdin-example.yaml
: Provided a new example YAML file demonstrating the use of STDIN input, which can be processed via POST requests to the server.User Description:
cat text.txt|commanda process stdin-example.yaml