From: Eric Ball Date: Fri, 15 Apr 2022 13:07:43 +0000 (-0700) Subject: Fix: INFO job template and sanity_check call X-Git-Tag: v0.36.1^0 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F35%2F70035%2F2;p=releng%2Flftools.git Fix: INFO job template and sanity_check call 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 --- diff --git a/lftools/git/gerrit.py b/lftools/git/gerrit.py index 1d4a5e25..fe593e71 100644 --- a/lftools/git/gerrit.py +++ b/lftools/git/gerrit.py @@ -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()) diff --git a/lftools/git/templates/project.yaml b/lftools/git/templates/project.yaml index 59d8ff13..53de692d 100644 --- a/lftools/git/templates/project.yaml +++ b/lftools/git/templates/project.yaml @@ -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 index 00000000..72dfa783 --- /dev/null +++ b/releasenotes/notes/fix-info-job-errors-22a82ecea0feb4fe.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fix template for INFO jobs and a bad call to sanity_check in git.gerrit. diff --git a/tests/test_git.py b/tests/test_git.py index aa108a7a..7a8d9eb3 100644 --- a/tests/test_git.py +++ b/tests/test_git.py @@ -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