go-livepeer icon indicating copy to clipboard operation
go-livepeer copied to clipboard

refactor: rename internal references from Broadcaster to Gateway

Open rickstaa opened this issue 1 year ago • 3 comments

What does this pull request do? Explain your changes. (required)

This pull request updates internal references from 'Broadcaster' to 'Gateway' in accordance with the core team’s decision. For more details, refer to the discussion: Discord Link.

It follows up on https://github.com/livepeer/go-livepeer/pull/3056 as I noticed I forgot to rename some references.

Specific updates (required)

  • Renames some internal references of Broadcaster to Gateway in the livepeer.go and starter.go files.

How did you test each of these updates (required)

I checked the tests were successful and started a off-chain orchestrator and gateway.

Does this pull request close any open issues?

NO

Checklist:

  • [x] Read the contribution guide
  • [x] make runs successfully
  • [x] All tests in ./test.sh pass
  • [x] README and other documentation updated
  • [ ] Pending changelog updated

rickstaa avatar May 20 '24 09:05 rickstaa

Codecov Report

Attention: Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 57.40929%. Comparing base (e8f079e) to head (95418ef).

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              master       #3060   +/-   ##
=============================================
  Coverage   57.40929%   57.40929%           
=============================================
  Files             92          92           
  Lines          15764       15764           
=============================================
  Hits            9050        9050           
  Misses          6111        6111           
  Partials         603         603           
Files Coverage Δ
cmd/livepeer/livepeer.go 50.98039% <100.00000%> (ø)
cmd/livepeer/starter/starter.go 7.90514% <0.00000%> (ø)

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 e8f079e...95418ef. Read the comment docs.

Files Coverage Δ
cmd/livepeer/livepeer.go 50.98039% <100.00000%> (ø)
cmd/livepeer/starter/starter.go 7.90514% <0.00000%> (ø)

codecov[bot] avatar May 20 '24 09:05 codecov[bot]

@victorges I noticed in https://github.com/livepeer/go-livepeer/pull/2981 hat you added the following line:

https://github.com/livepeer/go-livepeer/blob/b739f354ce42d20d51c0778156999932dd8c2ae8/cmd/livepeer/starter/starter.go#L796

Since there's no goroutine or defer statement inside the loop that could cause a closure over the loop variable, we can safely remove the p := p line I think.

rickstaa avatar May 20 '24 10:05 rickstaa

Hey @rickstaa! Even tho there's no explicit go or defer statements there, there is a closure on this anonymous function sent to that auto updater: https://github.com/livepeer/go-livepeer/blob/b739f354ce42d20d51c0778156999932dd8c2ae8/cmd%2Flivepeer%2Fstarter%2Fstarter.go#L799

And that updater itself might start a goroutine that eventually runs that function.

Do you think this could be made clear in some way?

victorges avatar May 20 '24 12:05 victorges

Hey @rickstaa! Even tho there's no explicit go or defer statements there, there is a closure on this anonymous function sent to that auto updater:

https://github.com/livepeer/go-livepeer/blob/b739f354ce42d20d51c0778156999932dd8c2ae8/cmd%2Flivepeer%2Fstarter%2Fstarter.go#L799

And that updater itself might start a goroutine that eventually runs that function.

Do you think this could be made clear in some way?

@victorges Ah, I think I had been programming for too long when I asked that question and overlooked the anonymous function 🤦🏻. Thanks for your explanation! I think in that case we are good to merge this 👍🏻.

rickstaa avatar Jun 05 '24 21:06 rickstaa