-
Notifications
You must be signed in to change notification settings - Fork 14
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
Allow partial sync with multiple paths #182
Conversation
* master: Add a unittest for syncing to label revision specifier (#173)
sync: List of paths to sync. Defaults to entire view. | ||
client_opts: Additional options to add to client. (e.g. allwrite) | ||
parallel: How many threads to use for parallel sync. |
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.
Driveby, document undocumented params
""" | ||
self.root = os.path.abspath(root or '') | ||
self.stream = stream | ||
self.view = self._localize_view(view or []) | ||
self.sync_paths = sync or '//...' | ||
self.sync_paths = sync or ['//...'] | ||
assert isinstance(self.sync_paths, list) |
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.
Will never fail other than when authoring unit tests which pass the wrong type - avoids confusion when making this mistake.
Ideally we would add some types to this class instead
result = self.perforce.run_sync( | ||
'--parallel=threads=%s' % self.parallel, | ||
'%s%s' % (self.sync_paths, revision or ''), | ||
*sync_files, |
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.
Expands list into params, e.g.:
l = [1, 2, 3]
print(l) => [1, 2, 3]
print(*l) => 1 2 3 # i.e. print(1, 2, 3)
@@ -16,7 +16,7 @@ configuration: | |||
stream: | |||
type: string | |||
sync: | |||
type: string | |||
type: array |
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 doesnt have any actual functional effect afaik - I think buildkite have some plans to auto-generate docs from this file
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: improbable-mattchurch The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Resolves #164
Permit specifying a list of paths to sync, instead of limiting it to just one.
list_from_env_array
which can read either a single value (backwards compatibility) or an array of values from env vars likeENV_0
,ENV_1
etcTesting strategy
Unit, integration, test this branch in production