Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Issue 79983002: Avoid network requests while resolving versions when possible. (Closed)

Created:
7 years, 1 month ago by Bob Nystrom
Modified:
7 years ago
Reviewers:
nweiz
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Avoid network requests while resolving versions when possible. BUG=https://code.google.com/p/dart/issues/detail?id=10807 R=nweiz@google.com Committed: https://code.google.com/p/dart/source/detail?r=30681

Patch Set 1 #

Total comments: 24

Patch Set 2 : Revise. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+456 lines, -197 lines) Patch
M sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart View 1 14 chunks +159 lines, -188 lines 2 comments Download
A sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart View 1 1 chunk +126 lines, -0 lines 0 comments Download
A sdk/lib/_internal/pub/lib/src/solver/version_queue.dart View 1 1 chunk +92 lines, -0 lines 2 comments Download
A sdk/lib/_internal/pub/test/get/hosted/avoid_network_requests_test.dart View 1 1 chunk +63 lines, -0 lines 0 comments Download
A + sdk/lib/_internal/pub/test/get/hosted/does_no_network_requests_when_possible_test.dart View 1 2 chunks +15 lines, -8 lines 0 comments Download
M sdk/lib/_internal/pub/test/test_pub.dart View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Bob Nystrom
7 years, 1 month ago (2013-11-21 01:22:12 UTC) #1
nweiz
It would be nice to have a test where some but not all of the ...
7 years, 1 month ago (2013-11-21 22:28:26 UTC) #2
Bob Nystrom
Added a test of a partially complete lock file too. https://codereview.chromium.org/79983002/diff/1/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart File sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart (right): https://codereview.chromium.org/79983002/diff/1/sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart#newcode81 ...
7 years, 1 month ago (2013-11-22 21:40:13 UTC) #3
nweiz
A few more suggestions, but lgtm https://codereview.chromium.org/79983002/diff/1/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart File sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart (right): https://codereview.chromium.org/79983002/diff/1/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart#newcode80 sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart:80: if (!_isSorted) return ...
7 years ago (2013-11-26 21:00:43 UTC) #4
Bob Nystrom
Committed patchset #2 manually as r30681 (presubmit successful).
7 years ago (2013-11-26 22:12:44 UTC) #5
Bob Nystrom
7 years ago (2013-11-26 22:16:10 UTC) #6
Message was sent while issue was closed.
Thanks!

https://codereview.chromium.org/79983002/diff/1/sdk/lib/_internal/pub/lib/src...
File sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart (right):

https://codereview.chromium.org/79983002/diff/1/sdk/lib/_internal/pub/lib/src...
sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart:80: if (!_isSorted)
return _sort().then((_) => _remaining.removeAt(0));
On 2013/11/26 21:00:43, nweiz wrote:
> On 2013/11/22 21:40:13, Bob Nystrom wrote:
> > On 2013/11/21 22:28:26, nweiz wrote:
> > > Currently I think this will behave pretty badly if [advance] is called
> > multiple
> > > times while [_isSorted] is false. We should probably cache the sorting
> future
> > to
> > > make that case behave correctly.
> > 
> > Lots of other things would be in a bad state if you called advance() in a
> > re-entrant way. That would violate lots of assumptions about how the solver
> > works. I'll document that this is not re-entrant.
> 
> Please at least track the old future enough to throw an error if this is
called
> re-entrantly. It seems like an easy mistake to make unintentionally.

Done.

https://codereview.chromium.org/79983002/diff/80001/sdk/lib/_internal/pub/lib...
File sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart (right):

https://codereview.chromium.org/79983002/diff/80001/sdk/lib/_internal/pub/lib...
sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart:76: /// Each entry
in the list is [VersionQueue], which is an ordered queue of
On 2013/11/26 21:00:43, nweiz wrote:
> "is [VersionQueue]" -> "is a [VersionQueue]"

Done.

https://codereview.chromium.org/79983002/diff/80001/sdk/lib/_internal/pub/lib...
File sdk/lib/_internal/pub/lib/src/solver/version_queue.dart (right):

https://codereview.chromium.org/79983002/diff/80001/sdk/lib/_internal/pub/lib...
sdk/lib/_internal/pub/lib/src/solver/version_queue.dart:49: /// versions
asynchronously before we can determine what the first one is.
On 2013/11/26 21:00:43, nweiz wrote:
> Update this documentation to reflect the new parameters.

Done.

Powered by Google App Engine
This is Rietveld 408576698