Commit c934f913 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

BAD_ONES

parent bfe4672b
Pipeline #14811 failed with stage
in 2 minutes and 2 seconds
import re
from datetime import timedelta
import github
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.db.models import F, Q
from django.utils import timezone
from rainboard.models import Branch, Forge, Image, Project, Repo, Robotpkg, IssuePr
import github
from rainboard.models import BAD_ONES, Branch, Forge, Image, IssuePr, Project, Repo, Robotpkg
from rainboard.utils import SOURCES, update_robotpkg
MIN_DAYS_SINCE_UPDATED = 10 # Only show issues and pull requests older than this
......@@ -17,8 +17,7 @@ SKIP_LABEL = 'skip dashboard' # Issues and prs with this label will not be adde
def update_issues_pr():
print('\nUpdating issues and pull requests')
for project in Project.objects.filter(archived=False,
main_namespace__from_gepetto=True).exclude(name__endswith='release'):
for project in Project.objects.exclude(BAD_ONES):
try:
gh = project.github()
main_repo = project.repo_set.filter(namespace=project.main_namespace, forge__source=SOURCES.github).first()
......@@ -71,8 +70,7 @@ class Command(BaseCommand):
update_robotpkg(settings.RAINBOARD_RPKG)
log('\nUpdating gepetto projects\n')
for project in Project.objects.filter(archived=False,
main_namespace__from_gepetto=True).exclude(name__endswith='release'):
for project in Project.objects.exclude(BAD_ONES):
log(f' {project}')
project.update(only_main_branches=False)
......
......@@ -50,6 +50,8 @@ TRAVIS_STATE = {'created': None, 'passed': True, 'started': None, 'failed': Fals
GITLAB_STATUS = {'failed': False, 'success': True, 'pending': None, 'skipped': None, 'canceled': None, 'running': None}
GEPETTO_SLUGS = ['gepetto', 'stack-of-tasks', 'humanoid-path-planner', 'loco-3d']
BAD_ONES = Q(main_namespace__from_gepetto=False) | Q(robotpkg__isnull=True) | Q(archived=True)
class Namespace(NamedModel):
group = models.BooleanField(default=False)
......@@ -1291,9 +1293,8 @@ def to_release_in_robotpkg():
def ordered_projects():
""" helper for gepetto/buildfarm/generate_all.py """
fields = 'category', 'name', 'project__main_namespace__slug', 'project__ccache'
bad_ones = Q(main_namespace__from_gepetto=False) | Q(robotpkg__isnull=True) | Q(archived=True)
projects = Project.objects.exclude(bad_ones)
projects = Project.objects.exclude(BAD_ONES)
rpkgs = list(Robotpkg.objects.filter(project__in=projects).values_list(*fields))
deps_cache = {}
......
import django_tables2 as tables
from django.urls import reverse
from django.utils.safestring import mark_safe
import django_tables2 as tables
from . import models, utils
......@@ -34,8 +35,7 @@ class ProjectTable(StrippedTable):
class Meta:
model = models.Project
fields = ('main_namespace', 'name', 'public', 'from_gepetto', 'archived', 'license', 'homepage', 'updated',
'version')
fields = ('main_namespace', 'name', 'public', 'from_gepetto', 'license', 'homepage', 'updated', 'version')
def render_name(self, record):
return record.get_link()
......
from subprocess import PIPE, Popen, run
from django.http import Http404
from django.http.response import HttpResponse, JsonResponse, HttpResponseRedirect
from django.http.response import HttpResponse, HttpResponseRedirect, JsonResponse
from django.urls import reverse
from django.views.generic import DetailView
......@@ -35,8 +35,7 @@ class ProjectsView(SingleTableMixin, FilterView):
class GepettoProjectsView(ProjectsView):
queryset = models.Project.objects.filter(main_namespace__from_gepetto=True,
archived=False).exclude(name__endswith='release')
queryset = models.Project.objects.exclude(models.BAD_ONES)
class ProjectView(DetailView):
......@@ -146,8 +145,7 @@ def docker(request):
def graph_svg(request):
with open('/tmp/graph', 'w') as f:
print('digraph { rankdir=LR;', file=f)
for project in models.Project.objects.filter(main_namespace__from_gepetto=True,
archived=False).exclude(name__endswith='release'):
for project in models.Project.objects.exclude(models.BAD_ONES):
print(f'{{I{project.pk} [label="{project}" URL="{project.get_absolute_url()}"];}}', file=f)
for dep in models.Dependency.objects.filter(project__main_namespace__from_gepetto=True,
library__main_namespace__from_gepetto=True,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment