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(@angular/cli): Prints out when a commit is made in `ng update`. #16110

Merged
merged 1 commit into from Nov 12, 2019

Conversation

@dgp1130
Copy link
Collaborator

dgp1130 commented Nov 7, 2019

Any time a git commit is made, the CLI now prints out the hash and short message. For migrations, the message is simply the first line of the commit. For schematics, the commit message isn't all that helpful, so I used the list of packages instead.

I didn't see any good place to put tests for this code, so I didn't add any tests for this change. Let me know if there is a particular place I should include some.

Example run with the change:

$ ng update -C --next @angular/core --force
Fetching dependency metadata from registry...
                  Package "@angular-devkit/build-angular" has an incompatible peer dependency to "typescript" (requires ">=3.1 < 3.6", would install "3.6.4").
    Updating package.json with dependency @angular/compiler-cli @ "9.0.0-rc.1" (was "8.2.13")...
    Updating package.json with dependency @angular/compiler @ "9.0.0-rc.1" (was "8.2.13")...
    Updating package.json with dependency @angular/common @ "9.0.0-rc.1" (was "8.2.13")...
    Updating package.json with dependency @angular/core @ "9.0.0-rc.1" (was "8.2.13")...
    Updating package.json with dependency @angular/animations @ "9.0.0-rc.1" (was "8.2.13")...
    Updating package.json with dependency @angular/forms @ "9.0.0-rc.1" (was "8.2.13")...
    Updating package.json with dependency @angular/language-service @ "9.0.0-rc.1" (was "8.2.13")...
    Updating package.json with dependency @angular/platform-browser @ "9.0.0-rc.1" (was "8.2.13")...
    Updating package.json with dependency zone.js @ "0.10.2" (was "0.9.1")...
    Updating package.json with dependency rxjs @ "6.5.3" (was "6.4.0")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "9.0.0-rc.1" (was "8.2.13")...
    Updating package.json with dependency @angular/router @ "9.0.0-rc.1" (was "8.2.13")...
    Updating package.json with dependency typescript @ "3.6.4" (was "3.5.3")...
UPDATE package.json (1365 bytes)
✔ Packages installed successfully.
  Committed migration step (aa41b0513) for packages: @angular/core@next.
** Executing migrations of package '@angular/core' **

▸ Static flag migration.
  Removes the `static` flag from dynamic queries.
  As of Angular 9, the "static" flag defaults to false and is no longer required for your view and content queries.
  Read more about this here: https://v9.angular.io/guide/migration-dynamic-flag
✔ Migration succeeded.
  No changes to commit after migration.

▸ Missing @Injectable migration.
  In Angular 9, enforcement of @Injectable decorators for DI is a bit stricter.
  Read more about this here: https://v9.angular.io/guide/migration-injectable
✔ Migration succeeded.
  No changes to commit after migration.

▸ ModuleWithProviders migration.
  In Angular 9, the ModuleWithProviders type without a generic has been deprecated.
  This migration adds the generic where it is missing.
  Read more about this here: https://v9.angular.io/guide/migration-module-with-providers
✔ Migration succeeded.
  No changes to commit after migration.

▸ NGCC postinstall migration.
  Adds an ngcc invocation to npm/yarn's postinstall script.
  Read more about this here: https://v9.angular.io/guide/migration-ngcc
UPDATE package.json (1472 bytes)
✔ Packages installed successfully.
✔ Migration succeeded.
  Committed migration step (43bf7a265): @angular/core migration - migration-v9-postinstall-ngcc.

▸ Renderer to Renderer2 migration.
  As of Angular 9, the Renderer class is no longer available.
  Renderer2 should be used instead.
  Read more about this here: https://v9.angular.io/guide/migration-renderer
✔ Migration succeeded.
  No changes to commit after migration.

▸ Undecorated classes with decorated fields migration.
  As of Angular 9, it is no longer supported to have Angular field decorators on a class that does not have an Angular decorator.
  Read more about this here: https://v9.angular.io/guide/migration-undecorated-classes
✔ Migration succeeded.
  No changes to commit after migration.

▸ Undecorated classes with DI migration.
  As of Angular 9, it is no longer supported to use Angular DI on a class that does not have an Angular decorator.
  Read more about this here: https://v9.angular.io/guide/migration-undecorated-classes
✔ Migration succeeded.
  No changes to commit after migration.
packages/angular/cli/commands/update-impl.ts Outdated Show resolved Hide resolved
packages/angular/cli/commands/update-impl.ts Outdated Show resolved Hide resolved
@mgechev

This comment has been minimized.

Copy link
Member

mgechev commented Nov 8, 2019

@dgp1130 would you rebase?

@dgp1130 dgp1130 force-pushed the dgp1130:commit-log branch from f81876f to e0cdc4b Nov 8, 2019
@dgp1130

This comment has been minimized.

Copy link
Collaborator Author

dgp1130 commented Nov 8, 2019

Rebased onto upstream/master, should be mergeable now.

@dgp1130

This comment has been minimized.

Copy link
Collaborator Author

dgp1130 commented Nov 11, 2019

I removed the -C option from a few tests which seemed to be used backwards now that the default has changed. This was causing tests to try to commit changes, but CircleCI does not run within a Git repository, so every Git command was failing. Previously we just ignored these errors, but now they are fatal to the ng update process. Easiest solution was to just disable commits for those tests.

@clydin
clydin approved these changes Nov 11, 2019
packages/angular/cli/commands/update-impl.ts Outdated Show resolved Hide resolved
@dgp1130 dgp1130 force-pushed the dgp1130:commit-log branch 3 times, most recently from 86f4a75 to 5a08fee Nov 11, 2019
@dgp1130

This comment has been minimized.

Copy link
Collaborator Author

dgp1130 commented Nov 11, 2019

Squashed everything to one commit which should stop CI from complaining about the fixup! commit messages. Should be ready to merge assuming all the status checks pass.

Fixes #16060.

Any time a `git commit` is made, the CLI now prints out the hash and short message. For migrations, the message is simply the first line of the commit. For schematics, the commit message isn't all that helpful, so I used the list of packages instead.
@dgp1130 dgp1130 force-pushed the dgp1130:commit-log branch from 5a08fee to 5fc4ac5 Nov 11, 2019
@mgechev mgechev merged commit 208a700 into angular:master Nov 12, 2019
19 checks passed
19 checks passed
ci/angular: merge status All checks passed!
ci/angular: size No size change against base branch.
ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: build-bazel Your tests passed on CircleCI!
Details
ci/circleci: e2e-cli Your tests passed on CircleCI!
Details
ci/circleci: e2e-cli-ng-snapshots Your tests passed on CircleCI!
Details
ci/circleci: e2e-cli-ng-ve-snapshots Your tests passed on CircleCI!
Details
ci/circleci: e2e-cli-ve Your tests passed on CircleCI!
Details
ci/circleci: flake-jail Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: setup-and-build-win Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: test-browsers Your tests passed on CircleCI!
Details
ci/circleci: test-large Your tests passed on CircleCI!
Details
ci/circleci: test-large-ve Your tests passed on CircleCI!
Details
ci/circleci: test-win Your tests passed on CircleCI!
Details
ci/circleci: validate Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed
@dgp1130 dgp1130 deleted the dgp1130:commit-log branch Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.