Skip to content

Commit

Permalink
Merge pull request #206 from Microsoft/dev
Browse files Browse the repository at this point in the history
Merge dev into master for 0.1.3
  • Loading branch information
tedchamb committed Sep 5, 2018
2 parents 9094071 + dc08988 commit d212e20
Show file tree
Hide file tree
Showing 23 changed files with 77 additions and 36 deletions.
4 changes: 2 additions & 2 deletions packaged_releases/windows/scripts/build_local.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ set "PATH=%PATH%;%ProgramFiles%\Git\bin;%ProgramFiles%\Git\usr\bin"

if "%CLIVERSION%"=="" (
if "%BUILD_BUILDID%" == "" (
set CLIVERSION=0.1.2
set CLIVERSION=0.1.3
) else (
set CLIVERSION=0.1.2.%BUILD_BUILDID%
set CLIVERSION=0.1.3.%BUILD_BUILDID%
)
)
set PYTHON_VERSION=3.6.3
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/vsts-cli-admin/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-admin'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
4 changes: 2 additions & 2 deletions src/command_modules/vsts-cli-admin/vsts/cli/admin/_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def _transform_banner_row(key, value):
level = value['level']
if level is not None and level != '':
level = level[0:1].upper() + level[1:]
table_row['Level'] = level
table_row['Type'] = level
else:
table_row['Level'] = 'Info'
table_row['Type'] = 'Info'
if 'expirationDate' in value:
table_row['Expiration Date'] = value['expirationDate']
else:
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/vsts-cli-build/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-build'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/vsts-cli-code/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-code'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def load_code_arguments(cli_command_loader):
ac.argument('detect', **enum_choice_list(_ON_OFF_SWITCH_VALUES))

with ArgumentsContext(cli_command_loader, 'code pr') as ac:
ac.argument('description', type=str, options_list=('--description', '-d'))
ac.argument('description', type=str, options_list=('--description', '-d'), nargs='*')
ac.argument('pull_request_id', type=int, options_list='--id')
ac.argument('repository', options_list=('--repository', '-r'))
ac.argument('source_branch', options_list=('--source-branch', '-s'))
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/vsts-cli-package/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-package'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/vsts-cli-team/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-team'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/vsts-cli-work/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-work'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def load_work_arguments(cli_command_loader):
ac.argument('work_item_id', type=int, options_list='--id')
ac.argument('work_item_type', type=str, options_list='--type')
ac.argument('fields', nargs='*', options_list=('--fields', '-f'))
ac.argument('description', options_list=('--description', '-d'))

with ArgumentsContext(cli_command_loader, 'work item query') as ac:
ac.argument('query_id', type=str, options_list='--id')
2 changes: 1 addition & 1 deletion src/common_modules/vsts-cli-admin-common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-admin-common'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
2 changes: 1 addition & 1 deletion src/common_modules/vsts-cli-build-common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-build-common'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ def build_queue(definition_id=None, definition_name=None, branch=None, variables
if branch is None:
branch = source_branch
team_instance, project = resolve_instance_and_project(detect=detect,
team_instance=team_instance,
project=project)
team_instance=team_instance,
project=project)
if definition_id is None and definition_name is None:
raise ValueError('Either the --definition-id argument or the --definition-name argument ' +
'must be supplied for this command.')
'must be supplied for this command.')
client = get_build_client(team_instance)
if definition_id is None:
definition_id = get_definition_id_from_name(definition_name, client, project)
Expand All @@ -57,9 +57,9 @@ def build_queue(definition_id=None, definition_name=None, branch=None, variables
if variables is not None and variables:
build.parameters = {}
for variable in variables:
kvp = variable.split('=')
if len(kvp) == 2:
build.parameters[kvp[0]] = kvp[1]
separator_pos = variable.find('=')
if separator_pos >= 0:
build.parameters[variable[:separator_pos]] = variable[separator_pos + 1:]
else:
raise ValueError('The --variables argument should consist of space separated "name=value" pairs.')
queued_build = client.queue_build(build=build, project=project)
Expand Down
2 changes: 1 addition & 1 deletion src/common_modules/vsts-cli-code-common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-code-common'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ def create_pull_request(project=None, repository=None, source_branch=None, targe
:type target_branch: str
:param title: Title for the new pull request.
:type title: str
:param description: Description for the new pull request. Can include markdown.
:type description: str
:param description: Description for the new pull request. Can include markdown. Each value sent to this arg will be a new line.
For example: --description "First Line" "Second Line"
:type description: list of str
:param auto_complete: Set the pull request to complete automatically when all policies have passed and
the source branch can be merged into the target branch.
:type auto_complete: bool
Expand Down Expand Up @@ -174,9 +175,13 @@ def create_pull_request(project=None, repository=None, source_branch=None, targe
target_branch = _get_default_branch(team_instance, project, repository)
if target_branch is None:
raise ValueError('The target branch could not be detected, please '
+ 'provide the --target-branch argument.')
+ 'provide the --target-branch argument.')
client = get_git_client(team_instance)
pr = GitPullRequest(description=description, source_ref_name=source_branch,
if description is not None:
multi_line_description = '\n'.join(description)
else:
multi_line_description = None
pr = GitPullRequest(description=multi_line_description, source_ref_name=source_branch,
target_ref_name=target_branch)
if title is not None:
pr.title = title
Expand Down Expand Up @@ -242,8 +247,9 @@ def update_pull_request(pull_request_id, title=None, description=None, auto_comp
:type pull_request_id: int
:param title: New title for the pull request.
:type title: str
:param description: New description for the pull request.
:type description: str
:param description: New description for the pull request. Can include markdown. Each value sent to this
arg will be a new line. For example: --description "First Line" "Second Line"
:type description: list of str
:param auto_complete: Set the pull request to complete automatically when all policies have passed and
the source branch can be merged into the target branch.
:type auto_complete: str
Expand Down Expand Up @@ -271,7 +277,11 @@ def update_pull_request(pull_request_id, title=None, description=None, auto_comp
team_instance = resolve_instance(detect=detect, team_instance=team_instance)
client = get_git_client(team_instance)
existing_pr = client.get_pull_request_by_id(pull_request_id)
pr = GitPullRequest(title=title, description=description)
if description is not None:
multi_line_description = '\n'.join(description)
else:
multi_line_description = None
pr = GitPullRequest(title=title, description=multi_line_description)
if (bypass_policy is not None
or bypass_policy_reason is not None
or squash is not None
Expand Down
2 changes: 1 addition & 1 deletion src/common_modules/vsts-cli-common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-common'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

logger = get_logger(__name__)

VERSION = "0.1.2"
VERSION = "0.1.3"

DISABLE_VERSION_CHECK_SETTING = "disable_version_check"
_VERSION_INFO_LINK = "https://aka.ms/vsts-cli-update-json"
Expand Down
2 changes: 1 addition & 1 deletion src/common_modules/vsts-cli-package-common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-package-common'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ def wait(self):
# Ensure process completed, and emit error if returncode is non-zero (including any remaining stderr)
self._proc.wait()
if self._proc.returncode != 0 and not self._terminating:
stderr = self._proc.stderr.read().strip()
stderr = self._proc.stderr.read().decode('utf-8').strip()
if stderr != "":
stderr = "\n" + stderr
stderr = "\n{}".format(stderr)
raise CLIError("Process {proc} with PID {pid} exited with return code {code}{err}".format(proc=self._args, pid=self._proc.pid, code=self._proc.returncode, err=stderr))
return self._proc

Expand All @@ -67,7 +67,8 @@ def run(self, command_args, env, initial_progress_text, stderr_handler):
# Start the process, process stderr for progress reporting, check the process result
self.start(command_args, env)
try:
for line in iter(self._proc.stderr.readline, b''):
for bline in iter(self._proc.stderr.readline, b''):
line = bline.decode('utf-8').strip()
stderr_handler(line, self._update_progress)
return self.wait()
except IOError as ex:
Expand Down
2 changes: 1 addition & 1 deletion src/common_modules/vsts-cli-team-common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-team-common'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
2 changes: 1 addition & 1 deletion src/common_modules/vsts-cli-work-common/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli-work-common'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
2 changes: 1 addition & 1 deletion src/vsts-cli/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = 'vsts-cli'
VERSION = '0.1.2'
VERSION = '0.1.3'

# To install the library, run the following
#
Expand Down
29 changes: 29 additions & 0 deletions vsts-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/vsts/pipelines/apps/windows/dot-net

queue: 'Hosted VS2017'

variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@0

- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'

- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

0 comments on commit d212e20

Please sign in to comment.