Skip to content
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

Removing task definition list and show commands #525

Merged
merged 5 commits into from
Apr 9, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions azure-devops/azext_devops/dev/pipelines/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,31 +96,6 @@ def _transform_definition_row(row, include_draft_column=False):
return table_row


def transform_tasks_table_output(result):
table_output = []
for item in sorted(result, key=_get_task_key):
table_output.append(_transform_task_row(item))
return table_output


def transform_task_table_output(result):
table_output = [_transform_task_row(result)]
return table_output


def _transform_task_row(row):
table_row = OrderedDict()
table_row['ID'] = row['id']
table_row['Name'] = row['name']
table_row['Author'] = row['author']
table_row['Version'] = '.'.join([str(row['version']['major']),
str(row['version']['minor']),
str(row['version']['patch'])])
if row['version']['isTest']:
table_row['Version'] += '*'
return table_row


def _get_task_key(row):
return row['name'].lower()

Expand Down
6 changes: 0 additions & 6 deletions azure-devops/azext_devops/dev/pipelines/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ def load_pipelines_help():
long-summary:
"""

helps['pipelines build task'] = """
type: group
short-summary: Manage build pipelines task.
long-summary:
"""

helps['pipelines release'] = """
type: group
short-summary: Manage releases.
Expand Down
7 changes: 0 additions & 7 deletions azure-devops/azext_devops/dev/pipelines/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
transform_build_tags_output,
transform_definition_table_output,
transform_definitions_table_output,
transform_tasks_table_output,
transform_task_table_output,
transform_releases_table_output,
transform_release_table_output,
transform_release_definitions_table_output,
Expand Down Expand Up @@ -66,11 +64,6 @@ def load_build_commands(self, _):
g.command('list', 'build_definition_list', table_transformer=transform_definitions_table_output)
g.command('show', 'build_definition_show', table_transformer=transform_definition_table_output)

with self.command_group('pipelines build task', command_type=buildTaskOps) as g:
# basic build task commands
g.command('list', 'task_list', table_transformer=transform_tasks_table_output)
g.command('show', 'task_show', table_transformer=transform_task_table_output)

with self.command_group('pipelines release', command_type=releaseOps) as g:
# basic release commands
g.command('list', 'release_list', table_transformer=transform_releases_table_output)
Expand Down
38 changes: 0 additions & 38 deletions azure-devops/azext_devops/dev/pipelines/task.py

This file was deleted.

34 changes: 22 additions & 12 deletions scripts/backCompatChecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
allowedMissingArguments['devops service-endpoint create'] = ['--azure-rm-service-prinicipal-key']
allowedMissingArguments['pipelines build queue'] = ['--source-branch']

# Do not compare these commands
ignoreCommands = []
ignoreCommands.append('pipelines build task list')
ignoreCommands.append('pipelines build task show')

class Arguments(dict):
def __init__(self, command, name, isRequired):
self.command = command
Expand Down Expand Up @@ -81,8 +86,12 @@ def findExtension():
# get a set of old commands, we are not reusing the set from ext because we want to keep this clean
oldCommands = []
for oldArgument in oldArguments:
if not any(oldArgument.command in s for s in oldCommands):
oldCommands.append(oldArgument.command)
if oldArgument.command not in ignoreCommands:
if not any(oldArgument.command in s for s in oldCommands):
oldCommands.append(oldArgument.command)
else:
print('Ignoring command.. ' + oldArgument.command)


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not required.
There were other issues which I fixed.

# prepare argument set from new extension
for oldCommand in oldCommands:
Expand All @@ -104,16 +113,17 @@ def findExtension():

# make sure no argument is removed
for oldArgument in oldArguments:
isArgumentMissing = True
for newArgument in newArguments:
if oldArgument.name == newArgument.name and oldArgument.command == newArgument.command:
isArgumentMissing = False
break

if isArgumentMissing is True:
allowedMissingArgumetsForCommand = allowedMissingArguments.get(oldArgument.command, [])
if not oldArgument.name in allowedMissingArgumetsForCommand:
errorList.append('Argument missing for command ' + oldArgument.command + ' argument ' + oldArgument.name)
if oldArgument.command not in ignoreCommands:
isArgumentMissing = True
for newArgument in newArguments:
if oldArgument.name == newArgument.name and oldArgument.command == newArgument.command:
isArgumentMissing = False
break

if isArgumentMissing is True:
allowedMissingArgumetsForCommand = allowedMissingArguments.get(oldArgument.command, [])
if not oldArgument.name in allowedMissingArgumetsForCommand:
errorList.append('Argument missing for command ' + oldArgument.command + ' argument ' + oldArgument.name)

if len(errorList) > 0:
print(' '.join(errorList))
Expand Down
8,597 changes: 0 additions & 8,597 deletions tests/recordings/test_build_task_listShow.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions tests/test_pipelinesBuildTaskTest.py

This file was deleted.