From 12e311b1aaed1730a77993a82a01f98b838aa2d2 Mon Sep 17 00:00:00 2001 From: Daniel Gomez Date: Mon, 10 Feb 2025 11:36:26 +0000 Subject: [PATCH 1/2] kdevops_archive: read commit message from file Fix error below by creating a temporary file with commit message and use that as input: 1. Create temporary file 2. Create temporary var with commit message 3. Write commit message to file 4. git-commit using temporary file content 5. Delete temporary file Also, update tasks to include FQCN. Error: TASK [kdevops_archive : Commit the archive] ************************************ fatal: [localhost]: FAILED! => { "changed": true, "cmd": "git commit -m \"kdevops: Revert \"bringup: Use full path when creating custom_source file\"\n\nThis adds test results for:\n workflow: fstests\n tree: linux\n ref: linux\n test number: 0001\n test result: ok\n\nDetailed test report:\n\nKERNEL: 6.14.0-rc2\nCPUS: 8\n\nxfs_reflink_4k: 1 tests, 16 seconds\n generic/003 Pass 13s\nTotals: 1 tests, 0 skipped, 0 failures, 0 errors, 13s\n\"\n", "delta": "0:00:00.006967", "end": "2025-02-10 02:34:48.789646", "rc": 1, "start": "2025-02-10 02:34:48.782679" } STDERR: error: pathspec 'Use' did not match any file(s) known to git error: pathspec 'full' did not match any file(s) known to git error: pathspec 'path' did not match any file(s) known to git error: pathspec 'when' did not match any file(s) known to git error: pathspec 'creating' did not match any file(s) known to git error: pathspec 'custom_source' did not match any file(s) known to git error: pathspec 'file This adds test results for: workflow: fstests tree: linux ref: linux test number: 0001 test result: ok Detailed test report: KERNEL: 6.14.0-rc2 CPUS: 8 xfs_reflink_4k: 1 tests, 16 seconds generic/003 Pass 13s Totals: 1 tests, 0 skipped, 0 failures, 0 errors, 13s ' did not match any file(s) known to git MSG: non-zero return code PLAY RECAP ********************************************************************* localhost : ok=53 changed=15 unreachable=0 failed=1 skipped=12 rescued=0 ignored=0 Signed-off-by: Daniel Gomez --- .../roles/kdevops_archive/tasks/main.yml | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/kdevops_archive/tasks/main.yml b/playbooks/roles/kdevops_archive/tasks/main.yml index a68e9c84a..07bdd3ca5 100644 --- a/playbooks/roles/kdevops_archive/tasks/main.yml +++ b/playbooks/roles/kdevops_archive/tasks/main.yml @@ -408,8 +408,15 @@ kdevops_archive_ci_test_result: "unknown" when: not ci_result_file.stat.exists +- name: Create a temporary file for commit message + ansible.builtin.tempfile: + state: file + suffix: txt + prefix: kdevops_commit_msg_ + register: tmp_commit_msg + - name: Set commit message - set_fact: + ansible.builtin.set_fact: commit_message: | {{ kdevops_archive_test_trigger }}: {{ kdevops_archive_test_subject }} @@ -424,14 +431,25 @@ {{ kdevops_archive_test_commit }} +- name: Copy commit message into temporary file + ansible.builtin.copy: + content: "{{ commit_message }}" + dest: "{{ tmp_commit_msg.path }}" + mode: '0644' + - name: Commit the archive - shell: | - git commit -m "{{ commit_message }}" + ansible.builtin.shell: | + git commit --file "{{ tmp_commit_msg.path }}" args: chdir: "{{ kdevops_results_archive_dir }}" environment: GIT_LFS_SKIP_SMUDGE: "0" +- name: Remove temporary file with commit message + ansible.builtin.file: + path: "{{ tmp_commit_msg.path }}" + state: absent + - name: Push changes to remote repository command: cmd: git push origin main From ffd6065eea7b7b33adf7e8899938af2ca55501c3 Mon Sep 17 00:00:00 2001 From: Daniel Gomez Date: Mon, 10 Feb 2025 13:48:04 +0000 Subject: [PATCH 2/2] bringup_guestfs: fix CUSTOM_INDEX realpath Ensure $CUSTOM_IMAGE_DIR directory exists before running realpath. Otherwise, realpath returns with an error when used on a file located in a non-existent directory. Example: realpath /tmp/testing /tmp/testing realpath /tmp/testing/file realpath: /tmp/testing/file: No such file or directory mkdir -p /tmp/testing realpath /tmp/testing/file /tmp/testing/file Fixes 5649a0d ("bringup: Use full path when creating custom_source file") Signed-off-by: Daniel Gomez --- scripts/bringup_guestfs.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh index ad5a5f35e..08c868c46 100755 --- a/scripts/bringup_guestfs.sh +++ b/scripts/bringup_guestfs.sh @@ -111,9 +111,8 @@ build_custom_image() CUSTOM_IMAGE="${CUSTOM_IMAGE_DIR}/${OS_VERSION}.raw" CUSTOM_IMAGE_OK="${CUSTOM_IMAGE_DIR}.ok" CUSTOM_SOURCE="/etc/virt-builder/repos.d/kdevops-custom-images-${OS_VERSION}.conf" - CUSTOM_INDEX="$(realpath ${CUSTOM_IMAGE_DIR}/index)" - mkdir -p ${CUSTOM_IMAGE_DIR} + CUSTOM_INDEX="$(realpath ${CUSTOM_IMAGE_DIR}/index)" if [[ ! -f $CUSTOM_IMAGE && "$CONFIG_GUESTFS_HAS_CUSTOM_RAW_IMAGE_URL" == "y" ]]; then fetch_custom_image