Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
856882d
Migrate to schemathesis and add rest fuzz tests
ahmedxgouda Dec 31, 2025
95fa30b
Apply cspell
ahmedxgouda Dec 31, 2025
ab17c1a
Update Fuzz Dockerfile context
ahmedxgouda Dec 31, 2025
ee2db6a
Update rest auth for fuzz
ahmedxgouda Jan 1, 2026
53680ff
Optimize Project Health Stats query and split rest and graphql tests
ahmedxgouda Jan 1, 2026
ad9f80f
Split rest and graphql tests workflows
ahmedxgouda Jan 1, 2026
f499fe3
Update ci/cd
ahmedxgouda Jan 1, 2026
bf36420
Apply rabbit suggestions
ahmedxgouda Jan 1, 2026
9a2469d
Update ci/cd
ahmedxgouda Jan 1, 2026
62cf309
Apply rabbit's suggestions
ahmedxgouda Jan 1, 2026
90229b3
Increase number of examples
ahmedxgouda Jan 1, 2026
32e8cf0
Apply rabbit's suggestions
ahmedxgouda Jan 1, 2026
55f9c93
Apply pre-commit checks
ahmedxgouda Jan 1, 2026
72f1455
Merge branch 'feature/e2e-backend' into e2e/migrate-to-schemathesis
ahmedxgouda Jan 2, 2026
76317b6
Merge branch 'feature/e2e-backend' into e2e/migrate-to-schemathesis
ahmedxgouda Jan 3, 2026
15a5338
Update CI/CD
ahmedxgouda Jan 3, 2026
8e94807
Update makefile
ahmedxgouda Jan 3, 2026
e7c2a83
Update CI/CD
ahmedxgouda Jan 3, 2026
9bfc020
Update CI/CD
ahmedxgouda Jan 3, 2026
35a7953
Update ci/cd
ahmedxgouda Jan 3, 2026
b5dff77
Update ci/cd
ahmedxgouda Jan 3, 2026
09c6df6
Update CI/CD
ahmedxgouda Jan 3, 2026
7f8dce6
Update settings.base.py and ci/cd
ahmedxgouda Jan 3, 2026
45745d2
Update configuration and ci/cd
ahmedxgouda Jan 3, 2026
4cdc0ec
Update alphabitical order in env files
ahmedxgouda Jan 3, 2026
2cb8575
Fix negative indexing
ahmedxgouda Jan 3, 2026
d8f48e4
Add EscapeNullCharactersMiddleware
ahmedxgouda Jan 5, 2026
b2889f5
Update middleware, schemathesis config and add HTTP BadRequest status…
ahmedxgouda Jan 5, 2026
b04a1bb
Update rest api schema
ahmedxgouda Jan 5, 2026
7f8472f
Update tests
ahmedxgouda Jan 6, 2026
7a58f68
Merge branch 'feature/e2e-backend' into e2e/migrate-to-schemathesis
ahmedxgouda Jan 6, 2026
888d69c
Optimize recentIssues
ahmedxgouda Jan 6, 2026
049a62e
Add optimiazations and fixes
ahmedxgouda Jan 6, 2026
37d6ef9
Update tests, ci/cd and apply rabbit suggestions
ahmedxgouda Jan 6, 2026
b926648
Optimize N+1 queries
ahmedxgouda Jan 6, 2026
65ab732
Update tests
ahmedxgouda Jan 6, 2026
04212fc
Update rest schema and add a name for Fuzz Tests job in CI/CD
ahmedxgouda Jan 6, 2026
2f3e878
Fix negative indexing
ahmedxgouda Jan 6, 2026
0e86350
Update project health metrics filters and pagination
ahmedxgouda Jan 6, 2026
b1dd271
Update mentorship app, ci/cd, and entrypoint
ahmedxgouda Jan 6, 2026
7e6a053
Add trigram index to project
ahmedxgouda Jan 7, 2026
8cbcdf2
Update nest.dump
ahmedxgouda Jan 7, 2026
b5a1cae
Update entrypoint
ahmedxgouda Jan 7, 2026
30a2d91
Apply checks
ahmedxgouda Jan 7, 2026
dec17df
Add
ahmedxgouda Jan 7, 2026
24dbe5b
Add optimizations
ahmedxgouda Jan 7, 2026
d497542
Update tests
ahmedxgouda Jan 7, 2026
0019c04
Update CI/CD
ahmedxgouda Jan 7, 2026
5e107aa
Add fixes
ahmedxgouda Jan 7, 2026
b09badb
Apply rabbit's suggestion
ahmedxgouda Jan 8, 2026
d2b477b
Refactor docker files
ahmedxgouda Jan 8, 2026
8788ef1
Apply cspell
ahmedxgouda Jan 8, 2026
a8af00d
Refactor limits
ahmedxgouda Jan 8, 2026
0908be1
Update milestone enum and rest api endpoints
ahmedxgouda Jan 8, 2026
ad8b748
Apply middleware suggestions
ahmedxgouda Jan 8, 2026
9df950a
Migrate to strawberry_django.field
ahmedxgouda Jan 8, 2026
42114d3
Update REDIS_AUTH_ENABLED default value
ahmedxgouda Jan 8, 2026
446e362
Update queries to use strawberry_django.field
ahmedxgouda Jan 8, 2026
1182cc3
Apply rabbit suggestions
ahmedxgouda Jan 8, 2026
1fc8d64
Update tests and appply rabbit suggestion
ahmedxgouda Jan 8, 2026
76e0360
Fix pagination.limit
ahmedxgouda Jan 8, 2026
607fc50
Add optimizations and fixes
ahmedxgouda Jan 9, 2026
5d516a8
Update code
ahmedxgouda Jan 9, 2026
bc1c8ef
Add optimizations
ahmedxgouda Jan 10, 2026
076d6c9
Add optimizations
ahmedxgouda Jan 10, 2026
40a68cb
Add optimizations
ahmedxgouda Jan 10, 2026
34c5e41
Add fixes
ahmedxgouda Jan 11, 2026
8b3c80b
Add milestone index migration
ahmedxgouda Jan 11, 2026
8e7aa32
Update nest.dump
ahmedxgouda Jan 11, 2026
7ebf238
Add optimizations and fixes
ahmedxgouda Jan 12, 2026
1a2080e
Update snapshot query
ahmedxgouda Jan 12, 2026
b240fc9
Update backend tests
ahmedxgouda Jan 12, 2026
92e5a48
Update project model
ahmedxgouda Jan 12, 2026
e8304e1
Apply rabbit suggestion
ahmedxgouda Jan 12, 2026
349b72d
Merge branch 'feature/e2e-backend' into e2e/migrate-to-schemathesis
ahmedxgouda Jan 13, 2026
1b0d920
Apply rabbit suggestions
ahmedxgouda Jan 14, 2026
2b1551f
Apply rabbit suggestion and update tests
ahmedxgouda Jan 14, 2026
5d9bf41
Update code
arkid15r Jan 16, 2026
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
102 changes: 14 additions & 88 deletions .github/workflows/run-ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -299,98 +299,24 @@ jobs:
echo "release_version=$(date '+%y.%-m.%-d')-${GITHUB_SHA::7}" >> $GITHUB_OUTPUT
fi

run-fuzz-tests:
name: Run fuzz tests
run-graphql-fuzz-tests:
name: Run GraphQL fuzz tests
needs:
- scan-code
- scan-ci-dependencies
runs-on: ubuntu-latest
timeout-minutes: 15
services:
db:
image: pgvector/pgvector:pg16
env:
POSTGRES_DB: nest_db_fuzz
POSTGRES_PASSWORD: nest_user_fuzz_password
POSTGRES_USER: nest_user_fuzz
options: >-
--health-cmd="pg_isready -U nest_user_fuzz -d nest_db_fuzz -h localhost -p 5432"
--health-interval=5s
--health-timeout=5s
--health-retries=5
ports:
- 5432:5432
steps:
- name: Check out repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Docker buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f

- name: Setup Backend environment
uses: ./.github/workflows/setup-backend-environment
with:
db_username: nest_user_fuzz
db_name: nest_db_fuzz

- name: Run backend with fuzz environment variables
run: |
docker run -d --rm --name fuzz-nest-backend \
--env-file backend/.env.fuzz.example \
--network host \
-e DJANGO_DB_HOST=localhost \
-p 9500:9500 \
owasp/nest:test-backend-latest \
sh -c '
python manage.py migrate &&
gunicorn wsgi:application --bind 0.0.0.0:9500
'
uses: ./.github/workflows/run-fuzz-tests.yaml
with:
test-file: test_graphql.py

- name: Waiting for the backend to be ready
run: |
timeout 5m bash -c '
until wget --spider http://localhost:9500/a; do
echo "Waiting for backend..."
sleep 5
done
'
echo "Backend is up!"

- name: Load Postgres data
env:
PGPASSWORD: nest_user_fuzz_password
run: |
pg_restore -h localhost -U nest_user_fuzz -d nest_db_fuzz < backend/data/nest.dump

- name: Build Fuzz-testing image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
cache-from: |
type=gha
type=registry,ref=owasp/nest:test-fuzz-backend-cache
cache-to: |
type=gha,compression=zstd
context: backend/docker
file: backend/docker/Dockerfile.fuzz
load: true
platforms: linux/amd64
tags: owasp/nest:test-fuzz-backend-latest

- name: Run backend fuzz tests
run: |
mkdir -p ${{ github.workspace }}/fuzzing_results &&
chmod -R 777 ${{ github.workspace }}/fuzzing_results &&
docker run -e BASE_URL=http://localhost:9500 --network host \
-v ${{ github.workspace }}/fuzzing_results:/home/owasp/fuzzing_results \
owasp/nest:test-fuzz-backend-latest

- name: Upload fuzzing results
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
if: always()
with:
name: fuzzing-results
path: fuzzing_results/
retention-days: 30
run-rest-fuzz-tests:
name: Run REST fuzz tests
needs:
- scan-code
- scan-ci-dependencies
uses: ./.github/workflows/run-fuzz-tests.yaml
with:
test-file: test_rest.py
rest-url: http://localhost:9500/api/v0

build-staging-images:
name: Build Staging Images
Expand Down
95 changes: 95 additions & 0 deletions .github/workflows/run-fuzz-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Run fuzz tests

on:
workflow_call:
inputs:
test-file:
description: 'The test file to run fuzz tests on'
required: true
type: string
rest-url:
description: 'The REST API URL to test against'
required: false
type: string
default: ''

jobs:
run-fuzz-tests:
runs-on: ubuntu-latest
timeout-minutes: 15
services:
db:
image: pgvector/pgvector:pg16
env:
POSTGRES_DB: nest_db_fuzz
POSTGRES_PASSWORD: nest_user_fuzz_password
POSTGRES_USER: nest_user_fuzz
options: >-
--health-cmd="pg_isready -U nest_user_fuzz -d nest_db_fuzz -h localhost -p 5432"
--health-interval=5s
--health-timeout=5s
--health-retries=5
ports:
- 5432:5432
Comment thread
coderabbitai[bot] marked this conversation as resolved.
steps:
- name: Check out repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8

- name: Set up Docker buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f

- name: Setup Backend environment
uses: ./.github/workflows/setup-backend-environment
with:
db_username: nest_user_fuzz
db_name: nest_db_fuzz

- name: Run backend with fuzz environment variables
run: |
docker run -d --rm --name fuzz-nest-backend \
--env-file backend/.env.fuzz.example \
--network host \
-e DJANGO_DB_HOST=localhost \
-p 9500:9500 \
owasp/nest:test-backend-latest \
sh -c '
python manage.py migrate &&
gunicorn wsgi:application --bind 0.0.0.0:9500
'
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Waiting for the backend to be ready
run: |
timeout 5m bash -c '
until wget --spider http://localhost:9500/a; do
echo "Waiting for backend..."
sleep 5
done
'
echo "Backend is up!"

- name: Load Postgres data
env:
PGPASSWORD: nest_user_fuzz_password
run: |
pg_restore -h localhost -U nest_user_fuzz -d nest_db_fuzz < backend/data/nest.dump
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

- name: Build Fuzz-testing image
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
with:
cache-from: |
type=gha
type=registry,ref=owasp/nest:test-fuzz-backend-cache
cache-to: |
type=gha,compression=zstd
context: backend/docker/fuzz
file: backend/docker/fuzz/Dockerfile
load: true
platforms: linux/amd64
tags: owasp/nest:test-fuzz-backend-latest

Comment on lines +93 to +106

@coderabbitai coderabbitai Bot Jan 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find fuzz-related files and directories

echo "=== Searching for Dockerfile in fuzz directories ==="
fd -t f "Dockerfile" | grep -i fuzz

echo -e "\n=== Searching for entrypoint.sh in fuzz directories ==="
fd -t f "entrypoint.sh" | grep -i fuzz

echo -e "\n=== Searching for test_rest.py or similar fuzz test files ==="
fd -t f "test_rest.py" 

echo -e "\n=== Checking all fuzz directories ==="
fd -t d "fuzz"

echo -e "\n=== Listing contents of backend directory ==="
ls -la backend/ 2>/dev/null || echo "backend/ not found"

echo -e "\n=== Listing contents of docker directory ==="
ls -la docker/ 2>/dev/null || echo "docker/ not found"

echo -e "\n=== Repository root structure ==="
ls -la | grep -E "^d"

Repository: OWASP/Nest

Length of output: 2685


Critical: Docker build file path must be relative to context.

When context is set to a directory, the file path must be relative to that context. Currently:

  • context: docker/backend/fuzz
  • file: docker/backend/fuzz/Dockerfile

This causes Docker to look for docker/backend/fuzz/docker/backend/fuzz/Dockerfile, which doesn't exist.

Fix by making the file path relative to the context directory:

Proposed fix
       - name: Build Fuzz-testing image
         uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83
         with:
           cache-from: |
             type=gha
             type=registry,ref=owasp/nest:test-fuzz-backend-cache
           cache-to: |
             type=gha,compression=zstd
           context: docker/backend/fuzz
-          file: docker/backend/fuzz/Dockerfile
+          file: Dockerfile
           load: true
           platforms: linux/amd64
           tags: owasp/nest:test-fuzz-backend-latest
🤖 Prompt for AI Agents
In @.github/workflows/run-fuzz-tests.yaml around lines 88 - 101, The GitHub
Actions step "Build Fuzz-testing image" sets context: docker/backend/fuzz but
uses an absolute file path; change the file field to be relative to the context
(e.g., file: Dockerfile or file: ./Dockerfile) so the docker/build-push-action
(uses: docker/build-push-action@2634353...) can find the Dockerfile within the
specified context; ensure platforms, tags, cache-* settings remain unchanged.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure it works after file location refactoring.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify the Dockerfile location and directory structure

echo "=== Checking if Dockerfile exists at docker/backend/fuzz/Dockerfile ==="
if [ -f "docker/backend/fuzz/Dockerfile" ]; then
    echo "✅ Found: docker/backend/fuzz/Dockerfile"
    echo ""
    echo "=== First 10 lines of the Dockerfile ==="
    head -n 10 docker/backend/fuzz/Dockerfile
else
    echo "❌ Not found: docker/backend/fuzz/Dockerfile"
fi

echo ""
echo "=== Directory structure of docker/backend/fuzz ==="
ls -la docker/backend/fuzz/

echo ""
echo "=== Verifying entrypoint.sh location ==="
if [ -f "docker/backend/fuzz/entrypoint.sh" ]; then
    echo "✅ Found: docker/backend/fuzz/entrypoint.sh"
else
    echo "❌ Not found: docker/backend/fuzz/entrypoint.sh"
fi

echo ""
echo "=== Checking test files directory ==="
if [ -d "docker/backend/fuzz/tests" ]; then
    echo "✅ Found: docker/backend/fuzz/tests/"
    ls -la docker/backend/fuzz/tests/
else
    echo "❌ Not found: docker/backend/fuzz/tests/"
fi

Length of output: 1213


@arkid15r, I've verified the file structure after the refactoring and can confirm everything is in place correctly:

Verified file locations:

  • docker/backend/fuzz/Dockerfile exists
  • docker/backend/fuzz/entrypoint.sh exists
  • docker/backend/fuzz/tests/test_graphql.py exists
  • docker/backend/fuzz/tests/test_rest.py exists

The CodeRabbit fix is correct and necessary. With the current configuration:

  • context: docker/backend/fuzz
  • file: docker/backend/fuzz/Dockerfile

