diff --git a/backend/apps/github/common.py b/backend/apps/github/common.py index 16bfa7370..59749f689 100644 --- a/backend/apps/github/common.py +++ b/backend/apps/github/common.py @@ -99,11 +99,11 @@ def sync_repository(gh_repository, organization=None, user=None): if release_node_id in existing_release_node_ids: break - # GitHub release author. - if gh_release.author is not None: - author = User.update_data(gh_release.author) - - # GitHub release. + author = ( + User.update_data(gh_release.author) + if gh_release.author and gh_release.author.type != "Bot" + else None + ) releases.append(Release.update_data(gh_release, author=author, repository=repository)) return organization, repository, releases diff --git a/backend/apps/github/management/commands/github_sync_owasp_organization.py b/backend/apps/github/management/commands/github_sync_owasp_organization.py index eb020126c..e8cb08698 100644 --- a/backend/apps/github/management/commands/github_sync_owasp_organization.py +++ b/backend/apps/github/management/commands/github_sync_owasp_organization.py @@ -56,14 +56,14 @@ def handle(self, *_args, **options): gh_repositories_count = gh_repositories.totalCount - offset for idx, gh_repository in enumerate(gh_repositories[offset:]): prefix = f"{idx + offset + 1} of {gh_repositories_count}" - print(f"{prefix:<12} {gh_repository.name}") + entity_key = gh_repository.name.lower() + print(f"{prefix:<12} https://owasp.org/{entity_key}") owasp_organization, repository, new_releases = sync_repository( gh_repository, organization=owasp_organization, user=owasp_user ) releases.extend(new_releases) - entity_key = gh_repository.name.lower() # OWASP chapters. if entity_key.startswith("www-chapter-"): chapters.append(Chapter.update_data(gh_repository, repository, save=False)) diff --git a/backend/apps/github/management/commands/github_sync_related_repositories.py b/backend/apps/github/management/commands/github_sync_related_repositories.py index 1ebac836a..79b64d302 100644 --- a/backend/apps/github/management/commands/github_sync_related_repositories.py +++ b/backend/apps/github/management/commands/github_sync_related_repositories.py @@ -34,7 +34,7 @@ def handle(self, *args, **options): offset = options["offset"] for idx, project in enumerate(active_projects[offset:]): - prefix = f"{idx + offset + 1} of {active_projects_count - offset}" + prefix = f"{idx + offset + 1} of {active_projects_count}" print(f"{prefix:<10} {project.owasp_url}") repository_urls = project.related_urls.copy() diff --git a/backend/apps/owasp/management/commands/owasp_aggregate_projects_data.py b/backend/apps/owasp/management/commands/owasp_aggregate_projects_data.py index 38f0ed093..a6fcf9bf8 100644 --- a/backend/apps/owasp/management/commands/owasp_aggregate_projects_data.py +++ b/backend/apps/owasp/management/commands/owasp_aggregate_projects_data.py @@ -18,8 +18,8 @@ def handle(self, *_args, **options): offset = options["offset"] projects = [] for idx, project in enumerate(active_projects[offset:]): - prefix = f"{idx + offset + 1} of {active_projects_count - offset}" - print(f"{prefix:<10} {project}") + prefix = f"{idx + offset + 1} of {active_projects_count}" + print(f"{prefix:<10} {project.owasp_url}") # Deactivate project with archived repositories. if project.owasp_repository.is_archived: diff --git a/backend/apps/owasp/management/commands/owasp_scrape_site_data.py b/backend/apps/owasp/management/commands/owasp_scrape_site_data.py index f920efffe..e63020331 100644 --- a/backend/apps/owasp/management/commands/owasp_scrape_site_data.py +++ b/backend/apps/owasp/management/commands/owasp_scrape_site_data.py @@ -31,7 +31,7 @@ def handle(self, *args, **options): offset = options["offset"] projects = [] for idx, project in enumerate(active_projects[offset:]): - prefix = f"{idx + offset + 1} of {active_projects_count - offset}" + prefix = f"{idx + offset + 1} of {active_projects_count}" print(f"{prefix:<10} {project.owasp_url}") page_response = requests.get(project.owasp_url, timeout=10)