OpenHands
OpenHands copied to clipboard
feat(backend): add project filtering support
- Add project field to AzureDevOpsServiceImpl and AzureDevOpsMixinBase
- Extract project from base_domain when provided in URL path
- Filter repositories and features by specific project when available
- Fall back to querying all projects when project is not specified
- Improve performance by avoiding unnecessary API calls when project is known
Summary of PR
This PR adds project filtering support to the Azure DevOps integration. When a project is specified in the base_domain URL (e.g., dev.azure.com/org/project), the integration will now filter operations to that specific project instead of querying all projects. This improves performance by reducing unnecessary API calls and provides better scoping for users working with specific projects.
Key Changes:
- Added
projectfield toAzureDevOpsServiceImplandAzureDevOpsMixinBaseclasses - Enhanced URL parsing to extract project name from base_domain when provided
- Updated
get_repos()andget_features()methods to filter by project when available - Maintains backward compatibility by falling back to querying all projects when project is not specified
Change Type
- [x] New feature
- [ ] Bug fix
- [ ] Breaking change
- [ ] Refactor
- [ ] Other (dependency update, docs, typo fixes, etc.)
Checklist
- [ ] I have read and reviewed the code and I understand what the code is doing.
- [ ] I have tested the code to the best of my ability and ensured it works as expected.
Release Notes
- [x] Include this change in the Release Notes.
Release Notes Description:
Added project filtering support for Azure DevOps integration. Users can now specify a project in the base_domain URL (e.g., dev.azure.com/org/project) to scope repository and feature queries to a specific project, improving performance and reducing API calls.
Technical Details
Files Modified:
openhands/integrations/azure_devops/azure_devops_service.py: Added project field and extraction logicopenhands/integrations/azure_devops/service/base.py: Added project field to base mixinopenhands/integrations/azure_devops/service/features.py: Added project filtering to features queryopenhands/integrations/azure_devops/service/repos.py: Added project filtering to repositories query
Implementation Notes:
- The project is extracted from the URL path when
base_domaincontains a project segment (format:org/project) - When a project is specified, operations are scoped to that project only
- When no project is specified, the behavior remains unchanged (queries all projects)
- This change is backward compatible and does not affect existing integrations