Skip to content

[HACKATHON] Enable user narrative script to work with binding.pry#11651

Merged
eileen-nava merged 3 commits intologin-hackathon-2024-user-narrativefrom
em/fork-hackathon-user-narrative
Dec 20, 2024
Merged

[HACKATHON] Enable user narrative script to work with binding.pry#11651
eileen-nava merged 3 commits intologin-hackathon-2024-user-narrativefrom
em/fork-hackathon-user-narrative

Conversation

@eileen-nava
Copy link
Copy Markdown
Contributor

🛠 Summary of changes

  • I added a command line flag, -f, for passing in a file that contains ndjson. I made this change to enable using binding.pry with the script. Previously, the script regarded the piped-in file as stdin, which made it impossible to interact with binding.pry breakpoints via the terminal.
  • Since gpo was ripped out of the ipp flow, I removed the handling of the ipp + gpo flow.

📜 Testing Plan

  • Drop a binding.pry somewhere in the script.
  • Run the script and interact with the breakpoint via the CLI.

events = []

$stdin.each_line do |line|
File.read(file_name).each_line do |line|
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A common pattern in shell tools is to allow "-" to mean "use stdin". So it would be cool to just check if file_name == '-' and use stdin in that case (so, keep stdin_source and update find_cloudwatch_events to check if '-' has been passed as a filename and use stdin_source in that case, otherwise use file_source).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to merge the PR as is and make a note to come back to this after the holidays.

Copy link
Copy Markdown
Contributor

@matthinz matthinz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I have a mild suggestion about supporting '-' but don't want to hold this up any longer

@eileen-nava eileen-nava merged commit fb395d7 into login-hackathon-2024-user-narrative Dec 20, 2024
@eileen-nava eileen-nava deleted the em/fork-hackathon-user-narrative branch December 20, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants