Skip to content

Commit

Permalink
added more logs to file kind
Browse files Browse the repository at this point in the history
  • Loading branch information
mk-armah committed Oct 28, 2024
1 parent ac9347f commit 1f9b936
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions integrations/gitlab/gitlab_integration/gitlab_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ async def search_files_in_project(
parsed_files = await asyncio.gather(*tasks)
files_with_content = [file for file in parsed_files if file]
if files_with_content:
logger.info(
f"Found {len(files_with_content)} files with content for project {project.path_with_namespace}: {[file.file_name for file in files_with_content]}"
)
yield files_with_content

async def _get_entities_from_git(
Expand Down
7 changes: 5 additions & 2 deletions integrations/gitlab/gitlab_integration/ocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ async def resync_files(kind: str) -> ASYNC_GENERATOR_RESYNC_TYPE:
"GitLabFilesResourceConfig", event.resource_config
)
if not isinstance(gitlab_resource_config, GitLabFilesResourceConfig):
logger.error("Invalid resource config type for GitLab files resync")
return

selector = gitlab_resource_config.selector
Expand All @@ -201,7 +202,7 @@ async def resync_files(kind: str) -> ASYNC_GENERATOR_RESYNC_TYPE:
):
projects_processed_in_full_batch += len(projects_batch)
logger.info(
f"Processing projects files for {projects_processed_in_full_batch}/{len(projects)} projects in batch"
f"Processing project files for {projects_processed_in_full_batch}/{len(projects)} projects in batch: {[project.path_with_namespace for project in projects_batch]}"
)
tasks = [
service.search_files_in_project(project, selector.files.path)
Expand All @@ -214,7 +215,9 @@ async def resync_files(kind: str) -> ASYNC_GENERATOR_RESYNC_TYPE:
async for batch in stream_async_iterators_tasks(*tasks):
yield batch
else:
logger.info("No relevant projects were found in batch, skipping it")
logger.info(
f"No relevant projects were found in batch for path '{selector.files.path}', skipping it"
)


@ocean.on_resync(ObjectKind.MERGE_REQUEST)
Expand Down

0 comments on commit 1f9b936

Please sign in to comment.