-
Notifications
You must be signed in to change notification settings - Fork 56
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] Added Support for boards and columns #1034
Changes from 2 commits
38d645e
220ad6c
3474b11
2b8b120
6a90eba
d11050c
dd219f5
968d456
cbf6add
265c930
af6a16c
cde43a3
e85358f
8acbe98
063a3a0
3705816
a8c09a4
650c79b
4efefdd
4419a74
93b748d
a0ee7c6
0d9fe8d
21c7c73
2c12b41
c47035c
f880641
37febe6
ecc3664
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -258,6 +258,49 @@ async def get_repository(self, repository_id: str) -> dict[Any, Any]: | |
repository_data = response.json() | ||
return repository_data | ||
|
||
async def get_columns(self) -> list[dict[str, Any]]: | ||
async for boards in self.get_boards_in_organization(): | ||
for board in boards: | ||
omby8888 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
yield [ | ||
{ | ||
**column, | ||
"__board_id": board.get("id"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. return the full board data instead of just the id There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
"__project": board.get("__project"), | ||
} | ||
for column in board.get("columns", []) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see how this will fit in since the boards API return only name, id and url. How do we get the columns to be returned as part of the boards? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is another function that enriches the data on line 273 |
||
] | ||
|
||
async def _enrich_board( | ||
oiadebayo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
self, boards: list[dict[str, Any]], project_id: str | ||
) -> list[dict[str, Any]]: | ||
for board in boards: | ||
response = await self.send_request( | ||
"GET", | ||
f"{self._organization_base_url}/{project_id}/{API_URL_PREFIX}/work/boards/{board['id']}", | ||
) | ||
board.update(response.json()) | ||
return boards | ||
|
||
async def _get_board(self, project_id: str) -> list[dict[str, Any]]: | ||
oiadebayo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
get_boards_url = ( | ||
f"{self._organization_base_url}/{project_id}/{API_URL_PREFIX}/work/boards" | ||
) | ||
response = await self.send_request("GET", get_boards_url) | ||
board_data = response.json().get("value", []) | ||
logger.info(f"Found {len(board_data)} boards for project {project_id}") | ||
return await self._enrich_board(board_data, project_id) | ||
|
||
@cache_iterator_result() | ||
async def get_boards_in_organization( | ||
self, | ||
) -> AsyncGenerator[list[dict[str, Any]], None]: | ||
async for projects in self.generate_projects(): | ||
yield [ | ||
{**board, "__project": project} | ||
for project in projects | ||
for board in await self._get_board(project["id"]) | ||
] | ||
|
||
async def generate_subscriptions_webhook_events(self) -> list[WebhookEvent]: | ||
headers = {"Content-Type": "application/json"} | ||
try: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make the identifier consistent with the others
azureDevopsBoard
,azureDevopsColumn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The none of the kinds in the default blueprint has this prefix
azureDevops