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

[Integration][ADO] wiql base query update #1142

Merged
merged 4 commits into from
Nov 12, 2024
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
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 <matang@getport.io>"]

Expand Down