Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/scriptworker/cot/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ async def _get_additional_git_cron_jsone_context(decision_link):
"sender": {"login": user},
},
# Taskgraph cron contexts mirror hg-push contexts
"repository": {"url": repo, "project": repo_name, "level": await get_scm_level(decision_link.context, repo_name)},
"repository": {"url": repo, "project": repo_name, "level": await get_scm_level(decision_link.context, repo_name), "type": "git"},
"push": {"revision": revision, "branch": branch},
}

Expand Down Expand Up @@ -1359,8 +1359,10 @@ async def populate_jsone_context(chain, parent_link, decision_link, tasks_for):
jsone_context.update(await _get_additional_hg_action_jsone_context(parent_link, decision_link))
elif tasks_for == "hg-push":
jsone_context.update(await _get_additional_hg_push_jsone_context(parent_link, decision_link))
jsone_context["repository"]["type"] = "hg"
elif tasks_for == "cron":
jsone_context.update(await _get_additional_hg_cron_jsone_context(parent_link, decision_link))
jsone_context["repository"]["type"] = "hg"
else:
raise CoTError('Unknown tasks_for "{}" for hg cot_product "{}"!'.format(tasks_for, chain.context.config["cot_product"]))
else:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_cot_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ async def fake_load(*args, **kwargs):
"now": "2018-01-01T12:00:00.000Z",
"ownTaskId": "decision_task_id",
"push": {"base_revision": "baserev", "comment": " ", "owner": "some-user", "pushdate": 1500000000, "pushlog_id": 1, "revision": None},
"repository": {"level": "1", "project": "mozilla-central", "url": None},
"repository": {"level": "1", "project": "mozilla-central", "url": None, "type": "hg"},
"taskId": None,
"tasks_for": "hg-push",
},
Expand All @@ -1057,7 +1057,7 @@ async def fake_load(*args, **kwargs):
"now": "2018-01-01T12:00:00.000Z",
"ownTaskId": "decision_task_id",
"push": {"base_revision": "baserev", "comment": "", "owner": "cron", "pushdate": 1500000000, "pushlog_id": 1, "revision": None},
"repository": {"level": "1", "project": "mozilla-central", "url": None},
"repository": {"level": "1", "project": "mozilla-central", "url": None, "type": "hg"},
"taskId": None,
"tasks_for": "cron",
},
Expand Down Expand Up @@ -1165,7 +1165,7 @@ async def test_populate_jsone_context_git_cron(mobile_chain, mobile_cron_link, h
"ownTaskId": "decision_task_id",
"taskId": None,
"tasks_for": "cron",
"repository": {"url": "https://github.com/mozilla-mobile/reference-browser", "project": "reference-browser", "level": "3"},
"repository": {"url": "https://github.com/mozilla-mobile/reference-browser", "project": "reference-browser", "level": "3", "type": "git"},
"push": {"branch": "master", "revision": "somerevision"},
}

Expand Down