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
optimize repository updates #6685
Conversation
8adb125
to
3e48a26
Compare
@@ -79,7 +82,7 @@ final class ContainerProvider { | |||
// Otherwise, fetch the container from the provider | |||
self.underlying.getContainer( | |||
for: package, | |||
skipUpdate: self.skipUpdate, | |||
updateStrategy: self.skipUpdate ? .never : .always, // FIXME |
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.
it could be nice optimization if we could use ifNeeded
in PubGrub too, but I am not sure it would be correct. @neonichu ideas?
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 think we probably need something more elaborate there. If there's an existing pin, I believe we try to stick to it in PubGrub, but we would need the ability to switch the strategy if needed.
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.
left this for follow up PR
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.
LGTM, but missing doc comments for new types
While there were minor updates to the tests, I wonder if there's a way to expose different strategies and test that those also work as expected? |
Might also be interesting to look into |
yes that is still TODO
yes, but in follow up PR |
motivation: improve performance changes: * instead of binary update flag, use a strategy that takes into account the version * implement the update strategy for source control based dependency * update all call sites and tests
3e48a26
to
0ed4399
Compare
@swift-ci smoke test |
this should be ready for final review |
0ed4399
to
4066e4e
Compare
4066e4e
to
73b014d
Compare
@@ -703,7 +703,8 @@ public final class GitRepository: Repository, WorkingCheckout { | |||
/// Returns true if a revision exists. | |||
public func exists(revision: Revision) -> Bool { | |||
self.lock.withLock { | |||
(try? callGit("rev-parse", "--verify", revision.identifier)) != nil | |||
let output = try? callGit("rev-parse", "--verify", "\(revision.identifier)^{commit}") |
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.
👀 this was not actually working as intended but was never a problem I guess
@swift-ci smoke test |
@swift-ci smoke test windows |
motivation: improve performance
changes: