Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

issue-detail: matrix of Tree x Nth checkout (cell links to checkout)

Aperta
#1,960 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
django, python
Ambito
full-stack

Direzione di ricerca

Inizia dalla vista dei dettagli dell’issue e verifica come sono attualmente esposti i dati di Checkouts e Incidents. Usa come obiettivo la matrice proposta tree/date/checkout-index, con ogni cella che rimanda al relativo checkout e indica un incidente o N/A quando appropriato; conferma i trees interessati e l’intervallo di date in base ai dati dell’issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

unrefined

This is just an idea, but I wonder how an issue with multiple trees like https://d.kernelci.org/issue/maestro:96417cd30041ab8f3153128d0120c6cd70782d99?iv=1

would look in a matrix built from something like

# context: issue

from django.db.models import Exists, OuterRef, F, Window
from django.db.models.functions import Cast, RowNumber
from django.db.models import DateField

# 1. Get affected trees (same as before)
affected_trees = (
    issue.incidents_set
    .order_by("build__checkout__tree_name")
    .values_list("build__checkout__tree_name", flat=True)
    .distinct()
)

# 2. Query checkouts and calculate the sequential Nth checkout per day
grid_data = (
    Checkouts.objects.filter(
        start_time__gte=issue.first_seen,
        start_time__lte=issue.last_seen,
        tree_name__in=affected_trees
    )
    .annotate(
        date=Cast("start_time", DateField()),
        # Calculate Nth checkout per tree, per day
        checkout_index=Window(
            expression=RowNumber(),
            partition_by=[F("tree_name"), Cast("start_time", DateField())],
            order_by=F("start_time").asc()
        )
    )
    .annotate(
        has_incident=Exists(
            Incidents.objects.filter(
                issue=issue,
                build__checkout=OuterRef("id")
            )
        )
    )
    # Convert to values so the Window function evaluates cleanly into a dict
    .values("id", "tree_name", "date", "checkout_index", "has_incident")
    .order_by("tree_name", "date", "checkout_index")
)

# ---

from collections import defaultdict

# Initialize a structure: table[tree_name][date_index_label] = has_incident
table_matrix = defaultdict(dict)

# We also keep track of all unique labels seen to use as your table headers
all_column_headers = set()

for entry in grid_data:
    tree = entry["tree_name"]
    date_str = entry["date"].strftime("%Y-%m-%d")
    index = entry["checkout_index"]
    
    # Create your custom key string
    column_label = f"{date_str} - #{index}"
    
    # Store it in the matrix
    table_matrix[tree][column_label] = entry["has_incident"]
    all_column_headers.add(column_label)

# Sort headers chronologically & sequentially for your frontend table columns
sorted_headers = sorted(list(all_column_headers))

To achieve something like

Tree Name 2026-06-24 - #1 2026-06-24 - #2 2026-06-25 - #1
Tree X ✅ Pass ❌ Incident ✅ Pass
Tree Y ✅ Pass N/A ❌ Incident
Lingua principale
Python
Stelle
10
Fork
32
Merge medio
2g 23h
PR unite (30g)
26

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di kernelci/dashboard

Tutte le issue di kernelci/dashboard

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.