forked from retoor/devplacepy
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
93dfb28cbf | ||
|
|
6fc0114f40 |
Symlink
+1
@@ -0,0 +1 @@
|
||||
python3
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
/usr/bin/python3
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
python3
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
lib
|
||||
@@ -0,0 +1,5 @@
|
||||
home = /usr/bin
|
||||
include-system-site-packages = false
|
||||
version = 3.11.2
|
||||
executable = /usr/bin/python3.11
|
||||
command = /usr/bin/python3 -m venv /workspace/repo/.venv
|
||||
@@ -22,7 +22,7 @@ from .comments import _drop_blocked, _build_comment_items, load_comments, get_re
|
||||
from .content import resolve_by_slug, resolve_object_url, get_uids_by_username_match, text_search_clause, get_daily_topic, get_featured_news
|
||||
from .attachments_data import get_attachments, get_attachments_by_type, get_news_images_by_uids, delete_attachment_record, delete_attachments, _delete_attachment_file, get_user_media, get_deleted_media
|
||||
from .stats import _stats_cache, get_site_stats, _analytics_cache, get_platform_analytics, _gist_languages_cache, get_gist_languages
|
||||
from .schema import init_db, _refresh_query_planner_stats, OLD_GATEWAY_URL, migrate_ai_gateway_settings, backfill_api_keys, _backfill_gamification
|
||||
from .schema import BUG_TABLE_RENAMES, migrate_bug_tables_to_issue_tables, init_db, _refresh_query_planner_stats, OLD_GATEWAY_URL, migrate_ai_gateway_settings, backfill_api_keys, _backfill_gamification
|
||||
|
||||
__all__ = [
|
||||
"dataset",
|
||||
@@ -222,6 +222,8 @@ __all__ = [
|
||||
"get_platform_analytics",
|
||||
"_gist_languages_cache",
|
||||
"get_gist_languages",
|
||||
"BUG_TABLE_RENAMES",
|
||||
"migrate_bug_tables_to_issue_tables",
|
||||
"init_db",
|
||||
"_refresh_query_planner_stats",
|
||||
"OLD_GATEWAY_URL",
|
||||
|
||||
@@ -6,6 +6,30 @@ from .soft_delete import SOFT_DELETE_TABLES, ensure_soft_delete_columns
|
||||
from .ranking import _authors_cache
|
||||
|
||||
|
||||
BUG_TABLE_RENAMES = (
|
||||
("bug_tickets", "issue_tickets"),
|
||||
("bug_comment_authors", "issue_comment_authors"),
|
||||
)
|
||||
|
||||
|
||||
def migrate_bug_tables_to_issue_tables() -> None:
|
||||
for source_name, destination_name in BUG_TABLE_RENAMES:
|
||||
if source_name not in db.tables:
|
||||
continue
|
||||
source = db[source_name]
|
||||
destination = get_table(destination_name)
|
||||
copied = 0
|
||||
for row in source.all():
|
||||
payload = {key: value for key, value in row.items() if key != "id"}
|
||||
destination.insert_ignore(payload, ["uid"])
|
||||
copied += 1
|
||||
logger.info(
|
||||
"Migrated %s rows from %s into %s", copied, source_name, destination_name
|
||||
)
|
||||
source.drop()
|
||||
logger.info("Dropped table %s after migration", source_name)
|
||||
|
||||
|
||||
def init_db():
|
||||
tables = db.tables
|
||||
_index(db, "users", "idx_users_username", ["username"])
|
||||
@@ -332,6 +356,7 @@ def init_db():
|
||||
_index(
|
||||
db, "issue_comment_authors", "idx_issue_comment_authors_number", ["gitea_number"]
|
||||
)
|
||||
migrate_bug_tables_to_issue_tables()
|
||||
_index(db, "service_state", "idx_service_state_name", ["name"])
|
||||
if "devii_conversations" in db.tables:
|
||||
conversations = get_table("devii_conversations")
|
||||
|
||||
@@ -468,6 +468,7 @@ def delete_node(project_uid: str, raw_path: str, deleted_by: str = "system") ->
|
||||
{"uid": row["uid"], "deleted_at": stamp, "deleted_by": deleted_by},
|
||||
["uid"],
|
||||
)
|
||||
_unlink_blob(row)
|
||||
|
||||
|
||||
def soft_delete_all_project_files(project_uid: str, deleted_by: str) -> None:
|
||||
@@ -578,9 +579,15 @@ def _export_node(row: dict, dest: Path) -> None:
|
||||
if target.is_symlink():
|
||||
target.unlink()
|
||||
if row.get("is_binary") and row.get("stored_name") and row.get("directory"):
|
||||
shutil.copyfile(
|
||||
PROJECT_FILES_DIR / row["directory"] / row["stored_name"], target
|
||||
)
|
||||
source = PROJECT_FILES_DIR / row["directory"] / row["stored_name"]
|
||||
try:
|
||||
shutil.copyfile(source, target)
|
||||
except (FileNotFoundError, OSError) as exc:
|
||||
logger.warning(
|
||||
"Missing blob for node %s (%s): %s",
|
||||
row.get("uid"), row.get("path"), exc,
|
||||
)
|
||||
return
|
||||
else:
|
||||
target.write_text(row.get("content") or "", encoding="utf-8")
|
||||
|
||||
@@ -708,9 +715,15 @@ def export_to_dir(project_uid: str, subpath: str, dest_dir) -> int:
|
||||
if target.is_symlink() or target.is_file():
|
||||
target.unlink()
|
||||
if row.get("is_binary") and row.get("stored_name") and row.get("directory"):
|
||||
shutil.copyfile(
|
||||
PROJECT_FILES_DIR / row["directory"] / row["stored_name"], target
|
||||
)
|
||||
source = PROJECT_FILES_DIR / row["directory"] / row["stored_name"]
|
||||
try:
|
||||
shutil.copyfile(source, target)
|
||||
except (FileNotFoundError, OSError) as exc:
|
||||
logger.warning(
|
||||
"Missing blob during full export for node %s (%s): %s",
|
||||
row.get("uid"), row.get("path"), exc,
|
||||
)
|
||||
continue
|
||||
else:
|
||||
target.write_text(row.get("content") or "", encoding="utf-8")
|
||||
written += 1
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
2026-07-19T17:34:12 INFO logging initialised at /workspace/repo/dpc.log
|
||||
2026-07-19T17:34:12 DEBUG model=molodetz-pro fps=30
|
||||
2026-07-19T17:34:12 INFO read task from file: /workspace/prompts/research-9.txt
|
||||
2026-07-19T17:34:12 INFO settings merged: model=<default> allow=0 deny=0 ask=0
|
||||
2026-07-19T17:38:50 INFO logging initialised at /workspace/repo/dpc.log
|
||||
2026-07-19T17:38:50 DEBUG model=molodetz-pro fps=30
|
||||
2026-07-19T17:38:50 INFO read task from file: /workspace/prompts/execution-1.txt
|
||||
2026-07-19T17:38:50 INFO settings merged: model=<default> allow=0 deny=0 ask=0
|
||||
2026-07-19T17:36:20 INFO logging initialised at /workspace/repo/dpc.log
|
||||
2026-07-19T17:36:20 DEBUG model=molodetz-pro fps=30
|
||||
2026-07-19T17:36:20 INFO read task from file: /workspace/prompts/research-5.txt
|
||||
2026-07-19T17:36:20 INFO settings merged: model=<default> allow=0 deny=0 ask=0
|
||||
2026-07-19T18:22:05 INFO logging initialised at /workspace/repo/dpc.log
|
||||
2026-07-19T18:22:05 DEBUG model=molodetz-pro fps=30
|
||||
2026-07-19T18:22:05 INFO read task from file: /workspace/prompts/execution-1.txt
|
||||
2026-07-19T18:22:05 INFO settings merged: model=<default> allow=0 deny=0 ask=0
|
||||
2026-07-19T18:49:22 INFO logging initialised at /workspace/repo/dpc.log
|
||||
2026-07-19T18:49:22 DEBUG model=molodetz-pro fps=30
|
||||
2026-07-19T18:49:22 INFO read task from file: /workspace/prompts/execution-2.txt
|
||||
2026-07-19T18:49:22 INFO settings merged: model=<default> allow=0 deny=0 ask=0
|
||||
|
||||
Reference in New Issue
Block a user