-
Notifications
You must be signed in to change notification settings - Fork 41
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
Saving the VCS Checkout dir path to an environment variable #564
base: main
Are you sure you want to change the base?
Changes from 1 commit
55355cd
9afe282
0137d23
38a9c42
3d0ae4c
5dec871
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,11 +79,16 @@ def common_setup(config, task, taskdesc, command): | |
) | ||
|
||
vcs_path = taskdesc["worker"]["env"]["VCS_PATH"] | ||
|
||
try: | ||
primary_repo_path = taskdesc["worker"]["env"]["PRIMARY_REPO_PATH"] | ||
except Exception: | ||
primary_repo_path_exists = False | ||
|
||
for repo_config in repo_configs.values(): | ||
checkout_path = path.join(vcs_path, repo_config.path) | ||
command.append(f"--{repo_config.prefix}-checkout={checkout_path}") | ||
primary_repo_path = taskdesc["worker"]["env"]["PRIMARY_REPO_PATH"] | ||
if primary_repo_path is None or not vcs_path.strip(): | ||
if primary_repo_path_exists is False or not primary_repo_path.strip(): | ||
taskdesc["worker"]["env"]["PRIMARY_REPO_PATH"] = checkout_path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no need to check if the env was set above, Python dicts have a
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is being executed for every loop in the for statement. You'll need to use the |
||
|
||
if run["sparse-profile"]: | ||
|
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 will result in an exception because
primary_repo_path_exists
isn't defined if we don't get to thisexcept
clause. That said, you can remove this whole block, see my comment below.