Skip to content
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

FIX: pricePerBroadcaster JSON file line breaks parsing bug #2914

Merged
merged 5 commits into from
Dec 8, 2023

Conversation

thomshutt
Copy link
Contributor

!! Based on #2913 from @rickstaa !!

What does this pull request do? Explain your changes. (required)
The current go-livepeer livepeer binary does not correctly parse pricePerBroadcaster files if they contain line breaks.

This pull request ensures that the pricePerBroadcaster flag also works with JSON files that contain line breaks as is often done to improve readability.

As far as I could tell, the previous iteration was done as a way to make sure single line + newline files that contained e.g a password parsed correctly and didn't bring in the newline.

Specific updates (required)

  • The common.ReadFromFile was changed so JSON files with line breaks and JSON strings are parsed correctly.

How did you test each of these updates (required)

  • Ran unit tests, tried parsing multiline JSON files.

Does this pull request close any open issues?
Fixes #2912

Checklist:

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Merging #2914 (ae3b83b) into master (5b69cd6) will decrease coverage by 0.01563%.
The diff coverage is 100.00000%.

Additional details and impacted files

Impacted file tree graph

@@                 Coverage Diff                 @@
##              master       #2914         +/-   ##
===================================================
- Coverage   56.54162%   56.52599%   -0.01563%     
===================================================
  Files             89          89                 
  Lines          19460       19453          -7     
===================================================
- Hits           11003       10996          -7     
  Misses          7849        7849                 
  Partials         608         608                 
Files Coverage Δ
common/readfromfile.go 85.00000% <100.00000%> (-3.88889%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5b69cd6...ae3b83b. Read the comment docs.

Files Coverage Δ
common/readfromfile.go 85.00000% <100.00000%> (-3.88889%) ⬇️

Copy link
Contributor

@rickstaa rickstaa left a comment

Choose a reason for hiding this comment

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

Thanks for adding me as a co-author ❤️‍🔥.

@thomshutt thomshutt merged commit fdda451 into master Dec 8, 2023
18 checks passed
@thomshutt thomshutt deleted the multiline-readfromfile branch December 8, 2023 12:04
@thomshutt thomshutt mentioned this pull request Jan 29, 2024
eliteprox pushed a commit to eliteprox/go-livepeer that referenced this pull request Feb 21, 2024
…2914)

* FIX: pricePerBroadcaster JSON file line breaks parsing bug

---------

Co-authored-by: Rick Staa <[email protected]>
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.

pricePerBroadcaster argument doesn't work JSON files that contain line-breaks
3 participants