diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py b/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py index 4aeecd371..68e7fa522 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/default.py @@ -80,11 +80,11 @@ SPIFFWORKFLOW_BACKEND_LOG_LEVEL = environ.get( # When a user clicks on the `Publish` button, this is the default branch this server merges into. # I.e., dev server could have `staging` here. Staging server might have `production` here. -SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO = environ.get( - "SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO" +SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH = environ.get( + "SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH" ) SPIFFWORKFLOW_BACKEND_GIT_BRANCH = environ.get("SPIFFWORKFLOW_BACKEND_GIT_BRANCH") -SPIFFWORKFLOW_BACKEND_GIT_CLONE_URL_FOR_PUBLISHING = environ.get("GIT_CLONE_URL") +SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_CLONE_URL = environ.get("GIT_CLONE_URL") SPIFFWORKFLOW_BACKEND_GIT_COMMIT_ON_SAVE = ( environ.get("SPIFFWORKFLOW_BACKEND_GIT_COMMIT_ON_SAVE", default="false") == "true" ) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/dev.py b/spiffworkflow-backend/src/spiffworkflow_backend/config/dev.py index 7cc73bc8f..ef0250604 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/dev.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/dev.py @@ -1,8 +1,8 @@ """Dev.""" from os import environ -SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO = environ.get( - "SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO", default="staging" +SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH = environ.get( + "SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH", default="staging" ) SPIFFWORKFLOW_BACKEND_GIT_USERNAME = environ.get( "SPIFFWORKFLOW_BACKEND_GIT_USERNAME", default="sartography-automated-committer" diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/local_development.py b/spiffworkflow-backend/src/spiffworkflow_backend/config/local_development.py index e9e674ef2..aa1387310 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/local_development.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/local_development.py @@ -13,7 +13,7 @@ SPIFFWORKFLOW_BACKEND_RUN_BACKGROUND_SCHEDULER = ( environ.get("SPIFFWORKFLOW_BACKEND_RUN_BACKGROUND_SCHEDULER", default="false") == "true" ) -SPIFFWORKFLOW_BACKEND_GIT_CLONE_URL_FOR_PUBLISHING = environ.get( +SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_CLONE_URL = environ.get( "GIT_CLONE_URL", default="https://github.com/sartography/sample-process-models.git" ) SPIFFWORKFLOW_BACKEND_GIT_USERNAME = "sartography-automated-committer" diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/qa1.py b/spiffworkflow-backend/src/spiffworkflow_backend/config/qa1.py index b1592d93b..ac56d84f1 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/qa1.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/qa1.py @@ -1,8 +1,8 @@ """Qa1.""" from os import environ -SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO = environ.get( - "SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO", default="qa2" +SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH = environ.get( + "SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH", default="qa2" ) SPIFFWORKFLOW_BACKEND_GIT_USERNAME = environ.get( "SPIFFWORKFLOW_BACKEND_GIT_USERNAME", default="sartography-automated-committer" diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/sartography.py b/spiffworkflow-backend/src/spiffworkflow_backend/config/sartography.py index f384622e6..4c7174a17 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/sartography.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/sartography.py @@ -9,7 +9,7 @@ SPIFFWORKFLOW_BACKEND_OPEN_ID_SERVER_URL = ( SPIFFWORKFLOW_BACKEND_GIT_BRANCH = environ.get( "SPIFFWORKFLOW_BACKEND_GIT_BRANCH", default="main" ) -SPIFFWORKFLOW_BACKEND_GIT_CLONE_URL_FOR_PUBLISHING = environ.get( +SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_CLONE_URL = environ.get( "GIT_CLONE_URL", default="https://github.com/sartography/sartography-process-models.git", ) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/staging.py b/spiffworkflow-backend/src/spiffworkflow_backend/config/staging.py index 56b4a3ff2..bfb613ec1 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/staging.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/staging.py @@ -4,8 +4,8 @@ from os import environ SPIFFWORKFLOW_BACKEND_GIT_BRANCH = environ.get( "SPIFFWORKFLOW_BACKEND_GIT_BRANCH", default="staging" ) -SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO = environ.get( - "SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO", default="main" +SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH = environ.get( + "SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH", default="main" ) SPIFFWORKFLOW_BACKEND_GIT_COMMIT_ON_SAVE = False SPIFFWORKFLOW_BACKEND_PERMISSIONS_FILE_NAME = "staging.yml" diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/config/terraform_deployed_environment.py b/spiffworkflow-backend/src/spiffworkflow_backend/config/terraform_deployed_environment.py index f75b5f06f..bf7843b22 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/config/terraform_deployed_environment.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/config/terraform_deployed_environment.py @@ -33,6 +33,6 @@ SPIFFWORKFLOW_BACKEND_CONNECTOR_PROXY_URL = ( f"https://connector-proxy.{environment_identifier_for_this_config_file_only}" ".spiffworkflow.org" ) -SPIFFWORKFLOW_BACKEND_GIT_CLONE_URL_FOR_PUBLISHING = environ.get( +SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_CLONE_URL = environ.get( "GIT_CLONE_URL", default="https://github.com/sartography/sample-process-models.git" ) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py index 1e2a16a7c..1a628c4cb 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_models_controller.py @@ -226,11 +226,11 @@ def process_model_publish( """Process_model_publish.""" if branch_to_update is None: branch_to_update = current_app.config[ - "SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO" + "SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH" ] if branch_to_update is None: raise MissingGitConfigsError( - "Missing config for SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO. " + "Missing config for SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH. " "This is required for publishing process models" ) process_model_identifier = _un_modify_modified_process_model_id( diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/git_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/git_service.py index 37b04937a..45f905782 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/git_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/git_service.py @@ -132,17 +132,17 @@ class GitService: def check_for_publish_configs(cls) -> None: """Check_for_configs.""" cls.check_for_basic_configs() - if current_app.config["SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO"] is None: + if current_app.config["SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH"] is None: raise MissingGitConfigsError( - "Missing config for SPIFFWORKFLOW_BACKEND_GIT_BRANCH_TO_PUBLISH_TO. " + "Missing config for SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_TARGET_BRANCH. " "This is required for publishing process models" ) if ( - current_app.config["SPIFFWORKFLOW_BACKEND_GIT_CLONE_URL_FOR_PUBLISHING"] + current_app.config["SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_CLONE_URL"] is None ): raise MissingGitConfigsError( - "Missing config for SPIFFWORKFLOW_BACKEND_GIT_CLONE_URL_FOR_PUBLISHING." + "Missing config for SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_CLONE_URL." " This is required for publishing process models" ) @@ -198,7 +198,7 @@ class GitService: clone_url = webhook["repository"]["clone_url"] if ( clone_url - != current_app.config["SPIFFWORKFLOW_BACKEND_GIT_CLONE_URL_FOR_PUBLISHING"] + != current_app.config["SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_CLONE_URL"] ): raise GitCloneUrlMismatchError( "Configured clone url does not match clone url from webhook:" @@ -243,7 +243,7 @@ class GitService: destination_process_root = f"/tmp/{clone_dir}" # noqa git_clone_url = current_app.config[ - "SPIFFWORKFLOW_BACKEND_GIT_CLONE_URL_FOR_PUBLISHING" + "SPIFFWORKFLOW_BACKEND_GIT_PUBLISH_CLONE_URL" ] if git_clone_url.startswith("https://"): git_clone_url = git_clone_url.replace(