|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Bridges native ops commands to doctor, drift, deploy-check, and migration verification report generation. More...
#include "native_ops_bridge.h"#include "native_artifact_emit.h"#include "native_json_config.h"#include "native_runtime_reports.h"#include "native_shell_bridge.h"#include "native_support.h"#include "native_process_capture.h"#include "native_migrate_verify.h"#include "native_yyjson_helpers.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>Go to the source code of this file.
Macros | |
| #define | native_ops_strdup strdup |
Functions | |
| static int | native_environment_valid (const char *value) |
| static int | native_command_exists (const char *command) |
| static int | native_cross_deb_packaging_available (const char *repo_root) |
| static char * | native_default_environment (const AppRuntime *app) |
| static char * | native_default_backend (const AppRuntime *app) |
| static char * | native_default_sqlite_path (const AppRuntime *app) |
| static char * | native_capture_trimmed (char *const argv[], int *code_out) |
| static int | native_identifier_safe (const char *value) |
| static int | native_append_escaped_sql_char (Buffer *buffer, char value) |
| static char * | native_sql_literal_escape (const char *value) |
| static const char * | native_output_path_status (int file_exists, int file_writable, int parent_exists, int parent_writable) |
| static char * | native_sqlite_query_value (const char *db_path, const char *sql) |
| static int | native_sqlite_table_exists (const char *db_path, const char *table_name) |
| static long | native_sqlite_table_row_count (const char *db_path, const char *table_name) |
| static long | native_sqlite_migration_applied_count (const char *db_path, const char *migration_id, const char *backend) |
| static char * | native_sqlite_migration_applied_schema_version (const char *db_path, const char *migration_id, const char *backend) |
| static char * | native_sqlite_migration_applied_checksum (const char *db_path, const char *migration_id, const char *backend) |
| static char * | native_output_path_check_json (const char *file_path, const char *label) |
| static char * | native_db_check_json (const AppRuntime *app, const char *backend) |
| static char * | build_native_app_config_report_local_json (const AppRuntime *app) |
| static char * | build_runtime_summary_json_from_app (const AppRuntime *app) |
| static void | append_app_common_flags (const ServeConfig *config, char *argv_list[], int *argc) |
| static char * | native_build_sqlite_migrate_verify_failure_report_json (const ServeConfig *config, const AppRuntime *app, const char *error_text) |
| static int | native_sqlite_migrate_verify_preflight_ok (const AppRuntime *app) |
| static char * | capture_migrate_verify_report_json (const char *repo_root, const ServeConfig *config, const AppRuntime *app, const char *backend, char **status_out, char **error_out) |
| char * | build_native_app_doctor_report_local_json (const char *repo_root, const ServeConfig *config, const char *artifact_dir, const AppRuntime *app, const char *host_target) |
| Builds a JSON doctor report for one app using native ops bridges. | |
| char * | build_native_app_drift_report_local_json (const char *repo_root, const ServeConfig *config, const AppRuntime *app) |
| Builds a JSON drift report for one app using native ops bridges. | |
| char * | build_native_app_deploy_check_report_local_json (const char *repo_root, const ServeConfig *config, const char *artifact_dir, const AppRuntime *app, const char *host_target) |
| Builds a JSON deploy-check report for one app using native ops bridges. | |
Bridges native ops commands to doctor, drift, deploy-check, and migration verification report generation.
Definition in file native_ops_bridge.c.
| #define native_ops_strdup strdup |
Definition at line 24 of file native_ops_bridge.c.
Referenced by build_native_app_config_report_local_json(), build_native_app_deploy_check_report_local_json(), build_native_app_doctor_report_local_json(), build_native_app_drift_report_local_json(), capture_migrate_verify_report_json(), native_build_sqlite_migrate_verify_failure_report_json(), native_command_exists(), native_default_backend(), native_default_environment(), and native_default_sqlite_path().
|
static |
Definition at line 475 of file native_ops_bridge.c.
References ServeConfig::app_dir, ServeConfig::base_path, ServeConfig::build_dir, ServeConfig::conf_path, ServeConfig::state_dir, and ServeConfig::state_path.
Referenced by capture_migrate_verify_report_json().
|
static |
Definition at line 408 of file native_ops_bridge.c.
References AppRuntime::error_report_path, json_string_dup_native(), AppRuntime::log_path, native_db_check_json(), native_default_backend(), native_default_environment(), native_environment_valid(), native_ops_strdup, and native_output_path_check_json().
Referenced by build_native_app_doctor_report_local_json().
| char * build_native_app_deploy_check_report_local_json | ( | const char * | repo_root, |
| const ServeConfig * | config, | ||
| const char * | artifact_dir, | ||
| const AppRuntime * | app, | ||
| const char * | host_target ) |
Builds a JSON deploy-check report for one app using native ops bridges.
| repo_root | Repository root used to locate supporting assets. |
| config | Active serve configuration. |
| artifact_dir | Active artifact directory for the app. |
| app | Finalized app runtime being inspected. |
| host_target | Host target label to report. |
Definition at line 860 of file native_ops_bridge.c.
References AppRuntime::app_id, build_native_app_doctor_report_local_json(), json_string_dup_native(), native_cross_deb_packaging_available(), and native_ops_strdup.
Referenced by handle_native_deploy_check_ops_command().
| char * build_native_app_doctor_report_local_json | ( | const char * | repo_root, |
| const ServeConfig * | config, | ||
| const char * | artifact_dir, | ||
| const AppRuntime * | app, | ||
| const char * | host_target ) |
Builds a JSON doctor report for one app using native ops bridges.
| repo_root | Repository root used to locate supporting assets. |
| config | Active serve configuration. |
| artifact_dir | Active artifact directory for the app. |
| app | Finalized app runtime being inspected. |
| host_target | Host target label to report. |
Definition at line 790 of file native_ops_bridge.c.
References AppRuntime::app_id, build_native_app_config_report_local_json(), build_native_app_runtime_report_json(), build_runtime_summary_json_from_app(), capture_migrate_verify_report_json(), json_string_dup_native(), native_default_backend(), native_ops_strdup, and streq().
Referenced by build_native_app_deploy_check_report_local_json(), and handle_native_runtime_app_command().
| char * build_native_app_drift_report_local_json | ( | const char * | repo_root, |
| const ServeConfig * | config, | ||
| const AppRuntime * | app ) |
Builds a JSON drift report for one app using native ops bridges.
| repo_root | Repository root used to locate supporting assets. |
| config | Active serve configuration. |
| app | Finalized app runtime being inspected. |
Definition at line 833 of file native_ops_bridge.c.
References AppRuntime::app_id, capture_migrate_verify_report_json(), json_string_dup_native(), native_default_backend(), native_ops_strdup, and streq().
Referenced by handle_native_drift_check_ops_command().
|
static |
Definition at line 441 of file native_ops_bridge.c.
References AppRuntime::app_id, AppRuntime::app_root, AppRuntime::base_path, AppRuntime::build_dir, AppRuntime::compiled_entrypoint, AppRuntime::debug, AppRuntime::error_report_path, AppRuntime::host_profile, json_string_dup_native(), AppRuntime::log_format, AppRuntime::log_path, AppRuntime::runtime_conf_path, and AppRuntime::state_path.
Referenced by build_native_app_doctor_report_local_json().
|
static |
Definition at line 708 of file native_ops_bridge.c.
References append_app_common_flags(), json_find_string(), native_build_sqlite_migrate_verify_failure_report_json(), native_capture_migrate_verify_sqlite_report_json(), native_ops_strdup, native_sqlite_migrate_verify_preflight_ok(), shell_runtime_command_capture_native(), streq(), ServeConfig::target_id, and trim_in_place().
Referenced by build_native_app_doctor_report_local_json(), and build_native_app_drift_report_local_json().
|
static |
Definition at line 152 of file native_ops_bridge.c.
References buffer_append().
Referenced by native_sql_literal_escape().
|
static |
Definition at line 502 of file native_ops_bridge.c.
References AppRuntime::app_id, AppRuntime::app_root, json_string_dup_native(), native_default_sqlite_path(), native_json_doc_free(), native_json_doc_load_file(), native_json_obj_get(), native_json_obj_get_string_dup(), native_ops_strdup, path_exists(), path_join(), resolve_relative_to(), ServeConfig::target_id, and yyjson_doc_get_root().
Referenced by capture_migrate_verify_report_json().
|
static |
Definition at line 124 of file native_ops_bridge.c.
References run_process_capture_native(), and trim_in_place().
Referenced by native_sqlite_query_value().
|
static |
Definition at line 37 of file native_ops_bridge.c.
References native_ops_strdup.
Referenced by native_cross_deb_packaging_available().
|
static |
Definition at line 75 of file native_ops_bridge.c.
References native_command_exists().
Referenced by build_native_app_deploy_check_report_local_json().
|
static |
Definition at line 356 of file native_ops_bridge.c.
References conf_lookup_value(), json_string_dup_native(), native_default_sqlite_path(), path_dirname(), path_exists(), path_is_directory(), AppRuntime::runtime_conf_path, and streq().
Referenced by build_native_app_config_report_local_json().
|
static |
Definition at line 104 of file native_ops_bridge.c.
References conf_lookup_value(), native_ops_strdup, and AppRuntime::runtime_conf_path.
Referenced by build_native_app_config_report_local_json(), build_native_app_doctor_report_local_json(), and build_native_app_drift_report_local_json().
|
static |
Definition at line 95 of file native_ops_bridge.c.
References conf_lookup_value(), native_ops_strdup, and AppRuntime::runtime_conf_path.
Referenced by build_native_app_config_report_local_json().
|
static |
Definition at line 113 of file native_ops_bridge.c.
References AppRuntime::app_id, conf_lookup_value(), native_ops_strdup, and AppRuntime::runtime_conf_path.
Referenced by native_build_sqlite_migrate_verify_failure_report_json(), and native_db_check_json().
|
static |
Definition at line 27 of file native_ops_bridge.c.
References streq().
Referenced by build_native_app_config_report_local_json().
|
static |
Definition at line 138 of file native_ops_bridge.c.
Referenced by native_sqlite_table_exists(), and native_sqlite_table_row_count().
|
static |
Definition at line 315 of file native_ops_bridge.c.
References json_string_dup_native(), native_output_path_status(), path_dirname(), path_exists(), path_is_directory(), and path_is_writable().
Referenced by build_native_app_config_report_local_json().
|
static |
Definition at line 178 of file native_ops_bridge.c.
Referenced by native_output_path_check_json().
|
static |
Definition at line 164 of file native_ops_bridge.c.
References buffer_free(), buffer_init(), Buffer::data, and native_append_escaped_sql_char().
Referenced by native_sqlite_migration_applied_checksum(), native_sqlite_migration_applied_count(), native_sqlite_migration_applied_schema_version(), and native_sqlite_table_exists().
|
static |
Definition at line 623 of file native_ops_bridge.c.
References AppRuntime::app_root, native_json_doc_free(), native_json_doc_load_file(), native_json_find_backend_by_name(), native_json_find_migration_by_id(), native_json_obj_get(), native_json_obj_get_array(), native_json_obj_get_string_dup(), path_exists(), path_join(), resolve_relative_to(), yyjson_arr_iter_init(), yyjson_arr_iter_next(), yyjson_doc_get_root(), yyjson_get_str(), and yyjson_is_str().
Referenced by capture_migrate_verify_report_json().
|
static |
Definition at line 291 of file native_ops_bridge.c.
References native_sql_literal_escape(), and native_sqlite_query_value().
|
static |
Definition at line 242 of file native_ops_bridge.c.
References native_sql_literal_escape(), and native_sqlite_query_value().
|
static |
Definition at line 269 of file native_ops_bridge.c.
References native_sql_literal_escape(), and native_sqlite_query_value().
|
static |
Definition at line 191 of file native_ops_bridge.c.
References native_capture_trimmed().
Referenced by native_sqlite_migration_applied_checksum(), native_sqlite_migration_applied_count(), native_sqlite_migration_applied_schema_version(), native_sqlite_table_exists(), and native_sqlite_table_row_count().
|
static |
Definition at line 204 of file native_ops_bridge.c.
References native_identifier_safe(), native_sql_literal_escape(), native_sqlite_query_value(), and streq().
|
static |
Definition at line 226 of file native_ops_bridge.c.
References native_identifier_safe(), and native_sqlite_query_value().