-
Notifications
You must be signed in to change notification settings - Fork 2
fix(files): "נוצר" שייך לקובץ, לא לגרסה — הורשת created_at בעריכה #3305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -355,6 +355,7 @@ def save_file( | |||||||||||||||||||||||||||||||
| programming_language: str, | ||||||||||||||||||||||||||||||||
| description: str = "", | ||||||||||||||||||||||||||||||||
| tags: list[str] | None = None, | ||||||||||||||||||||||||||||||||
| update_existing: bool = False, | ||||||||||||||||||||||||||||||||
| ) -> dict[str, Any]: | ||||||||||||||||||||||||||||||||
| """Create a new file or append a new version of an existing one. | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
Comment on lines
360
to
361
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nitpick: The Suggested fix: Update the docstring to document the
Suggested change
|
||||||||||||||||||||||||||||||||
|
|
@@ -369,6 +370,26 @@ def save_file( | |||||||||||||||||||||||||||||||
| dbm = self._require_dbm() | ||||||||||||||||||||||||||||||||
| # Captured before the save so we can report create vs. update honestly. | ||||||||||||||||||||||||||||||||
| prev = _latest_fresh(dbm, user_id, file_name) | ||||||||||||||||||||||||||||||||
| # Updating an existing name must be an explicit choice. The silent | ||||||||||||||||||||||||||||||||
| # upsert bit for real: saving new content under a name that already | ||||||||||||||||||||||||||||||||
| # holds something else hides the old content from search and from the | ||||||||||||||||||||||||||||||||
| # normal view (both read the latest version only), leaving it | ||||||||||||||||||||||||||||||||
| # reachable only through the version history. Full-content rewrites | ||||||||||||||||||||||||||||||||
| # stay possible via update_existing=True; partial changes belong to | ||||||||||||||||||||||||||||||||
| # edit_file/append_file. | ||||||||||||||||||||||||||||||||
| if prev is not None and not update_existing: | ||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -euo pipefail
# אתר את מסלול השמירה ואת בדיקות הסנכרון הקיימות.
rg -n -C 16 '\bdef save_code_snippet\b|\bsave_code_snippet\(' database testsRepository: amirbiron/CodeBot Length of output: 50373 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- repository conventions ---'
find /tmp/coderabbit-repo-knowledge/amirbiron-codebot-052ed566 -maxdepth 2 -type f -name '*.md' -print | sort
printf '%s\n' '--- backend changed area ---'
sed -n '340,405p' mcp_server/backend.py
printf '%s\n' '--- bound repository save path ---'
sed -n '194,275p' database/repository.py
printf '%s\n' '--- repository save_file path ---'
sed -n '730,795p' database/repository.py
printf '%s\n' '--- collection/index setup references ---'
rg -n -C 8 'create_index|unique|file_name|version' database/repository.py database/manager.py | head -220Repository: amirbiron/CodeBot Length of output: 27468 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '%s\n' '--- database convention ---'
cat /tmp/coderabbit-repo-knowledge/amirbiron-codebot-052ed566/conventions/database.md
printf '%s\n' '--- save implementation continuation ---'
sed -n '255,315p' database/repository.py
printf '%s\n' '--- repository binding and collection initialization ---'
rg -n -C 10 'def _get_repo|Repository\(|create_index|ensure_index|code_snippets' database --glob '*.py'Repository: amirbiron/CodeBot Length of output: 50373 הוסיפו פעולה אטומית ליצירת קובץ חדש Claude Code ביצע עבודה טובה, אך 🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win יש להשלים את העברת 📍 Affects 2 files
🤖 Prompt for AI Agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P0: חומרת הממצא: CRITICAL. השינוי החדש שובר את Prompt for AI agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: חומרה: 6/10. שתי בקשות מקבילות יכולות לראות Prompt for AI agents |
||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||
| "ok": False, | ||||||||||||||||||||||||||||||||
| "error": "file_exists", | ||||||||||||||||||||||||||||||||
| "file_name": file_name, | ||||||||||||||||||||||||||||||||
| "latest_version": int(prev.get("version") or 0), | ||||||||||||||||||||||||||||||||
| "hint": ( | ||||||||||||||||||||||||||||||||
| "A file with this name already exists. To change part of it " | ||||||||||||||||||||||||||||||||
| "use codekeeper_edit_file or codekeeper_append_file; to " | ||||||||||||||||||||||||||||||||
| "replace its content entirely, pass update_existing=true; " | ||||||||||||||||||||||||||||||||
| "or pick a different file_name." | ||||||||||||||||||||||||||||||||
| ), | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
sourcery-ai[bot] marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||
| ok = bool( | ||||||||||||||||||||||||||||||||
| dbm.save_code_snippet( | ||||||||||||||||||||||||||||||||
| CodeSnippet( | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3: Severity: low (2/10). Update the
save_filedocstring to documentupdate_existing, thefile_existsresponse, and the distinction between full replacement and partial edits.Prompt for AI agents