Skip to content
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

Add ability to exclude project from issue syncing/indexing #45

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/apps/github/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def sync_repository(gh_repository, organization=None, user=None):
)

# GitHub repository issues.
if not repository.is_archived and repository.project:
if not repository.is_archived and repository.project and repository.sync_issues:
# Sync open issues for the first run.
kwargs = {
"direction": "asc",
Expand Down
2 changes: 2 additions & 0 deletions backend/apps/github/models/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Meta:
has_pages = models.BooleanField(verbose_name="Has pages", default=False)
has_projects = models.BooleanField(verbose_name="Has projects", default=False)
has_wiki = models.BooleanField(verbose_name="Has wiki", default=False)
sync_issues = models.BooleanField(verbose_name="Sync Issues", default=True)

commits_count = models.PositiveIntegerField(verbose_name="Commits", default=0)
contributors_count = models.PositiveIntegerField(verbose_name="Contributors", default=0)
Expand Down Expand Up @@ -106,6 +107,7 @@ def is_indexable(self):
not self.is_archived
and not self.is_empty
and not self.is_template
and self.sync_issues
and self.project_set.exists()
)

Expand Down
1 change: 1 addition & 0 deletions backend/apps/owasp/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class ProjectType(models.TextChoices):
pushed_at = models.DateTimeField(verbose_name="Pushed at", blank=True, null=True)
updated_at = models.DateTimeField(verbose_name="Updated at", blank=True, null=True)

sync_issues = models.BooleanField(verbose_name="Sync Issues", default=True)
# FKs.
owasp_repository = models.ForeignKey(
"github.Repository",
Expand Down