Fix: INFO job template and sanity_check call 35/70035/2 v0.36.1
authorEric Ball <eball@linuxfoundation.org>
Fri, 15 Apr 2022 13:07:43 +0000 (06:07 -0700)
committerEric Ball <eball@linuxfoundation.org>
Fri, 15 Apr 2022 13:25:03 +0000 (06:25 -0700)
The INFO job template was improperly formatted. The sanity_check call
is to a class method, and requires and positional argument for "self"
(this does not need to contain anything; it is just filler in this
case).

Change-Id: I1dcbc456bf31e907821ab4c5aee7c324dbd70722
Signed-off-by: Eric Ball <eball@linuxfoundation.org>
lftools/git/gerrit.py
lftools/git/templates/project.yaml
releasenotes/notes/fix-info-job-errors-22a82ecea0feb4fe.yaml [new file with mode: 0644]
tests/test_git.py

index 1d4a5e2..fe593e7 100644 (file)
@@ -181,7 +181,7 @@ class Gerrit:
         gerrit_project test/test1
         issue_id: CIMAN-33
         """
-        gerrit_api.sanity_check(self.fqdn, gerrit_project)
+        gerrit_api.sanity_check(None, self.fqdn, gerrit_project)
         filename = ".gitreview"
 
         jinja_env = Environment(loader=PackageLoader("lftools.git"), autoescape=select_autoescape())
index 59d8ff1..53de692 100644 (file)
@@ -1,11 +1,11 @@
 ---
-project:
+project:
     name: {{ project_name_dashed }}-project-view
     project-name: {{ project_name_dashed }}
     views:
       - project-view
 
-project:
+project:
     name: {{ project_name_dashed }}-info
     project: {{ project_name }}
     project-name: {{ project_name_dashed }}
diff --git a/releasenotes/notes/fix-info-job-errors-22a82ecea0feb4fe.yaml b/releasenotes/notes/fix-info-job-errors-22a82ecea0feb4fe.yaml
new file mode 100644 (file)
index 0000000..72dfa78
--- /dev/null
@@ -0,0 +1,4 @@
+---
+fixes:
+  - |
+    Fix template for INFO jobs and a bad call to sanity_check in git.gerrit.
index aa108a7..7a8d9eb 100644 (file)
@@ -84,13 +84,13 @@ def test_add_info_job(mock_init, datafiles, mocker):
     commit_msg = "Chore: Automation adds project-subproject.yaml"
     filepath = os.path.join(mock_init.repo.working_tree_dir, "jjb/project-subproject/project-subproject.yaml")
     content = """---
-project:
+project:
     name: project-subproject-project-view
     project-name: project-subproject
     views:
       - project-view
 
-project:
+project:
     name: project-subproject-info
     project: project/subproject
     project-name: project-subproject