Docker will look for docker/backend/fuzz/docker/backend/fuzz/Dockerfile, which doesn't exist.

Apply the fix:

context: docker/backend/fuzz
file: Dockerfile  # ✅ relative to context

This matches the pattern used in your docker-compose/fuzz/compose.yaml where the build context is ../../docker/backend/fuzz with dockerfile: Dockerfile.


🧠 Learnings used
Learnt from: ahmedxgouda
Repo: OWASP/Nest PR: 1139
File: docker-compose/fuzz.yaml:70-83
Timestamp: 2025-12-26T06:57:30.908Z
Learning: In the fuzz testing environment (docker-compose/fuzz.yaml), the data-loader and graphql services are orchestrated in separate phases via the Makefile's test-fuzz target, not run simultaneously. The data is loaded to completion first, then the graphql fuzzer is started separately against the populated database. The docker-compose dependencies reflect runtime health checks rather than orchestration order.

- name: Run fuzz tests
env:
TEST_FILE: ${{ inputs.test-file }}
REST_URL: ${{ inputs.rest-url }}
run: |
docker run -e BASE_URL=http://localhost:9500 -e TEST_FILE="$TEST_FILE" -e REST_URL="$REST_URL" --network host owasp/nest:test-fuzz-backend-latest
Comment thread
ahmedxgouda marked this conversation as resolved.
Outdated
4 changes: 4 additions & 0 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,12 @@ test-fuzz:
@docker volume rm -f nest-fuzz_fuzz-db-data >/dev/null 2>&1 || true
@COMPOSE_BAKE=true DOCKER_BUILDKIT=1 \
docker compose --project-name nest-fuzz -f docker-compose/fuzz.yaml up --build --remove-orphans --abort-on-container-exit db backend data-loader
echo "Running GraphQL fuzz tests..."
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
@COMPOSE_BAKE=true DOCKER_BUILDKIT=1 \
docker compose --project-name nest-fuzz -f docker-compose/fuzz.yaml up --build --remove-orphans --abort-on-container-exit db backend graphql
echo "Running REST API fuzz tests..."
@COMPOSE_BAKE=true DOCKER_BUILDKIT=1 \
docker compose --project-name nest-fuzz -f docker-compose/fuzz.yaml up --build --remove-orphans --abort-on-container-exit db backend rest

update-backend-dependencies:
@cd backend && poetry update
Expand Down
12 changes: 12 additions & 0 deletions backend/apps/api/rest/v0/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@
],
"throttle": [],
}

