Thanks to visit codestin.com
Credit goes to github.com

Skip to content

build: adding a script to compare commits in master and stable branches #35130

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

Closed

Conversation

AndrewKushnir
Copy link
Contributor

Adding a script that compares commits in master and patch branches and finds a delta between them. This is useful for release reviews, to make sure all the necessary commits are included into the patch branch and there is no discrepancy.

This script was inspired by the compare-master-to-stable.js one that was used in AngularJS.

PR Type

What kind of change does this PR introduce?

  • Other... Please describe: a tool to compare commits in master and stable branches

Does this PR introduce a breaking change?

  • Yes
  • No

@AndrewKushnir AndrewKushnir added target: patch This PR is targeted for the next patch release comp: misc labels Feb 3, 2020
@ngbot ngbot bot modified the milestone: needsTriage Feb 3, 2020
@pullapprove pullapprove bot requested a review from gkalpak February 3, 2020 19:26
@AndrewKushnir AndrewKushnir requested review from IgorMinar and removed request for gkalpak February 3, 2020 19:26
@AndrewKushnir AndrewKushnir added the action: review The PR is still awaiting reviews from at least one requested reviewer label Feb 3, 2020
@AndrewKushnir AndrewKushnir marked this pull request as ready for review February 3, 2020 19:26
@kara kara removed the comp: misc label Feb 7, 2020
@ngbot ngbot bot removed this from the needsTriage milestone Feb 7, 2020
@mhevery mhevery added the area: build & ci Related the build and CI infrastructure of the project label Feb 22, 2020
@ngbot ngbot bot added this to the needsTriage milestone Feb 22, 2020
Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

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

Can you run the script and sanity check the build/ci commits that are in ONLY IN MASTER? It doesn't look right to me.

