Skip to content

Conversation

@gregg-miskelly
Copy link
Contributor

This commit improves the updatePackageDependencies gulp task so that hopefully it will work for all three teams needing to update package.json to point at new runtime dependancies in hopefully a safe way.

Fixes/improvements:

  • Make the task work again since gulp no longer likes the command line argument hack that we used to have
  • Add support for computting checksums
  • Add verification that the primary and fallback URLs have the same hash and both work

This commit improves the updatePackageDependencies gulp task so that hopefully it will work for all three teams needing to update package.json to point at new runtime dependancies in hopefully a safe way.

Fixes/improvements:
* Make the task work again since gulp no longer likes the command line argument hack that we used to have
* Add support for computting checksums
* Add verification that the primary and fallback URLs have the same hash and both work
@codecov
Copy link

codecov bot commented Dec 28, 2018

Codecov Report

Merging #2766 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2766      +/-   ##
==========================================
- Coverage   65.29%   65.27%   -0.03%     
==========================================
  Files         102      102              
  Lines        4440     4443       +3     
  Branches      641      641              
==========================================
+ Hits         2899     2900       +1     
- Misses       1356     1358       +2     
  Partials      185      185
Flag Coverage Δ
#integration 52.63% <14.28%> (-0.31%) ⬇️
#unit 85.33% <100%> (+0.02%) ⬆️
Impacted Files Coverage Δ
src/packageManager/isValidDownload.ts 100% <100%> (ø) ⬆️
src/features/diagnosticsProvider.ts 77.92% <0%> (-1.3%) ⬇️

Continue to review full report at Codecov.

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

}
}

if (! /^[0-9]+\.[0-9]+\.[0-9]+$/.test(newVersion)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We could also do a semver check here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think there is anything in 'semver' that supports searching for a semver in a string, and since we always want the input version to be subsequently searchable, I don't think it makes sense to use the semver library for this.

eventStream.subscribe((event: Event.BaseEvent) => {
switch (event.constructor.name) {
case Event.DownloadFailure.name:
console.log("Failed to download: " + (<Event.DownloadFailure>event).message);
Copy link
Contributor

Choose a reason for hiding this comment

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

Like in the other places in the code, we could use a single eventStream that is passed to all these functions and in this file we could post the appropriate events to this stream and separately create a "ConsoleObserver" or "UpdatePackageDependencies" observer that subscribes to this event stream and does the logging accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

While I think the eventStream pattern that we created in other places make a lot of sense for enabling unit tests, I don't really see a benefit in this case since unit tests don't seem to make sense for a gulp task that produces output that would be code reviewed.

@gregg-miskelly gregg-miskelly merged commit 975e607 into dotnet:master Jan 2, 2019
@gregg-miskelly gregg-miskelly deleted the UpdatePackageDependancies branch January 2, 2019 20:32
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.

3 participants