-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11051 from TiVo:p-fix-for-issue-11050
PiperOrigin-RevId: 518953648
- Loading branch information
Showing
1 changed file
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
e811749
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.
@tianyif I'm a bit confused by this "merge" as it looks like it changed commit f2cf82c
This makes it difficult for us to mange our change in our git when it comes back to us from upstream merges.
If you could explain this, as it is different from what we tested.
e811749
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.
@stevemayhew, the additional changes regarding the corresponding pull request could be made based on our internal code review.
e811749
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.
@marcbaechinger merged this internally and @tonihei reviewed it, so they're probably best placed to comment on what changed (@tianyif only pushed it externally, which is why it looks like they 'committed' it to this repo).
@stevemayhew Unfortunately when changes are made to a PR during internal review, the resulting git history contains an 'evil merge' containing those changes (rather than making the changes in discrete commits). This is a result of the way Google's internal VCS and git (and GitHub) interact when handling PRs specifically.
e811749
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.
If I remember correctly, we only changed the parameter name from
positionRequestedBySeek
toforceSetTargetOffsetOverride
(because it's better to name parameters for what they do not for when they are set).But, yeah, as @icbaker already explained, these review changes are often unavoidable. There are also automatic code formatting adjustments. So even without functional differences, there might be a small diff to the original PR.
e811749
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.
That’s perfectly fine, this is what a pull request review is for, and the proper place to have the discussion.
Our internal pull requests reviews always create a series of commits with the review updates, the end result is
then squashed to a single commit then "merged" with a rebase into our mainline.
This makes the change easy to track and reduces the rats nest of vacuous branches.
Sure, we support and recognize that review changes are unavoidable, that is the whole point of the
pull request. It's not the changes we take issue with, but how and where they are made must preserve
the integrity of the original source commit.
@icbaker Yes, the "evil merge" is the main issue here (though Evil is a strong word, I'm sure @tianyif had no malicious intent ;-) ).
We track our changes coming back from upstream by matching the upstream commit subject with our own commits, this is non trivial for us to maintain. This simple process becomes impossible when the committed code is scattered across multiple git patches and merge commits.
While our installed base may be small compared to Google, we do bring over a million IPTV users, across multiple
Google certified Android streamer devices, unmanaged Android'ish devices, and Android mobile devices
all consuming live and start over/catchup content served by a broad range of CDN/origin/Transcode vendors
as well as third party content providers.
We are currently committed to sharing our changes and bug fixes to the Google public open source including
whatever it takes to keep this a community effort. In my opinion the best place to continue this discussion and
come to consensus on best practices (including, for example auto formatters and an Android Studio code style template) is the CONTRIBUTING guidelines.
I would be more then happy to help with this effort, reviewing changes or suggesting changes to this document.
e811749
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.
First of all, we really appreciate pull requests and upstreaming changes. Because, as you say, the library overall becomes better if it's a community effort and we definitely want to get further PRs in the future!
Having said that, we also discussed the tooling problem today and ways we can avoid the "evil merge" (this is apparently a term of art and doesn't necessarily imply evil intentions ;) ).
For a bit more background, our current process and tooling works like this:
Our current proposal is roughly:
Does that sound sensible to you as well? It generates a bit more work on our side, but would align better with established git practices. We are also not entirely sure if it works exactly as we think it should work, but we are happy to try this process for the next PR.
e811749
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.
@tonihei thanks, yes that does sound like that could work better. It does sound like a lot of work, both workflows. We appreciate it!
We all see the advantages of something like mono-repo (Mainly cross-team collaboration and visibility). From the POV of the ExoPlayer open-source community, the
mono-repo
is https://github.com/google/ExoPlayerI'm sure we can come up with a workflow that honors the requirements of both sides.
Two things we would like from your team:
Even if you make changes post PR review and merge as a separate commit that is acceptable, as long as the original commit is preserved. Would be nice to reference the original commit in these internal review changes so we can see the history of what happened.
The first would help the community submit better code (I tell my team Google owns the style, follow what you see in the code... But obviously far better if this is mechanically done for us by the IDE). The second allows us to find our original change, reducing merge conflicts when we incorporate upstream releases. This helps us stay on the leading edge of ExoPlayer releases (a good thing for all of us!)
Thanks again!
e811749
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've updated Media3's
CONTRIBUTING.md
with a link to the Google Java Style Guide (which covers a mixture of 'automatable' (e.g. formatting) and 'human enforced' rules (e.g. identifier naming)), andgoogle-java-format
(which has instructions about various IDE integrations): androidx/media@f799766I'm experimenting with the flow proposed by @tonihei above on androidx/media#313 - when that gets merged we can take a look at the resulting commit and see how much less 'evil' we've managed to make it :)
e811749
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.
@stevemayhew Can you take a look at this merge commit and see if it looks better? In this case the fixes I made during review were added as additional commits on the PR, so hopefully the resulting merge commit is much cleaner: androidx/media@fab134f
e811749
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.
@icbaker Yes, tracing the path is easier when the pull request is cleanly just a simple merge. Thanks for you diligence on this!
I'm curious how you are able to push commits (the reformat) to the forked repo (https://github.com/pengbins/media/tree/fix_ts_h265reader_parse_sps). It's great, as one of the most frustrating things about reviewing external pull requests is you can't simply checkout the branch and make small changes. I suppose this could be done by cherry-picking the changes across identical but disconnected branches, but still that is messy.
Internally for us, a pull request is a code review essentially. When pull requests are branches with small changes (e.g. easy to squash, and use rebase to keep up to date with the mainline) we simply squash the pull request branch, rebase the commit on to mainline. This has several advantages:
At any rate, not having code changes in a merge commit is a major advantage. When cherry-picking changes one must ignore merges, having actual patches as part of the merge makes this impossible.
Also, thanks for publishing the coding style, I've updated my Android Studio and instructed my team members to as well.
e811749
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 used the GiHub CLI to get a local copy of the PR branch in my local clone of the androidx/media repo:
That created a branch called
fix_ts_h265reader_parse_sps
and when I committed to it andgit push
'd the commits ended up going into the forked repo. I didn't do anything particularly special, it 'just worked' (I wasn't sure if it was going to, but thought it was worth a try). I could thengit pull
follow-up changes by the PR author (sometimes needing to 'force pull' withgit reset --hard FETCH_HEAD
).