From d04adeae8d652d81595dd69e3802ecc07699f4d3 Mon Sep 17 00:00:00 2001
From: Tim Jaacks <tim.jaacks@seco.com>
Date: Mon, 28 Nov 2022 14:10:44 +0100
Subject: [PATCH] common: use uppercase for constants

---
 scripts/accept_merge_request.py               | 2 +-
 scripts/common.py                             | 6 +++---
 scripts/deploy_gitlab_ci.py                   | 4 ++--
 scripts/get_current_revision_from_manifest.py | 4 ++--
 scripts/integrate_into_manifest.py            | 4 ++--
 scripts/merge_into_manifest.py                | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/scripts/accept_merge_request.py b/scripts/accept_merge_request.py
index 4e35baf9..591c90a5 100755
--- a/scripts/accept_merge_request.py
+++ b/scripts/accept_merge_request.py
@@ -72,7 +72,7 @@ def accept_merge_request(project, mr, rebase=False, should_remove_source_branch=
                     # No pipeline created yet
                     print("No pipeline created yet")
                     time.sleep(1)
-                elif mr.head_pipeline["status"] in common.pending_states:
+                elif mr.head_pipeline["status"] in common.PENDING_STATES:
                     # Pipeline pending
                     if not pipeline_pending:
                         print("Waiting for pending pipeline", end="", flush=True)
diff --git a/scripts/common.py b/scripts/common.py
index e6e4f654..56c45594 100755
--- a/scripts/common.py
+++ b/scripts/common.py
@@ -13,9 +13,9 @@ from gitlab.v4.objects import Project
 from gitlab.v4.objects import MergeRequest
 
 
-manifest_file = "default.xml"
-srcrev_file = "SRCREV.conf"
-pending_states = ["created", "waiting_for_resource", "preparing", "pending", "running"]
+MANIFEST_FILE = "default.xml"
+SRCREV_FILE = "SRCREV.conf"
+PENDING_STATES = ["created", "waiting_for_resource", "preparing", "pending", "running"]
 
 
 def integration_branch_name(project_name, source_branch_name, target_branch_name):
diff --git a/scripts/deploy_gitlab_ci.py b/scripts/deploy_gitlab_ci.py
index daa1c7cf..7de5c81c 100755
--- a/scripts/deploy_gitlab_ci.py
+++ b/scripts/deploy_gitlab_ci.py
@@ -162,14 +162,14 @@ def main():
         "--manifest-file",
         help="""manifest file name (default: 'default.xml')""",
         dest="manifest_file",
-        default=common.manifest_file,
+        default=common.MANIFEST_FILE,
         required=False,
     )
     parser.add_argument(
         "--srcrev-file",
         help="""source revision file name (default: 'SRCREV.conf')""",
         dest="srcrev_file",
-        default=common.srcrev_file,
+        default=common.SRCREV_FILE,
         required=False,
     )
     parser.add_argument(
diff --git a/scripts/get_current_revision_from_manifest.py b/scripts/get_current_revision_from_manifest.py
index 16d6f90b..a35c9af7 100755
--- a/scripts/get_current_revision_from_manifest.py
+++ b/scripts/get_current_revision_from_manifest.py
@@ -15,7 +15,7 @@ def get_current_revision_from_manifest(
     manifest_branch,
     project: Project,
     recipe_name=None,
-    srcrev_file=common.srcrev_file,
+    srcrev_file=common.SRCREV_FILE,
 ):
     """
     Reads the xml manifest an the SRC_REVC file in the given manifest project
@@ -114,7 +114,7 @@ def main():
         "--srcrev-file",
         help="""source revision file name (default: 'SRCREV.conf')""",
         dest="srcrev_file",
-        default=common.srcrev_file,
+        default=common.SRCREV_FILE,
         required=False,
     )
     parser.add_argument(
diff --git a/scripts/integrate_into_manifest.py b/scripts/integrate_into_manifest.py
index 26444c52..39ec875b 100755
--- a/scripts/integrate_into_manifest.py
+++ b/scripts/integrate_into_manifest.py
@@ -219,14 +219,14 @@ def main():
         "--manifest-file",
         help="""manifest file name (default: 'default.xml')""",
         dest="manifest_file",
-        default=common.manifest_file,
+        default=common.MANIFEST_FILE,
         required=False,
     )
     parser.add_argument(
         "--srcrev-file",
         help="""source revision file name (default: 'SRCREV.conf')""",
         dest="srcrev_file",
-        default=common.srcrev_file,
+        default=common.SRCREV_FILE,
         required=False,
     )
     parser.add_argument(
diff --git a/scripts/merge_into_manifest.py b/scripts/merge_into_manifest.py
index d60daad8..4c6b0754 100755
--- a/scripts/merge_into_manifest.py
+++ b/scripts/merge_into_manifest.py
@@ -96,7 +96,7 @@ def merge_into_manifest(
             manifest_revision = integrate_into_manifest(
                 manifest_project=manifest_project,
                 manifest_branch=target_branch,
-                manifest_file=common.manifest_file,
+                manifest_file=common.MANIFEST_FILE,
                 srcrev_file=srcrev_file,
                 recipe_name=recipe_name,
                 project=project,
@@ -161,7 +161,7 @@ def main():
         "--srcrev-file",
         help="""source revision file name (default: 'SRCREV.conf')""",
         dest="srcrev_file",
-        default=common.srcrev_file,
+        default=common.SRCREV_FILE,
         required=False,
     )
     parser.add_argument(
-- 
GitLab