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] Fix missing team context for non default teams while ingesting boards #1127

Conversation

oiadebayo
Copy link
Member

Description

What:
Updated the Azure DevOps Boards integration to include the team context by modifying the API call structure to iterate through all teams within a project.

Why:
Previously, the integration only retrieved boards at the project level using the /{organization}/{project}/_apis/work/boards endpoint. This approach limited data visibility to the default team's boards, resulting in missing boards and columns from non-default teams.

How:
The integration was modified to use the /{organization}/{project}/{team}/_apis/work/boards endpoint, enabling iteration through all project teams. This change ensures that boards and columns from all teams within a project are included, improving overall data completeness and accuracy.

Type of change

Please leave one option from the following and delete the rest:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • New Integration (non-breaking change which adds a new integration)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Non-breaking change (fix of existing functionality that will not change current behavior)
  • Documentation (added/updated documentation)

All tests should be run against the port production environment(using a testing org).

Core testing checklist

  • Integration able to create all default resources from scratch
  • Resync finishes successfully
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Scheduled resync able to abort existing resync and start a new one
  • Tested with at least 2 integrations from scratch
  • Tested with Kafka and Polling event listeners
  • Tested deletion of entities that don't pass the selector

Integration testing checklist

  • Integration able to create all default resources from scratch
  • Resync able to create entities
  • Resync able to update entities
  • Resync able to detect and delete entities
  • Resync finishes successfully
  • If new resource kind is added or updated in the integration, add example raw data, mapping and expected result to the examples folder in the integration directory.
  • If resource kind is updated, run the integration with the example data and check if the expected result is achieved
  • If new resource kind is added or updated, validate that live-events for that resource are working as expected
  • Docs PR link here

Preflight checklist

  • Handled rate limiting
  • Handled pagination
  • Implemented the code in async
  • Support Multi account

Screenshots

Include screenshots from your environment showing how the resources of the integration will look.

API Documentation

Provide links to the API documentation used for this integration.

@oiadebayo oiadebayo requested a review from a team as a code owner November 7, 2024 09:07
@github-actions github-actions bot added the size/S label Nov 7, 2024
Copy link
Contributor

@PeyGis PeyGis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good. just some minor comments

integrations/azure-devops/CHANGELOG.md Outdated Show resolved Hide resolved
Comment on lines +302 to +303
teams_url = f"{self._organization_base_url}/{API_URL_PREFIX}/projects/{project_id}/teams"
async for teams_in_project in self._get_paginated_by_top_and_skip(teams_url):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a generate_teams() method already. why don't you use that one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generate teams gets the teams outside of the project context and it might not be suitable for this purpose

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see

teams_url = f"{self._organization_base_url}/{API_URL_PREFIX}/projects/{project_id}/teams"
async for teams_in_project in self._get_paginated_by_top_and_skip(teams_url):
for team in teams_in_project:
get_boards_url = f"{self._organization_base_url}/{project_id}/{team.get('id')}/{API_URL_PREFIX}/work/boards"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the team ID is optional, thereby returning None, then let's catch it. If it's mandatory then lets do team["id"]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

Copy link
Contributor

@PeyGis PeyGis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

…on-Missing-Team-Context-for-Non-Default-Teams
Copy link
Contributor

@Tankilevitch Tankilevitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Tankilevitch Tankilevitch changed the title [Integration][ADO] PORT-11197 Fixed Azure DevOps integration missing team context for non default teams while ingesting boards [Integration][ADO] Fix missing team context for non default teams while ingesting boards Nov 7, 2024
@Tankilevitch Tankilevitch merged commit 25140ed into main Nov 7, 2024
18 checks passed
@Tankilevitch Tankilevitch deleted the PORT-11197-Bug-Azure-DevOps-Boards-Integration-Missing-Team-Context-for-Non-Default-Teams branch November 7, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants