Support post submit run for test ownership
Change-Id: Ifb2fb633e1f4cd9e09caa96d75da22d3d3b9dc36
Bug: https://github.com/flutter/flutter/issues/87144
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/16401
Commit-Queue: Keyong Han <keyonghan@google.com>
Reviewed-by: Godofredo Contreras <godofredoc@google.com>
diff --git a/recipes/infra/test_ownership.py b/recipes/infra/test_ownership.py
index 54aa7ce..930ec62 100644
--- a/recipes/infra/test_ownership.py
+++ b/recipes/infra/test_ownership.py
@@ -31,7 +31,9 @@
cocoon_path = start_path.join('cocoon')
flutter_path = start_path.join('flutter')
- gitiles_repo = api.properties.get('git_url')
+ gitiles_repo = api.properties.get(
+ 'git_url'
+ ) or api.buildbucket.gitiles_commit.project
repo = gitiles_repo.split("/")[-1]
with api.step.nest('checkout source code'):
@@ -71,5 +73,8 @@
'basic',
api.repo_util.flutter_environment_data(
api.path['start_dir'].join('flutter')
- ), api.properties(git_ref='refs/pull/123/head', git_url='https://abc.com/flutter')
+ ),
+ api.properties(
+ git_ref='refs/pull/123/head', git_url='https://abc.com/flutter'
+ )
)