Skip to content

Commit

Permalink
Skip git repo download
Browse files Browse the repository at this point in the history
  • Loading branch information
vish-cs committed Jan 3, 2025
1 parent af6f0e1 commit 80a4404
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
18 changes: 14 additions & 4 deletions import-automation/executor/app/executor/import_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,20 @@ def _execute_imports_on_commit_helper(
commit_sha, self.config.manifest_filename)

with tempfile.TemporaryDirectory() as tmpdir:
repo_dir = self.github.download_repo(
tmpdir, commit_sha, self.config.repo_download_timeout)

logging.info(f'Downloaded repo: {repo_dir}')
if self.local_repo_dir:
# Do not clone/download from GitHub. Instead, use the
# provided local path to the repo's root directory.
logging.info(
'Using local repo at: %s',
self.local_repo_dir,
)
repo_dir = self.local_repo_dir
else:
# Clone/download from GitHub.
logging.info('Downloading repo')
repo_dir = self.github.download_repo(
tmpdir, commit_sha, self.config.repo_download_timeout)
logging.info(f'Downloaded repo: {repo_dir}')

imports_to_execute = import_target.find_imports_to_execute(
targets=targets,
Expand Down
3 changes: 2 additions & 1 deletion import-automation/executor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def scheduled_updates(absolute_import_name: str, import_config: str):
auth_access_token=config.github_auth_access_token),
config=config,
notifier=email_notifier.EmailNotifier(config.email_account,
config.email_token))
config.email_token),
local_repo_dir='/workspace/data')
result = executor.execute_imports_on_update(absolute_import_name)
logging.info(result)
if result.status == 'failed':
Expand Down

0 comments on commit 80a4404

Please sign in to comment.