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


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 import call_command
from 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,
for project in Project.objects.exclude(BAD_ONES):
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):
log('\nUpdating gepetto projects\n')
for project in Project.objects.filter(archived=False,
for project in Project.objects.exclude(BAD_ONES):
log(f' {project}')
......@@ -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/ """
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',
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,
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,
for project in models.Project.objects.exclude(models.BAD_ONES):
print(f'{{I{} [label="{project}" URL="{project.get_absolute_url()}"];}}', file=f)
for dep in models.Dependency.objects.filter(project__main_namespace__from_gepetto=True,
Supports Markdown
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