Comment thread
ahmedxgouda marked this conversation as resolved.
Outdated
elif settings.IS_FUZZ_ENVIRONMENT:
api_settings_customization = {
"auth": None,
"servers": [
{
"description": "Fuzz",
"url": settings.SITE_URL,
}
],
"throttle": [],
}
elif settings.IS_STAGING_ENVIRONMENT:
api_settings_customization = {
"servers": [
Expand Down
90 changes: 48 additions & 42 deletions backend/apps/owasp/models/project_health_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models.functions import ExtractMonth, TruncDate
from django.db.models.functions import Coalesce, ExtractMonth, TruncDate
from django.utils import timezone

from apps.common.models import BulkSaveModel, TimestampedModel
Expand Down Expand Up @@ -170,13 +170,11 @@ def get_latest_health_metrics() -> models.QuerySet["ProjectHealthMetrics"]:
QuerySet[ProjectHealthMetrics]: QuerySet of project health metrics.

"""
return ProjectHealthMetrics.objects.filter(
nest_created_at=models.Subquery(
ProjectHealthMetrics.objects.filter(project=models.OuterRef("project"))
.order_by("-nest_created_at")
.values("nest_created_at")[:1]
),
project__is_active=True,
return (
ProjectHealthMetrics.objects.filter(project__is_active=True)
.select_related("project")
.order_by("project_id", "-nest_created_at")
.distinct("project_id")
)

@staticmethod
Expand All @@ -187,27 +185,29 @@ def get_stats() -> ProjectHealthStatsNode:
ProjectHealthStatsNode: The overall health stats of all projects.

"""
metrics = ProjectHealthMetrics.get_latest_health_metrics()

projects_count_healthy = metrics.filter(
score__gte=HEALTH_SCORE_THRESHOLD_HEALTHY,
).count()
projects_count_need_attention = metrics.filter(
score__lt=HEALTH_SCORE_THRESHOLD_HEALTHY,
score__gte=HEALTH_SCORE_THRESHOLD_NEED_ATTENTION,
).count()
projects_count_unhealthy = metrics.filter(
score__lt=HEALTH_SCORE_THRESHOLD_NEED_ATTENTION
).count()

projects_count_total = metrics.count() or 1 # Avoid division by zero

aggregation = metrics.aggregate(
average_score=models.Avg("score"),
total_contributors=models.Sum("contributors_count"),
total_forks=models.Sum("forks_count"),
total_stars=models.Sum("stars_count"),
stats = ProjectHealthMetrics.objects.filter(
id__in=ProjectHealthMetrics.get_latest_health_metrics().values_list("id", flat=True)
).aggregate(
projects_count_healthy=models.Count(
"id", filter=models.Q(score__gte=HEALTH_SCORE_THRESHOLD_HEALTHY)
),
projects_count_need_attention=models.Count(
"id",
filter=models.Q(
score__lt=HEALTH_SCORE_THRESHOLD_HEALTHY,
score__gte=HEALTH_SCORE_THRESHOLD_NEED_ATTENTION,
),
),
projects_count_unhealthy=models.Count(
"id", filter=models.Q(score__lt=HEALTH_SCORE_THRESHOLD_NEED_ATTENTION)
),
projects_count_total=models.Count("id"),
average_score=Coalesce(models.Avg("score"), 0.0),
total_contributors=Coalesce(models.Sum("contributors_count"), 0),
total_forks=Coalesce(models.Sum("forks_count"), 0),
total_stars=Coalesce(models.Sum("stars_count"), 0),
)
total = stats["projects_count_total"] or 1 # Avoid division by zero
monthly_overall_metrics = (
ProjectHealthMetrics.objects.annotate(month=ExtractMonth("nest_created_at"))
.filter(
Expand All @@ -220,22 +220,28 @@ def get_stats() -> ProjectHealthStatsNode:
score=models.Avg("score"),
)
)
months = []
scores = []
for entry in monthly_overall_metrics:
months.append(entry["month"])
scores.append(entry["score"])
return ProjectHealthStatsNode(
average_score=aggregation.get("average_score", 0.0),
average_score=stats["average_score"],
# We use all metrics instead of latest metrics to get the monthly trend
monthly_overall_scores=list(monthly_overall_metrics.values_list("score", flat=True)),
monthly_overall_scores_months=list(
monthly_overall_metrics.values_list("month", flat=True)
),
projects_count_healthy=projects_count_healthy,
projects_count_need_attention=projects_count_need_attention,
projects_count_unhealthy=projects_count_unhealthy,
projects_percentage_healthy=(projects_count_healthy / projects_count_total) * 100,
monthly_overall_scores=scores,
monthly_overall_scores_months=months,
projects_count_healthy=stats["projects_count_healthy"],
projects_count_need_attention=stats["projects_count_need_attention"],
projects_count_unhealthy=stats["projects_count_unhealthy"],
projects_percentage_healthy=(
stats["projects_count_healthy"] / stats["projects_count_total"]
)
* 100,
projects_percentage_need_attention=(
(projects_count_need_attention / projects_count_total) * 100
(stats["projects_count_need_attention"] / stats["projects_count_total"]) * 100
),
projects_percentage_unhealthy=(projects_count_unhealthy / projects_count_total) * 100,
total_contributors=(aggregation.get("total_contributors", 0)),
total_forks=(aggregation.get("total_forks", 0)),
total_stars=(aggregation.get("total_stars", 0)),
projects_percentage_unhealthy=(stats["projects_count_unhealthy"] / total) * 100,
total_contributors=(stats.get("total_contributors", 0)),
total_forks=(stats.get("total_forks", 0)),
total_stars=(stats.get("total_stars", 0)),
)
30 changes: 0 additions & 30 deletions backend/docker/entrypoint.fuzz.sh

This file was deleted.

Loading
Loading