Skip to content

Commit

Permalink
[Integration][ADO] wiql base query update (#1142)
Browse files Browse the repository at this point in the history
  • Loading branch information
oiadebayo authored Nov 12, 2024
1 parent 9fae538 commit a7e4aed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
9 changes: 9 additions & 0 deletions integrations/azure-devops/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- towncrier release notes start -->

## 0.1.83 (2024-11-12)


### Improvements

- Updated wiql base query to use immutable fields for fetching work items related to a project


## 0.1.82 (2024-11-12)


### Improvements


- Bumped ocean version to ^0.13.1


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# Maximum number of work item IDs allowed in a single API request
# (based on Azure DevOps API limitations) https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/work-items/list?view=azure-devops-rest-7.1&tabs=HTTP
MAX_WORK_ITEMS_PER_REQUEST = 200
MAX_WORK_ITEMS_RESULTS_PER_PROJECT = 20000
MAX_WORK_ITEMS_RESULTS_PER_PROJECT = 19999


class AzureDevopsClient(HTTPBaseClient):
Expand Down Expand Up @@ -190,9 +190,7 @@ async def _fetch_work_item_ids(self, project: dict[str, Any]) -> list[int]:
:return: A list of work item IDs.
"""
config = typing.cast(AzureDevopsWorkItemResourceConfig, event.resource_config)
wiql_query = (
f"SELECT [Id] from WorkItems WHERE [System.AreaPath] = '{project['name']}'"
)
wiql_query = f"SELECT [Id] from WorkItems WHERE [System.TeamProject] = '{project['name']}'"

if config.selector.wiql:
# Append the user-provided wiql to the WHERE clause
Expand Down
2 changes: 1 addition & 1 deletion integrations/azure-devops/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "azure-devops"
version = "0.1.82"
version = "0.1.83"
description = "An Azure Devops Ocean integration"
authors = ["Matan Geva <[email protected]>"]

Expand Down

0 comments on commit a7e4aed

Please sign in to comment.