Feat/sobiapicall#3
Merged
Merged
Conversation
🌿 Green API — Combined Report🔴 Green API Score: 39/100 (Grade: D)🔍 Endpoints: 22 🟢 🌱 Creedengo Éco-Design: 88/100 (Grade: A)🐛 Issues: 140 | Règles violées: 2 📋 Top règles Creedengo (2)
📅 2026-05-07T15:06:39.733Z |
There was a problem hiding this comment.
Pull request overview
This PR adds an optional SobriIT reporting integration to publish Green Score / Creedengo results, and introduces a set of GitHub Copilot workspace assets (instructions, agents, prompts, skills) to standardize Green API / Creedengo reviews and fixes in the repository.
Changes:
- Add an optional “send to SobriIT” flow in scripts and the interactive dashboard UI.
- Introduce a standalone Python sender (
sobriit_sender.py) for pushing analysis reports to SobriIT’s REST API. - Add
.github/Copilot instructions plus reusable agents/prompts/skills for Green API and Creedengo workflows.
Reviewed changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/start.sh | Adds SobriIT send step after analyses and refactors report path variables for reuse. |
| scripts/greenapianalyzer.sh | Adds --send-to-sobriit CLI flag and a post-run SobriIT send step. |
| scripts/greenapianalyzer-server.py | Adds optional SobriIT send on local analysis runs and returns SobriIT status to the UI. |
| scripts/sobriit_sender.py | New module/CLI to push Green Score + Creedengo payloads to SobriIT. |
| dashboard/interactive.html | Adds SobriIT configuration UI (remote + local tabs), payload fields, and status banners. |
| .github/copilot-instructions.md | Repository-wide Copilot guidance for Green API + Creedengo patterns. |
| .github/README.md | Documents the added Copilot assets and how to use them. |
| .github/agents/green-api-analyzer.md | Adds a Green API-focused review/generation agent description. |
| .github/agents/global-green-analyzer.md | Adds a combined Green API + Creedengo agent description. |
| .github/agents/creedengo-analyzer.md | Adds a Creedengo-focused review/generation agent description. |
| .github/agents/api-design-reviewer.md | Adds an OpenAPI/API-design reviewer agent description with green patterns. |
| .github/prompts/green-api-review.md | New reusable prompt for Green API + Creedengo review output. |
| .github/prompts/green-api-fix.md | New reusable prompt to apply Green API fixes. |
| .github/prompts/generate-green-endpoint.md | New reusable prompt to generate a “green compliant” endpoint template. |
| .github/prompts/creedengo-fix.md | New reusable prompt to fix Creedengo violations. |
| .github/prompts/optimize-query.md | New reusable prompt to optimize DB access for eco-design. |
| .github/skills/green-api-score.md | New skill: compute a Green API score breakdown. |
| .github/skills/green-api-fix.md | New skill: apply Green API patterns to existing code. |
| .github/skills/validate-green-api-fix.md | New skill: validate correctness and score impact of Green API fixes. |
| .github/skills/creedengo-scan.md | New skill: scan for Creedengo violations and propose fixes. |
| .github/skills/validate-creedengo-fix.md | New skill: validate Creedengo fixes for correctness and regressions. |
| .github/skills/add-pagination.md | New skill: add DE11 pagination pattern. |
| .github/skills/add-field-filtering.md | New skill: add DE08 fields pattern. |
| .github/skills/add-compression.md | New skill: add DE01 compression pattern. |
| .github/skills/add-etag-304.md | New skill: add DE02/DE03 ETag + 304 pattern. |
| .github/skills/add-delta-endpoint.md | New skill: add DE06 delta/changes pattern. |
| .github/skills/add-rate-limiting.md | New skill: add US07 rate limiting pattern. |
| .github/skills/add-health-endpoint.md | New skill: add LO01 health endpoint pattern. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1205
to
+1209
| # SobriIT integration — send results if --send-to-sobriit is set | ||
| ############################################################################### | ||
| if [ "$SEND_TO_SOBRIIT" = true ]; then | ||
| echo "" | ||
| echo "━━━ 📤 Sending results to SobriIT ━━━" |
Comment on lines
+1212
to
+1213
| [ -f "$LATEST_REPORT" ] && SOBRIIT_CMD+=(--green-report "$LATEST_REPORT") | ||
| [ -f "$CREEDENGO_REPORT" ] && SOBRIIT_CMD+=(--creedengo-report "$CREEDENGO_REPORT") |
Comment on lines
+238
to
+239
| CREEDENGO_REPORT="$ROOT/reports/creedengo-report.json" | ||
| [ -f "$CREEDENGO_REPORT" ] && SOBRIIT_CMD+=(--creedengo-report "$CREEDENGO_REPORT") |
Comment on lines
+926
to
+934
| if payload.get("sendToSobriit"): | ||
| try: | ||
| sobriit_result = _sobriit_send( | ||
| appname=appname, | ||
| green_report=report, | ||
| creedengo_report=creedengo_report, | ||
| base_url=payload.get("sobriitBaseUrl"), | ||
| api_key=payload.get("sobriitApiKey"), | ||
| ) |
Comment on lines
+930
to
+934
| green_report=report, | ||
| creedengo_report=creedengo_report, | ||
| base_url=payload.get("sobriitBaseUrl"), | ||
| api_key=payload.get("sobriitApiKey"), | ||
| ) |
Comment on lines
+151
to
+160
| # ── Step 1: Lookup or create application ── | ||
| app_id = None | ||
| quoted = urllib.request.quote(appname, safe='') | ||
|
|
||
| # Try lookup by name first, then by code via the search endpoint | ||
| for search_field in ("name", "code"): | ||
| status, resp = _api_call( | ||
| "GET", | ||
| f"{base_url}/api/v1/applications/search?{search_field}={quoted}", | ||
| api_key, |
Comment on lines
+155
to
+169
| # Try lookup by name first, then by code via the search endpoint | ||
| for search_field in ("name", "code"): | ||
| status, resp = _api_call( | ||
| "GET", | ||
| f"{base_url}/api/v1/applications/search?{search_field}={quoted}", | ||
| api_key, | ||
| ) | ||
| if status == 200 and isinstance(resp, dict): | ||
| items = resp.get("data") or [] | ||
| # Exact match (search may return partial matches) | ||
| for item in items: | ||
| if isinstance(item, dict) and item.get("id"): | ||
| val = (item.get(search_field) or "").strip() | ||
| if val.lower() == appname.lower(): | ||
| app_id = item["id"] |
| green_total = gs.get("total") | ||
| green_max = gs.get("max") | ||
| green_grade = gs.get("grade") | ||
| score_normalised = round(green_total / green_max * 100, 2) if green_total and green_max else None |
Comment on lines
+970
to
+984
| // Restore from localStorage | ||
| try { | ||
| if (localStorage.getItem(lsPrefix + ".enabled") === "true") cb.checked = true; | ||
| if (urlEl) urlEl.value = localStorage.getItem(lsPrefix + ".url") || ""; | ||
| if (keyEl) keyEl.value = localStorage.getItem(lsPrefix + ".key") || ""; | ||
| } catch {} | ||
| const sync = () => { | ||
| fields.style.display = cb.checked ? "" : "none"; | ||
| try { localStorage.setItem(lsPrefix + ".enabled", cb.checked); } catch {} | ||
| }; | ||
| cb.addEventListener("change", sync); | ||
| sync(); | ||
| if (urlEl) urlEl.addEventListener("input", () => { try { localStorage.setItem(lsPrefix + ".url", urlEl.value); } catch {} }); | ||
| if (keyEl) keyEl.addEventListener("input", () => { try { localStorage.setItem(lsPrefix + ".key", keyEl.value); } catch {} }); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Green API Review Checklist (API Green Score)
Merci d’indiquer les mesures avant/après (payload/latence).
Data Exchange
fields=(whitelist, champs coûteux off par défaut)Cache-Control+ ETag/Last-Modified→ 304 en test)/changes?since=…ousinceVersion)Range: bytes=pour ressources volumineuses)Usage / Archi / Logs
Sécurité & robustesse
size, whitelistfields)Mesures
🌿 Green Score (automatique)