Skip to content

Commit

Permalink
Allow for specifying an Azure DevOps repository by name. Fixes #683. (#…
Browse files Browse the repository at this point in the history
…691)

* Allow for specifying an Azure DevOps repository by name. Fixes #683.
  • Loading branch information
fniessink authored Oct 16, 2019
1 parent ef70776 commit dcd8a1f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/collector/src/source_collectors/azure_devops.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,15 @@ class AzureDevopsSourceUpToDateness(SourceCollector):
"""Collector class to measure the up-to-dateness of a repo or folder/file in a repo."""

def _api_url(self) -> URL:
url = super()._api_url()
url = str(super()._api_url())
repository = self._parameter("repository", quote=True)
path = self._parameter("file_path", quote=True)
branch = self._parameter("branch", quote=True)
project = url.split("/")[-1]
search_criteria = \
f"searchCriteria.itemPath={path}&searchCriteria.itemVersion.version={branch}&searchCriteria.$top=1"
return URL(f"{url}/_apis/git/repositories/{repository}/commits?{search_criteria}&api-version=4.1")
return URL(
f"{url}/_apis/git/repositories/{repository}/commits?{search_criteria}&project={project}&api-version=4.1")

def _parse_source_responses_value(self, responses: Responses) -> Value:
return str(days_ago(parse(responses[0].json()["value"][0]["committer"]["date"])))
Expand Down
5 changes: 5 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

- Allow for specifying an Azure DevOps repository by name. Fixes [#683](https://github.com/ICTU/quality-time/issues/683).
- Remove white space at the top of the page in printouts. Fixes [#685](https://github.com/ICTU/quality-time/issues/685).

### Changed

- Quality-time now uses Python 3.8 for the collector and server components. Closes [#684](https://github.com/ICTU/quality-time/issues/684).

## [0.12.1] - [2019-10-14]

### Fixed
Expand Down

0 comments on commit dcd8a1f

Please sign in to comment.