diff --git a/press-semgrep-rules.yml b/press-semgrep-rules.yml index d52fb3c5..2d3d6ccd 100644 --- a/press-semgrep-rules.yml +++ b/press-semgrep-rules.yml @@ -51,7 +51,7 @@ rules: ... except ...: ... - $DOC.save(...) + $PG.save(...) ... raise ... @@ -69,7 +69,7 @@ rules: ... except ...: ... - $DOC.db_set(...) + $PG.db_set(...) ... raise ... @@ -78,7 +78,7 @@ rules: ... except ...: ... - $DOC.save(...) + $PG.save(...) ... frappe.db.commit(...) raise @@ -98,7 +98,7 @@ rules: ... except ...: ... - $DOC.db_set(...) + $PG.db_set(...) ... frappe.db.commit(...) ... diff --git a/press/press/doctype/agent_job/agent_job_notifications.py b/press/press/doctype/agent_job/agent_job_notifications.py index ec650a07..fba1f3b4 100644 --- a/press/press/doctype/agent_job/agent_job_notifications.py +++ b/press/press/doctype/agent_job/agent_job_notifications.py @@ -63,7 +63,7 @@ class JobErr(Enum): RQ_JOBS_IN_QUEUE = auto() -DOC_URLS = { +PG_URLS = { JobErr.OOM: "https://docs.frappe.io/cloud/common-issues/oom-issues", JobErr.ROW_SIZE_TOO_LARGE: "https://docs.frappe.io/cloud/faq/site#row-size-too-large-error-on-migrate", JobErr.DATA_TRUNCATED_FOR_COLUMN: "https://docs.frappe.io/cloud/faq/site#data-truncated-for-column", @@ -193,7 +193,7 @@ def update_with_oom_err(
To rectify this issue, please follow the steps mentioned in Help.
""" - details["assistance_url"] = DOC_URLS[JobErr.OOM] + details["assistance_url"] = PG_URLS[JobErr.OOM] # user addressable if the server is a dedicated server if not frappe.db.get_value(job.server_type, job.server, "public"): @@ -211,7 +211,7 @@ def update_with_row_size_too_large_err(details: Details, job: AgentJob):To rectify this issue, please follow the steps mentioned in Help.
""" - details["assistance_url"] = DOC_URLS[JobErr.ROW_SIZE_TOO_LARGE] + details["assistance_url"] = PG_URLS[JobErr.ROW_SIZE_TOO_LARGE] return True @@ -226,7 +226,7 @@ def update_with_data_truncated_for_column_err(details: Details, job: AgentJob):To rectify this issue, please follow the steps mentioned in Help.
""" - details["assistance_url"] = DOC_URLS[JobErr.DATA_TRUNCATED_FOR_COLUMN] + details["assistance_url"] = PG_URLS[JobErr.DATA_TRUNCATED_FOR_COLUMN] return True @@ -273,7 +273,7 @@ def update_with_cant_connect_to_mysql_err(details: Details, job: AgentJob):{suggestion}
""" - details["assistance_url"] = DOC_URLS[JobErr.CANT_CONNECT_TO_MYSQL] + details["assistance_url"] = PG_URLS[JobErr.CANT_CONNECT_TO_MYSQL] return True @@ -285,7 +285,7 @@ def update_with_gzip_tar_err(details: Details, job: AgentJob):To rectify this issue, please follow the steps mentioned in Help.
""" - details["assistance_url"] = DOC_URLS[JobErr.GZIP_TAR_ERR] + details["assistance_url"] = PG_URLS[JobErr.GZIP_TAR_ERR] return True @@ -298,7 +298,7 @@ def update_with_unknown_command_hyphen_err(details: Details, job: AgentJob):To rectify this issue, please follow the steps mentioned in Help.
""" - details["assistance_url"] = DOC_URLS[JobErr.UNKNOWN_COMMAND_HYPHEN] + details["assistance_url"] = PG_URLS[JobErr.UNKNOWN_COMMAND_HYPHEN] return True @@ -317,7 +317,7 @@ def update_with_rq_jobs_in_queue_err(details: Details, job: AgentJob):NOTE: This will cause downtime for that duration
""" - details["assistance_url"] = DOC_URLS[JobErr.RQ_JOBS_IN_QUEUE] + details["assistance_url"] = PG_URLS[JobErr.RQ_JOBS_IN_QUEUE] return True diff --git a/press/press/doctype/deploy_candidate/deploy_notifications.py b/press/press/doctype/deploy_candidate/deploy_notifications.py index f6bae096..de83cd7b 100644 --- a/press/press/doctype/deploy_candidate/deploy_notifications.py +++ b/press/press/doctype/deploy_candidate/deploy_notifications.py @@ -69,7 +69,7 @@ if typing.TYPE_CHECKING: ] -DOC_URLS = { +PG_URLS = { "app-installation-issue": "https://docs.frappe.io/cloud/faq/app-installation-issue", "invalid-pyproject-file": "https://docs.frappe.io/cloud/common-issues/invalid-pyprojecttoml-file", "incompatible-node-version": "https://docs.frappe.io/cloud/common-issues/incompatible-node-version", @@ -381,7 +381,7 @@ def update_with_unsupported_init_file( """ details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["frappe-not-found"] + details["assistance_url"] = PG_URLS["frappe-not-found"] return True @@ -414,7 +414,7 @@ def update_with_vue_build_failed( """ details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["debugging-app-installs-locally"] + details["assistance_url"] = PG_URLS["debugging-app-installs-locally"] return True @@ -456,7 +456,7 @@ def update_with_import_error( before retrying build. """ - details["assistance_url"] = DOC_URLS["debugging-app-installs-locally"] + details["assistance_url"] = PG_URLS["debugging-app-installs-locally"] details["message"] = fmt(message) return True @@ -497,7 +497,7 @@ def update_with_module_not_found( """ details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["debugging-app-installs-locally"] + details["assistance_url"] = PG_URLS["debugging-app-installs-locally"] return True @@ -538,7 +538,7 @@ def update_with_dependency_not_found( """ details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["debugging-app-installs-locally"] + details["assistance_url"] = PG_URLS["debugging-app-installs-locally"] return True @@ -572,7 +572,7 @@ def update_with_error_on_pip_install( """ details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["debugging-app-installs-locally"] + details["assistance_url"] = PG_URLS["debugging-app-installs-locally"] return True @@ -591,7 +591,7 @@ def update_with_no_python_dependency_file_error(To rectify this issue, please follow the the steps mentioned in Help.
""" details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["no-python-dependency-file-found"] + details["assistance_url"] = PG_URLS["no-python-dependency-file-found"] details["traceback"] = None return True @@ -617,7 +617,7 @@ def update_with_invalid_pyproject_error(To rectify this issue, please follow the steps mentioned in Help.
""" details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["invalid-pyproject-file"] + details["assistance_url"] = PG_URLS["invalid-pyproject-file"] return True @@ -644,7 +644,7 @@ def update_with_invalid_app_structure(For further guidance, refer to the Help documentation.
""" details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["invalid-project-structure"] + details["assistance_url"] = PG_URLS["invalid-project-structure"] return True @@ -673,7 +673,7 @@ def update_with_invalid_package_json_error(To rectify this issue, please fix the pyproject.json file.
""" details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["debugging-app-installs-locally"] + details["assistance_url"] = PG_URLS["debugging-app-installs-locally"] return True @@ -709,7 +709,7 @@ def update_with_app_not_fetchable( """ details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["app-installation-issue"] + details["assistance_url"] = PG_URLS["app-installation-issue"] return True @@ -738,7 +738,7 @@ def update_with_incompatible_node(To rectify this issue, please follow the the steps mentioned in Help.
""" details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["incompatible-node-version"] + details["assistance_url"] = PG_URLS["incompatible-node-version"] # Traceback is not pertinent to issue details["traceback"] = None @@ -776,7 +776,7 @@ def update_with_incompatible_python( details["message"] = fmt(message) details["traceback"] = None - details["assistance_url"] = DOC_URLS["incompatible-dependency-version"] + details["assistance_url"] = PG_URLS["incompatible-dependency-version"] return True @@ -817,7 +817,7 @@ def update_with_incompatible_node_prebuild(To rectify this issue, please follow the the steps mentioned in Help.
""" details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["incompatible-node-version"] + details["assistance_url"] = PG_URLS["incompatible-node-version"] # Traceback is not pertinent to issue details["traceback"] = None @@ -843,7 +843,7 @@ def update_with_incompatible_python_prebuild(To rectify this issue, please follow the the steps mentioned in Help.
""" details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["incompatible-dependency-version"] + details["assistance_url"] = PG_URLS["incompatible-dependency-version"] # Traceback is not pertinent to issue details["traceback"] = None @@ -870,7 +870,7 @@ def update_with_incompatible_app_prebuild(To fix this issue please set {dep_app} to version {expected}.
""" details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["incompatible-app-version"] + details["assistance_url"] = PG_URLS["incompatible-app-version"] # Traceback is not pertinent to issue details["traceback"] = None @@ -922,7 +922,7 @@ def update_with_required_app_not_found_prebuild( """ details["traceback"] = None details["message"] = fmt(message) - details["assistance_url"] = DOC_URLS["required-app-not-found"] + details["assistance_url"] = PG_URLS["required-app-not-found"] return True @@ -954,7 +954,7 @@ def update_with_vite_not_found( details["message"] = fmt(message) details["traceback"] = None - details["assistance_url"] = DOC_URLS["vite-not-found"] + details["assistance_url"] = PG_URLS["vite-not-found"] return True diff --git a/press/press/doctype/site/site.py b/press/press/doctype/site/site.py index 6e302292..324b41b8 100644 --- a/press/press/doctype/site/site.py +++ b/press/press/doctype/site/site.py @@ -122,7 +122,7 @@ DOCTYPE_SERVER_TYPE_MAP = { } ARCHIVE_AFTER_SUSPEND_DAYS = 21 -PRIVATE_BENCH_DOC = "https://docs.frappe.io/cloud/sites/move-site-to-private-bench" +PRIVATE_BENCH_PG = "https://docs.frappe.io/cloud/sites/move-site-to-private-bench" SERVER_SCRIPT_DISABLED_VERSION = ( 15 # version from which server scripts were disabled on public benches. No longer set in site ) @@ -505,7 +505,7 @@ class Site(Document, TagHelpers): # If site is on public bench, don't allow to disable auto updates if self.skip_auto_updates and self.is_group_public: frappe.throw( - f'Auto updates can\'t be disabled for sites on public benches! Please move to a private bench.' + f'Auto updates can\'t be disabled for sites on public benches! Please move to a private bench.' ) def validate_site_plan(self): # noqa: C901 @@ -2156,7 +2156,7 @@ class Site(Document, TagHelpers): and self.is_this_version_or_above(SERVER_SCRIPT_DISABLED_VERSION) ): frappe.throw( - f'You cannot enable server scripts on public benches. Please move to a private bench.' + f'You cannot enable server scripts on public benches. Please move to a private bench.' ) def validate_encryption_key(self, key: str, value: Any):