console.log(`
Comparing branches "${branch}" and master.

***** Only in MASTER *****
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still seeing some commits under "ONLY IN MASTER" that are also on 9.0.x branch. e.g.

ci: reenable draft mode conditioning for pullapprove (#35396)
ci: add verification of the pullapprove config (#35060) …

@kara kara added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 27, 2020
@AndrewKushnir
Copy link
Contributor Author

Hi @kara, I updated master and 9.0.x branches locally, ran a script after that and I don't see these two commits that you refer to in a diff. May be try fetching the latest 9.0.x and run the script once again to see if the diff is correct now? Thank you.

@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Feb 28, 2020
@AndrewKushnir AndrewKushnir removed their assignment Feb 28, 2020
@kara
Copy link
Contributor

kara commented Feb 29, 2020

@AndrewKushnir Updating my 9.0.x branch fixed the issue. But it concerns me that it's so easy to get into this state by mistake. Could we throw if we notice the branch is out of date? Or can we update the branch in the script?

@kara kara added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 29, 2020
@AndrewKushnir AndrewKushnir added action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Mar 3, 2020
@AndrewKushnir
Copy link
Contributor Author

Thanks for the feedback @kara. I've added the logic to fetch upstream and also compare upstream branches, so now the script should compare the latest versions of master and patch branches without additional manual actions. Thank you.

Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

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

If I understand your last comment correctly, my local state shouldn't matter now because we should be pulling from upstream branches. But this is what I see under Only in PATCH

***** Only in PATCH (9.0.x) *****
[v9.0.0-rc.2] bc97c25efe build: add ngJitMode to ng_rollup_bundle terser config (#33865)
[v9.0.0-rc.3] f1bf5b26d1 fix(router): make routerLinkActive work with query params which contain arrays (#22666)
[v9.0.0-rc.5] 1183075d16 Revert "fix(common): update closure locales to include directionality data (#34240)"
[v9.0.0-rc.8] a9f13015b2 build: upgrade to io_bazel_rules_sass 1.24.0 (#34589)
[v9.0.0-rc.8] a812880054 build: package-build & release scripts should handle new pkg_npm naming (#34589)
[v9.0.0-rc.8] d35451327e test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34589)
[v9.0.0-rc.8] e175878480 test: keep diff in integration/bazel minimal by not introducing additional_root_paths (#34589)
[v9.0.0-rc.8] f7dc3a7b64 build: renamed "injected_scripts" target to "asset_injected_index_html" (#34589)
[v9.0.0-rc.8] 68e6db5d7a build: add a before-all-other bootstrap script that patches require (#34589)
[v9.0.0-rc.8] d83071c3b1 build: should use $(execpath) in npm_package_bin args (#34589)
[v9.0.0-rc.8] 3e72381bb0 build: derive ts_library dep from jasmine_node_test boostrap label if it ends in `_es5` (#34589)
[v9.0.0-rc.8] c4e9cef314 build: add better comments to defaults.bzl jasmine_node_test macro (#34589)
[v9.0.0-rc.8] 613367508f test: add coverage to  //tools/ts-api-guardian/... on WindowsCI (#34589)
[v9.0.0-rc.10] 20dc436585 fix(language-service): rename getDiagnostics to getSemanticDiagnostics (#34909)
[v9.0.0-rc.11] 8b858fb30a Revert "ci: filter out bad commit from the commit message check to green up master (#35017)" (#35024)
[v9.0.1] ce85cbf2d3 Revert "feat(ngcc): pause async ngcc processing if another process has the lockfile (#35131)"

Some of these commits (e.g. a9f1301) are also on the master branch, so they shouldn't be here.

@AndrewKushnir
Copy link
Contributor Author

@kara, yes local state should not matter. I see the same diff in the output:

Comparing branches "9.0.x" and master.

***** Only in MASTER *****
[v9.0.0-rc.4] 3c2438425b feat: add direction property to locale files (#33556)
[v9.0.0-rc.4] 15d3e741e9 feat: update the locale files (#33556)
[v9.0.0] 3c69442dbd feat(compiler-cli): implement NgTscPlugin on top of the NgCompiler API (#34792)
[v9.0.0] daac33cdc8 feat: add basic jest support (#35080)
[v9.0.0] e1160f19be feat: make jasmine patch as zone module (#34676)
[v9.0.0] 332937ef24 feat: make mocha a zone module. (#34719)
[v9.1.0-next.1] 66c06eb1ad fix(language-service): provide completions for the structural directive that only injects the 'ViewContainerRef' (#35466)
[v9.1.0-next.1] 39ef57971c build: refactor zone bazel settings (#34532)
[v9.1.0-next.1] d7d359e3ee feat: support passive event options by defining global variables in zone.js config file (#34503)
[v9.1.0-next.1] e084835fb1 Revert "feat: support passive event options by defining global variables in zone.js config file (#34503)"
[v9.1.0-next.1] af76651ccc refactor: update tscplugin api to match google3 (#35455)
[v9.1.0-next.1] f9d483e76e feat: add a temp solution to support passive event listeners. (#34503)
[v9.1.0-next.1] 4acb676f2e feat: add interface definitions which zone extends EventTarget (#35304)
[v9.1.0-next.1] 500e49f0ac refactor(language-service): normalize hover tests (#35656)
[v9.1.0-next.1] 8f5b7f367c feat(bazel): enable ivy template type-checking in g3 (#35672)
[v9.1.0-next.1] 59c0689ade refactor(ngcc): remove redundant await (#35686)
[v9.0.4] 03d88c7965 feat: define all zone.js configurations to typescript interfaces (#35329)
[v9.0.4] dc40a93317 perf(ngcc): spawn workers lazily (#35719)
[v9.0.4] d7efc45c04 perf(ngcc): only create tasks for non-processed formats (#35719)

***** Only in PATCH (9.0.x) *****
[v9.0.0-rc.2] bc97c25efe build: add ngJitMode to ng_rollup_bundle terser config (#33865)
[v9.0.0-rc.3] f1bf5b26d1 fix(router): make routerLinkActive work with query params which contain arrays (#22666)
[v9.0.0-rc.5] 1183075d16 Revert "fix(common): update closure locales to include directionality data (#34240)"
[v9.0.0-rc.8] a9f13015b2 build: upgrade to io_bazel_rules_sass 1.24.0 (#34589)
[v9.0.0-rc.8] a812880054 build: package-build & release scripts should handle new pkg_npm naming (#34589)
[v9.0.0-rc.8] d35451327e test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34589)
[v9.0.0-rc.8] e175878480 test: keep diff in integration/bazel minimal by not introducing additional_root_paths (#34589)
[v9.0.0-rc.8] f7dc3a7b64 build: renamed "injected_scripts" target to "asset_injected_index_html" (#34589)
[v9.0.0-rc.8] 68e6db5d7a build: add a before-all-other bootstrap script that patches require (#34589)
[v9.0.0-rc.8] d83071c3b1 build: should use $(execpath) in npm_package_bin args (#34589)
[v9.0.0-rc.8] 3e72381bb0 build: derive ts_library dep from jasmine_node_test boostrap label if it ends in `_es5` (#34589)
[v9.0.0-rc.8] c4e9cef314 build: add better comments to defaults.bzl jasmine_node_test macro (#34589)
[v9.0.0-rc.8] 613367508f test: add coverage to  //tools/ts-api-guardian/... on WindowsCI (#34589)
[v9.0.0-rc.10] 20dc436585 fix(language-service): rename getDiagnostics to getSemanticDiagnostics (#34909)
[v9.0.0-rc.11] 8b858fb30a Revert "ci: filter out bad commit from the commit message check to green up master (#35017)" (#35024)
[v9.0.1] ce85cbf2d3 Revert "feat(ngcc): pause async ngcc processing if another process has the lockfile (#35131)"

These 10 commits that are showing as delta in patch branch are likely artifacts of merging and rolling back PR #34589:

[v9.0.0-rc.8] a9f13015b2 build: upgrade to io_bazel_rules_sass 1.24.0 (#34589)
[v9.0.0-rc.8] a812880054 build: package-build & release scripts should handle new pkg_npm naming (#34589)
[v9.0.0-rc.8] d35451327e test: handle bootstrap templated_args in jasmine_node_test defaults.bzl (#34589)
[v9.0.0-rc.8] e175878480 test: keep diff in integration/bazel minimal by not introducing additional_root_paths (#34589)
[v9.0.0-rc.8] f7dc3a7b64 build: renamed "injected_scripts" target to "asset_injected_index_html" (#34589)
[v9.0.0-rc.8] 68e6db5d7a build: add a before-all-other bootstrap script that patches require (#34589)
[v9.0.0-rc.8] d83071c3b1 build: should use $(execpath) in npm_package_bin args (#34589)
[v9.0.0-rc.8] 3e72381bb0 build: derive ts_library dep from jasmine_node_test boostrap label if it ends in `_es5` (#34589)
[v9.0.0-rc.8] c4e9cef314 build: add better comments to defaults.bzl jasmine_node_test macro (#34589)
[v9.0.0-rc.8] 613367508f test: add coverage to  //tools/ts-api-guardian/... on WindowsCI (#34589)

The compare script is now relies on git to generate deltas with minimum post-processing, i.e. the same 10 commits are present when I execute underlying git command:

git log --cherry-pick --oneline --left-only upstream/9.0.x...upstream/master

I'll look into this more and keep you updated.

Thank you.

@AndrewKushnir
Copy link
Contributor Author

@josephperrott, thanks for the review! I've applied the necessary changes based on your feedback. Could you please take another look when you get a chance? Thank you.

Adding a script that compares commits in master and patch branches and finds a delta between them. This is useful for release reviews, to make sure all the necessary commits are included into the patch branch and there is no discrepancy.
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM, in terms of code, Kara will have to give final confirmation that its the correct output we are looking for.

@AndrewKushnir
Copy link
Contributor Author

@kara we discussed this Joey: the delta that was showing up in the list was related to the #34589 that was rolled back and then the changes were merged again. As a result, for some reasons git was unable to cleanly calculate the delta while using the --cherry-pick flag. I've verified that the commits are present in both master and patch. The current approach is to limit the log starting from the time we cut the 9.0.0 release and see if we have any other discrepancies in the future. As you requested, here is the current diff that I see:

***** Only in MASTER *****
[v9.0.0] 3c69442dbd feat(compiler-cli): implement NgTscPlugin on top of the NgCompiler API (#34792)
[v9.0.0] daac33cdc8 feat: add basic jest support (#35080)
[v9.0.0] e1160f19be feat: make jasmine patch as zone module (#34676)
[v9.0.0] 332937ef24 feat: make mocha a zone module. (#34719)
[v9.1.0-next.1] 66c06eb1ad fix(language-service): provide completions for the structural directive that only injects the 'ViewContainerRef' (#35466)
[v9.1.0-next.1] 39ef57971c build: refactor zone bazel settings (#34532)
[v9.1.0-next.1] d7d359e3ee feat: support passive event options by defining global variables in zone.js config file (#34503)
[v9.1.0-next.1] e084835fb1 Revert "feat: support passive event options by defining global variables in zone.js config file (#34503)"
[v9.1.0-next.1] af76651ccc refactor: update tscplugin api to match google3 (#35455)
[v9.1.0-next.1] f9d483e76e feat: add a temp solution to support passive event listeners. (#34503)
[v9.1.0-next.1] 4acb676f2e feat: add interface definitions which zone extends EventTarget (#35304)
[v9.1.0-next.1] 500e49f0ac refactor(language-service): normalize hover tests (#35656)
[v9.1.0-next.1] 8f5b7f367c feat(bazel): enable ivy template type-checking in g3 (#35672)
[v9.1.0-next.1] 59c0689ade refactor(ngcc): remove redundant await (#35686)
[v9.0.4] 03d88c7965 feat: define all zone.js configurations to typescript interfaces (#35329)
[v9.0.4] 4052dd8188 refactor(core): update `noSideEffects()` to return the result of the inner function (#35769)
[v9.0.4] dc6a7918e3 fix(core): add `noSideEffects()` to `make*Decorator()` functions (#35769)
[v9.0.4] ba3612774f fix(core): add `noSideEffects()` to `ɵɵdefineComponent()` (#35769)
[v9.0.4] 9cf85d2177 fix(core): remove side effects from `ɵɵNgOnChangesFeature()` (#35769)
[v9.0.4] c195d22f68 fix(core): remove side effects from `ɵɵgetInheritedFactory()` (#35769)
[v9.0.4] ed44073a58 build(zone.js): sets rollup_bundle to use the --silent flag (#35835)

***** Only in PATCH (9.0.x) *****
[v9.0.1] ce85cbf2d3 Revert "feat(ngcc): pause async ngcc processing if another process has the lockfile (#35131)"
[v9.0.4] 12e52a7696 Revert "build: update to rules_nodejs 1.4.0 (#35813)" (#35836)

Which looks correct to me.

Thank you.

Copy link
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

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

lgtm otherwise. thanks!

@AndrewKushnir
Copy link
Contributor Author

Thanks for the review @IgorMinar, I've addressed your comments.

@IgorMinar IgorMinar requested a review from kara March 5, 2020 04:50
@IgorMinar
Copy link
Contributor

@kara please take a look or remove yourself from the reviewer list if you are happy with our reviews.

Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

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

LGTM

@kara kara added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 10, 2020
matsko pushed a commit that referenced this pull request Mar 10, 2020
…es (#35130)

Adding a script that compares commits in master and patch branches and finds a delta between them. This is useful for release reviews, to make sure all the necessary commits are included into the patch branch and there is no discrepancy.

PR Close #35130
@matsko matsko closed this in c98c6e8 Mar 10, 2020
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project cla: yes target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants