Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/port-labs/ocean into PORT-1…
Browse files Browse the repository at this point in the history
…1280-Bug-Gitlab-integration-doesnt-perform-Glob-queries-properly
  • Loading branch information
shariff-6 committed Jan 16, 2025
2 parents 575dc0a + 9b801b0 commit b347e05
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 9 deletions.
8 changes: 8 additions & 0 deletions integrations/gitlab/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Fixed glob pattern matching by utilizing GitLab's glob path search capabilities instead of pattern matching.

0.2.21 (2025-01-16)
===================

### Bug Fixes

- Fixed UserWarning log caused by not setting the `get_all` parameter for `project.label.list` request


0.2.20 (2025-01-16)
===================

Expand Down
4 changes: 3 additions & 1 deletion integrations/gitlab/gitlab_integration/core/async_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
User,
GroupMember,
ProjectFile,
ProjectLabel,
)
from loguru import logger

Expand Down Expand Up @@ -44,14 +45,14 @@ async def fetch_single(
],
*args,
) -> Union[
RESTObject,
RESTObject,
ProjectPipelineJob,
ProjectPipeline,
Issue,
Project,
Group,
ProjectFile,
ProjectLabel,
]:
with ThreadPoolExecutor() as executor:
return await get_event_loop().run_in_executor(executor, fetch_func, *args)
Expand Down Expand Up @@ -92,6 +93,7 @@ async def fetch_batch(
List[RESTObject],
List[Dict[str, Any]],
GitlabList,
List[ProjectLabel],
]
]:
def fetch_page(
Expand Down
13 changes: 10 additions & 3 deletions integrations/gitlab/gitlab_integration/gitlab_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ProjectFile,
ProjectPipeline,
ProjectPipelineJob,
ProjectLabel,
Hook,
)
from gitlab_integration.core.async_fetcher import AsyncFetcher
Expand Down Expand Up @@ -541,9 +542,15 @@ async def get_all_projects(self) -> typing.AsyncIterator[List[Project]]:
@classmethod
async def async_project_labels_wrapper(cls, project: Project) -> dict[str, Any]:
try:
labels = await anyio.to_thread.run_sync(project.labels.list)
serialized_labels = [label.attributes for label in labels]
return {"__labels": serialized_labels}
all_labels = [
label.attributes
async for labels_batch in AsyncFetcher.fetch_batch(
fetch_func=project.labels.list
)
for label in typing.cast(List[ProjectLabel], labels_batch)
]

return {"__labels": all_labels}
except Exception as e:
logger.warning(
f"Failed to get labels for project={project.path_with_namespace}. error={e}"
Expand Down
8 changes: 4 additions & 4 deletions integrations/jira/.port/resources/port-app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ resources:
status: .fields.status.name
issueType: .fields.issuetype.name
components: .fields.components
creator: .fields.creator.emailAddress // ""
creator: .fields.creator.emailAddress
priority: .fields.priority.name
labels: .fields.labels
created: .fields.created
updated: .fields.updated
resolutionDate: .fields.resolutiondate // ""
resolutionDate: .fields.resolutiondate
relations:
project: .fields.project.key
parentIssue: .fields.parent.key // ""
parentIssue: .fields.parent.key
subtasks: .fields.subtasks | map(.key)
assignee: .fields.assignee.accountId // ""
assignee: .fields.assignee.accountId
reporter: .fields.reporter.accountId
8 changes: 8 additions & 0 deletions integrations/jira/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- towncrier release notes start -->

## 0.2.24 (2025-01-16)


### Bug Fixes

- Updated default mapping for Jira Issue to use by removing `""` to prevent `parentIssue` error spam


## 0.2.23 (2025-01-16)


Expand Down
2 changes: 1 addition & 1 deletion integrations/jira/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "jira"
version = "0.2.23"
version = "0.2.24"
description = "Integration to bring information from Jira into Port"
authors = ["Mor Paz <[email protected]>"]

Expand Down

0 comments on commit b347e05

Please sign in to comment.