Skip to content
This repository has been archived by the owner on Nov 11, 2019. It is now read-only.

pulselistener: Update try_task_config format #1928

Merged
merged 2 commits into from Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/pulselistener/pulselistener/mercurial.py
Expand Up @@ -127,12 +127,11 @@ async def handle_diff(self, diff):
# Build and commit try_task_config.json
config_path = os.path.join(self.repo_dir, 'try_task_config.json')
config = {
'version': 1,
'tasks': [],
'templates': {
'env': {
'PHABRICATOR_DIFF': diff['phid'],
}
'version': 2,
'parameters': {
'target_tasks_method': 'codereview',
'optimize_target_tasks': True,
'phabricator_diff': diff['phid'],
}
}
with open(config_path, 'w') as f:
Expand Down
22 changes: 10 additions & 12 deletions src/pulselistener/tests/test_mercurial.py
Expand Up @@ -50,12 +50,11 @@ async def test_push_to_try(PhabricatorMock, RepoMock):
# Check the try_task_config file
assert os.path.exists(config)
assert json.load(open(config)) == {
'version': 1,
'tasks': [],
'templates': {
'env': {
'PHABRICATOR_DIFF': 'PHID-DIFF-test123',
}
'version': 2,
'parameters': {
'target_tasks_method': 'codereview',
'optimize_target_tasks': True,
'phabricator_diff': 'PHID-DIFF-test123',
}
}

Expand Down Expand Up @@ -129,12 +128,11 @@ def _readme(content):
# Check the try_task_config file
assert os.path.exists(config)
assert json.load(open(config)) == {
'version': 1,
'tasks': [],
'templates': {
'env': {
'PHABRICATOR_DIFF': 'PHID-DIFF-solo',
}
'version': 2,
'parameters': {
'target_tasks_method': 'codereview',
'optimize_target_tasks': True,
'phabricator_diff': 'PHID-DIFF-solo',
}
}

Expand Down