ocean icon indicating copy to clipboard operation
ocean copied to clipboard

[Integration][ADO] Added folder mapping to integration defaults

Open oiadebayo opened this issue 3 days ago • 2 comments

User description

Description

What - Added folder kind to default integration mapping with wildcard pattern support and made project/repo selection optional

Why - Make folder discovery easier by providing sensible defaults (//* pattern) and allowing users to scan all repositories without explicit configuration

How - Added folder mapping to default port-app-config.yaml, made project_name and repos optional in selector models

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)
  • [x] 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
  • [ ] Completed a full resync from a freshly installed integration and it completed successfully
  • [ ] 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.


PR Type

Enhancement


Description

  • Added folder kind support to Azure DevOps integration defaults

  • Made project_name and repos optional for flexible scanning

  • Implemented wildcard pattern support for folder discovery

  • Added support for scanning all projects and repositories


Diagram Walkthrough

flowchart LR
  A["Folder Patterns"] --> B["Optional Project Name"]
  A --> C["Optional Repos List"]
  B --> D["All Projects Mode"]
  B --> E["Specific Project Mode"]
  C --> F["Global Patterns"]
  C --> G["Repo-Specific Patterns"]
  D --> H["Process All Repositories"]
  E --> I["Process Project Repositories"]
  F --> H
  G --> I

File Walkthrough

Relevant files
Enhancement
azure_devops_client.py
Enhanced folder pattern processing with optional parameters

integrations/azure-devops/azure_devops/client/azure_devops_client.py

  • Made repo_mapping parameter optional in _process_pattern method
  • Added _get_repositories_for_project method to fetch repositories for
    specific project
  • Refactored process_folder_patterns to support optional project_name
    and global patterns
  • Implemented logic to apply patterns to all repositories when repos
    list is empty
  • Added support for scanning all projects when project_name is None
+52/-25 
Bug fix
file_entity_processor.py
Improved repository payload parsing with fallbacks             

integrations/azure-devops/azure_devops/gitops/file_entity_processor.py

  • Updated parse_repository_payload to extract repository ID from
    fallback location
  • Added fallback logic for branch extraction from __branch field
  • Improved robustness of data extraction from folder entities
+4/-2     
Configuration changes
misc.py
Made selector fields optional for flexible configuration 

integrations/azure-devops/azure_devops/misc.py

  • Changed FolderPattern.path from default empty string to required field
  • Made project_name optional in AzureDevopsFolderSelector with default
    None
  • Updated project_name description to indicate all-projects scanning
    capability
  • Made repos field optional in FolderPattern to support global patterns
+4/-4     
port-app-config.yaml
Added default folder kind resource configuration                 

integrations/azure-devops/.port/resources/port-app-config.yaml

  • Added folder kind resource mapping to default configuration
  • Configured wildcard pattern */*/* for folder discovery
  • Added folder entity mappings with identifier, title, and properties
  • Included repository URL and README file references for folders
+17/-0   
Tests
test_azure_devops_client.py
Added test fixtures for project repository retrieval         

integrations/azure-devops/tests/azure_devops/client/test_azure_devops_client.py

  • Added mock_get_repositories_for_project mock method for testing
  • Extended test fixtures to support project-specific repository
    retrieval
  • Added mock data for multiple repositories with different branches
+30/-0   
Documentation
CHANGELOG.md
Documented version 0.5.0 release features                               

integrations/azure-devops/CHANGELOG.md

  • Added version 0.5.0 release notes
  • Documented folder kind feature with wildcard pattern support
  • Listed optional project_name and repos configuration changes
  • Highlighted flexible repository selection capabilities
+11/-0   
Dependencies
pyproject.toml
Updated package version to 0.5.0                                                 

integrations/azure-devops/pyproject.toml

  • Bumped version from 0.4.39 to 0.5.0
+1/-1     

oiadebayo avatar Nov 26 '25 09:11 oiadebayo