Skip to content

Commit 126538a

Browse files
Fixed case where defaultBranch isn't available (#549)
# Description What - Fixed case where ADO integration would fail if default branch isn't provided Why - This is failing the integration from fetching repository policies How - Add the key if exists in the repository data, ignore it if not ## Type of change Please leave one option from the following and delete the rest: - [ ] Bug fix (non-breaking change which fixes an issue) --------- Co-authored-by: Yair Siman Tov <63305203+yairsimantov20@users.noreply.github.com>
1 parent 1867ceb commit 126538a

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

integrations/azure-devops/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
<!-- towncrier release notes start -->
99

10+
# Port_Ocean 0.1.11 (2024-04-15)
11+
12+
### Bug Fixes
13+
14+
- Made defaultBranch not required in the repository body when fetching repository policies
15+
1016
# Port_Ocean 0.1.10 (2024-04-11)
1117

1218
### Improvements

integrations/azure-devops/azure_devops/client/azure_devops_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ async def generate_repository_policies(
102102
for repo in repos:
103103
params = {
104104
"repositoryId": repo["id"],
105-
"refName": repo["defaultBranch"],
106105
}
106+
if default_branch := repo.get("defaultBranch"):
107+
params["refName"] = default_branch
108+
107109
policies_url = f"{self._organization_base_url}/{repo['project']['id']}/{API_URL_PREFIX}/git/policy/configurations"
108110
repo_policies = (
109111
await self.send_request("GET", policies_url, params=params)

integrations/azure-devops/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "azure-devops"
3-
version = "0.1.10"
3+
version = "0.1.11"
44
description = "An Azure Devops Ocean integration"
55
authors = ["Matan Geva <matang@getport.io>"]
66

0 commit comments

Comments
 (0)