Skip to content

היסטוריית Git מדריך - #2918

Merged
amirbiron merged 16 commits into
mainfrom
cursor/git-3df0
Jan 23, 2026
Merged

amirbiron merged 16 commits into
mainfrom
cursor/git-3df0

Conversation

@amirbiron

@amirbiron amirbiron commented Jan 23, 2026 •

Copy link
Copy Markdown
Owner

✨ תיאור קצר

הוספנו יכולות חדשות לדפדפן הריפו: צפייה בהיסטוריית קבצים, השוואת גרסאות (Diff Viewer) וצפייה בתוכן קובץ ב-commit ספציפי. זה מאפשר למשתמשים להבין טוב יותר את השינויים בקוד לאורך זמן.

📦 שינויים עיקריים

  • קוד (Backend)
  • בוט טלגרם
  • מסד נתונים/מיגרציות
  • תיעוד (docs/)
  • DevOps/CI/CD

פירוט נקודות (רשימת תבליטים):

  • Backend: הרחבת GitMirrorService עם יכולות שליפת היסטוריה, תוכן קובץ ב-commit ו-diff, כולל ולידציות קפדניות, זיהוי בינארי וטיפול בקידודים שונים.
  • API: הוספת נקודות קצה חדשות ב-repo_browser.py לחשיפת יכולות ה-Git החדשות ל-Frontend, עם טיפול בשגיאות וקידוד פרמטרים.
  • Frontend: פיתוח רכיבי UI אינטראקטיביים (פאנל היסטוריה, מצב השוואה, מודאל diff) ב-repo-history.js ועיצובם ב-repo-browser.css, תוך שמירה על חווית משתמש קיימת (למשל, Breadcrumbs).
  • תאימות: הוספת אדפטר ל-window.RepoState ב-repo-browser.js לתמיכה חלקה ב-CodeMirror 6 בעת הצגת קובץ מ-commit ספציפי.
  • בדיקות: הוספת בדיקות יחידה מקיפות ללוגיקת ה-Backend וה-Frontend כדי להבטיח תקינות ואבטחה.

🧪 בדיקות

  • בדיקות יחידה נכתבו עבור ולידציות ה-Backend, זיהוי קבצים בינאריים ופרסור Diff.
  • בדיקות יחידה נכתבו עבור פונקציות עזר ב-JavaScript.
  • בוצעו בדיקות ידניות מקיפות דרך ממשק המשתמש החדש (פאנל היסטוריה, מודאל Diff, צפייה בגרסאות קודמות).
  • Unit
  • Integration
  • Manual

🧪 בדיקות נדרשות ב‑PR

  • 🔍 Code Quality & Security
  • Unit Tests (3.11)
  • Unit Tests (3.12)

📝 סוג שינוי

  • feat: פיצ'ר חדש
  • fix: תיקון באג
  • docs: שינוי תיעוד בלבד
  • refactor: שינוי קוד ללא שינוי התנהגות
  • perf: שיפור ביצועים
  • chore/ci: תשתית/CI
  • breaking change: שינוי שובר תאימות

