-
Notifications
You must be signed in to change notification settings - Fork 130
[Integration][Bitbucket server] Improve resync performance for large deployments #2364
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
base: main
Are you sure you want to change the base?
Conversation
Add configurable page size, concurrent PR fetching, flexible rate limiting, and project filtering to improve sync performance for large deployments. - Add 6 new optional config parameters - Implement parallel PR fetching with semaphore control - Add project filtering with regex/suffix patterns
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
…tegration resync delay
Co-authored-by: Michael Kofi Armah <mikeyarmah@gmail.com>
- Removed default rate limit constants and added validation to ensure both `rate_limit` and `rate_limit_window` are provided during `BitbucketClient` initialization. - Updated `initialize_client` methods in `utils.py` and `webhook_client.py` to use configuration values for rate limits. - Adjusted tests to reflect changes in client initialization and ensure proper handling of rate limits.
| ## 0.1.71-beta (2025-11-17) | ||
|
|
||
|
|
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.
You might have unintentionally deleted this
| type: boolean | ||
| description: Whether the Bitbucket Server version is 8.7 or older | ||
| required: false | ||
| - name: bitbucketRateLimit |
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.
| - name: bitbucketRateLimit | |
| - name: bitbucketRateLimitQuota |
| ) | ||
| if projects_filter: | ||
| yield await self._get_projects_with_filter(projects_filter) | ||
| filtered_projects = await self._get_projects_with_filter(projects_filter) |
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.
Why do we have this an then the regex filter? What does this do that can't be achieved in the regular expression?
| ocean.integration_config.get("bitbucket_is_version8_point7_or_older"), | ||
| config.get("bitbucket_is_version8_point7_or_older"), | ||
| ), | ||
| rate_limit=int(config["bitbucket_rate_limit"]), |
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.
| rate_limit=int(config["bitbucket_rate_limit"]), | |
| rate_limit=int(config["bitbucket_rate_limit_quota"]), |
| ocean.integration_config.get("bitbucket_is_version8_point7_or_older"), | ||
| config.get("bitbucket_is_version8_point7_or_older"), | ||
| ), | ||
| rate_limit=int(config["bitbucket_rate_limit"]), |
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.
Same as above
User description
Description
What
Why
How
Type of change
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examplesfolder in the integration directory.Preflight checklist
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
Add 6 configurable performance optimization parameters to Bitbucket Server integration
Implement parallel PR fetching with semaphore-controlled concurrency
Add project filtering by regex patterns and suffix matching
Make pagination page size and rate limiting configurable
Diagram Walkthrough
File Walkthrough
client.py
Add configurable performance optimizations and project filteringintegrations/bitbucket-server/client.py
rate_limit_window, page_size, max_concurrent_requests,
projects_filter_regex, projects_filter_suffix)
_should_include_project()method for regex andsuffix-based project filtering
asyncio.BoundedSemaphorefor controlling concurrent PR requestsget_paginated_resource()to use configurable page sizeget_projects()to apply regex/suffix filters to projectbatches
get_pull_requests()to use semaphore-controlled parallelfetching with
semaphore_async_iteratorutils.py
Update client initialization with new config parametersintegrations/bitbucket-server/utils.py
initialize_client()to extract and pass all 6 newconfiguration parameters
concurrency settings
webhook_client.py
Update webhook client initialization with config parametersintegrations/bitbucket-server/webhook_processors/webhook_client.py
initialize_client()function to extract and pass all 6 newconfiguration parameters
test_client.py
Add comprehensive tests for performance optimizationsintegrations/bitbucket-server/tests/test_client.py
and concurrency
patterns, and combined filters
spec.yaml
Add configuration spec for performance optimization parametersintegrations/bitbucket-server/.port/spec.yaml
bitbucketRateLimit(default: 1000) andbitbucketRateLimitWindow(default: 3600)bitbucketPageSize(default: 25) andbitbucketMaxConcurrentRequests(default: 10)bitbucketProjectsFilterRegexandbitbucketProjectsFilterSuffixfor project filtering
pyproject.toml
Bump version to 0.1.63-betaintegrations/bitbucket-server/pyproject.toml
CHANGELOG.md
Update changelog with version 0.1.63-beta releaseintegrations/bitbucket-server/CHANGELOG.md