✅ צ'קליסט

  • הקוד עוקב אחרי הסגנון (Black/isort/flake8/mypy)
  • בדיקות רצות ועוברות
  • תיעוד עודכן (README/Docs)
  • אם נוספו ג'ובים חדשים (Background Jobs) – וודא שהם רשומים ב-services/register_jobs.py (כולל Callback/Trigger להפעלה ידנית — למשל callback_name/trigger_func לפי המבנה) כדי שיופיעו בדשבורד
  • אם נוספו/שונו משתני סביבה – עודכן docs/environment-variables.rst וגם services/config_inspector_service.py
  • אם נוספו/השתנו טוקנים – עודכן גם docs/webapp/theming_and_css.rst + FEATURE_SUGGESTIONS/theme_matrix.md
  • אין סודות/מפתחות בקוד
  • אין מחיקות מסוכנות/פעולות על root (ראו .cursorrules)
  • הודעת הקומיט תואמת Conventional Commits (ע"פ הטבלה)
  • CHANGELOG עודכן אם נדרש
  • כל ה‑Required Checks לעיל ירוקים
  • צילום/וידאו UI מצורף אם רלוונטי

🧩 השפעות/סיכונים

  • ביצועים: שליפת היסטוריה/diff לקבצים גדולים מאוד או לריפוז עם היסטוריה ארוכה עלולה להיות איטית. הוגדרו מגבלות גודל (MAX_DIFF_BYTES, MAX_FILE_SIZE_FOR_DISPLAY) ו-limit/skip ב-API כדי למתן זאת.
  • אבטחה: בוצעו ולידציות קפדניות לקלט משתמש (שם ריפו, נתיב קובץ, ref) כדי למנוע Path Traversal ו-Command Injection. פלט Git עובר סניטציה להסרת מידע רגיש.
  • שימוש במשאבים: פעולות Git עלולות לצרוך CPU/זיכרון.

🔗 קישורים

🧯 סיכון / החזרה לאחור (Rollback)

  • תוכנית חזרה לאחור במקרה תקלה: Rollback סטנדרטי לגרסה קודמת של הקוד. אין שינויים במסד הנתונים.

Open in Cursor Open in Web


Note

Adds Git file history/diff capabilities end-to-end with strict validation, new APIs, UI, and tests.

  • Backend: Extends GitMirrorService with repo/file/ref validation patterns, token injection via ctor, improved _sanitize_output, binary detection/decoding, and new methods: get_file_history, get_file_at_commit, get_diff (with truncation and _parse_diff), and get_commit_info.
  • API: Adds routes GET /repo/api/history, GET /repo/api/file-at-commit/<commit>, GET /repo/api/diff/<commit1>/<commit2>, and GET /repo/api/commit/<commit> with structured errors and size limits.
  • Frontend: Introduces repo-history.js (history panel, compare mode, diff modal), updates repo-browser.js (header/actions, clipboard, RepoState adapter), styles in repo-browser.css, and template wiring.
  • Tests: Adds Python unit tests for validation/binary detection/diff parsing and Flask route basics, plus JS utility tests for URL building/HTML escaping.

Written by Cursor Bugbot for commit bd9d49e. This will update automatically on new commits. Configure here.

cursoragent and others added 2 commits January 23, 2026 19:27
Co-authored-by: amirbiron <amirbiron@gmail.com>
Co-authored-by: amirbiron <amirbiron@gmail.com>
@cursor

cursor Bot commented Jan 23, 2026

Copy link
Copy Markdown
Contributor

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@github-actions

github-actions Bot commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

🧯 Dangerous deletes guard report

Policy: see .cursorrules — dangerous deletions are blocked unless wrapped safely.

Summary:

  • Flagged findings (blocking): 0
    0
  • Excluded matches (not blocking): 15
  • Total matches (all files): 125

Flagged findings (file:line:snippet):
(none)

Excluded matches (by path pattern)
./Dockerfile:42:    rm -rf /var/lib/apt/lists/*
./Dockerfile:121:    rm -rf /var/lib/apt/lists/*
./webapp/static/js/md_preview.bundle.js.map:4:  "sourcesContent": ["// Markdown-it plugin to render GitHub-style task lists; see\n//\n// https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments\n// https://github.com/blog/1825-t … [truncated]
./README.md:842:find . -name "__pycache__" -exec rm -rf {} +
./docs/DOCUMENTATION_GUIDE.md:453:rm -rf _build
./docs/Makefile:24:	rm -rf $(BUILDDIR)
./node_modules/mermaid/dist/chunks/mermaid.core/chunk-KS23V3DP.mjs.map:4:  "sourcesContent": ["{\n  \"name\": \"mermaid\",\n  \"version\": \"11.12.0\",\n  \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequence  … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm.min/chunk-4HFYJGYH.mjs.map:4:  "sourcesContent": ["{\n  \"name\": \"mermaid\",\n  \"version\": \"11.12.0\",\n  \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequen … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm.min/chunk-4HFYJGYH.mjs:1:var r={name:"mermaid",version:"11.12.0",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graph … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm/chunk-2M32CCKP.mjs.map:4:  "sourcesContent": ["{\n  \"name\": \"mermaid\",\n  \"version\": \"11.12.0\",\n  \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequence d … [truncated]
./node_modules/mermaid/dist/mermaid.min.js:1524:`,"getStyles"),c1e=RQe});var h1e={};dr(h1e,{diagram:()=>NQe});var NQe,f1e=N(()=>{"use strict";$ge();a1e();l1e();u1e();NQe={parser:Fge,db:n1e,renderer:o1e,styles:c1e}});var m1e,g1e=N(()=>{"use  … [truncated]
./node_modules/mermaid/dist/mermaid.js.map:4:  "sourcesContent": ["/**\n* Default values for dimensions\n*/\nconst defaultIconDimensions = Object.freeze({\n\tleft: 0,\n\ttop: 0,\n\twidth: 16,\n\theight: 16\n});\n/**\n* Default values for tr … [truncated]
./node_modules/mermaid/dist/mermaid.min.js.map:4:  "sourcesContent": ["/**\n* Default values for dimensions\n*/\nconst defaultIconDimensions = Object.freeze({\n\tleft: 0,\n\ttop: 0,\n\twidth: 16,\n\theight: 16\n});\n/**\n* Default values fo … [truncated]
./node_modules/katex/package.json:153:    "build": "rimraf dist/ && mkdirp dist && cp README.md dist && rollup -c --failAfterWarnings && webpack && node update-sri.js package dist/README.md",
./node_modules/katex/src/fonts/Makefile:139:	rm -rf pfa ff otf ttf woff woff2

@github-actions

github-actions Bot commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

⏱️ Performance report

(No performance test durations collected. Mark tests with @pytest.mark.performance.)

Comment thread services/git_mirror_service.py Fixed
Comment thread services/git_mirror_service.py Fixed
Comment thread services/git_mirror_service.py Fixed
Comment thread services/git_mirror_service.py Fixed
Comment thread services/git_mirror_service.py Fixed
Comment thread services/git_mirror_service.py Fixed
Comment thread webapp/routes/repo_browser.py Fixed
Comment thread webapp/routes/repo_browser.py Fixed
Comment thread webapp/routes/repo_browser.py Fixed
Comment thread webapp/routes/repo_browser.py Fixed
@amirbiron
amirbiron marked this pull request as ready for review January 23, 2026 19:32
@sentry

sentry Bot commented Jan 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.19802% with 282 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
services/git_mirror_service.py 30.19% 253 Missing and 29 partials ⚠️

📢 Thoughts on this report? Let us know!

cursor[bot]

This comment was marked as outdated.

Co-authored-by: amirbiron <amirbiron@gmail.com>
@github-actions

github-actions Bot commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation has been built successfully!

To view locally:

  1. Download the artifacts
  2. Extract the zip file
  3. Open index.html in your browser

Co-authored-by: amirbiron <amirbiron@gmail.com>
cursor[bot]

This comment was marked as outdated.

cursoragent and others added 3 commits January 23, 2026 19:56
Co-authored-by: amirbiron <amirbiron@gmail.com>
Co-authored-by: amirbiron <amirbiron@gmail.com>
Co-authored-by: amirbiron <amirbiron@gmail.com>
cursor[bot]

This comment was marked as outdated.

cursoragent and others added 6 commits January 23, 2026 20:13
Co-authored-by: amirbiron <amirbiron@gmail.com>
Co-authored-by: amirbiron <amirbiron@gmail.com>
Co-authored-by: amirbiron <amirbiron@gmail.com>
Co-authored-by: amirbiron <amirbiron@gmail.com>
Co-authored-by: amirbiron <amirbiron@gmail.com>
Co-authored-by: amirbiron <amirbiron@gmail.com>
cursor[bot]

This comment was marked as outdated.

Co-authored-by: amirbiron <amirbiron@gmail.com>
cursor[bot]

This comment was marked as outdated.

Co-authored-by: amirbiron <amirbiron@gmail.com>

@cursor cursor Bot left a comment

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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread webapp/static/js/repo-history.js
Co-authored-by: amirbiron <amirbiron@gmail.com>
@amirbiron
amirbiron merged commit 8519c6e into main Jan 23, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants