Project

General

Profile

Actions

action #121432

closed

coordination #96596: [qe-core][CI] CI/CD and Coding style improvements

[qe-core][opensuse-jobgroups] CI does not support 'deleting a yaml file'.

Added by szarate almost 2 years ago. Updated almost 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Refactor/Code Improvements
Target version:
Start date:
2022-12-05
Due date:
% Done:

0%

Estimated time:
Difficulty:
Sprint:
QE-Core: December Sprint (Dec 07 - Jan 11)

Description

Seems the CI does not support 'deleting a yaml file'...

Originally posted by @DimStar77 in https://github.com/os-autoinst/opensuse-jobgroups/issues/231#issuecomment-1336962203

When looking at the results, it seems we pass the files that are modified and simply pass them to yamllint tool...

 cd opensuse-jobgroups-pr
  yamllint -f github job_groups.yaml job_groups/opensuse_jump.yaml job_groups/opensuse_tumbleweed_legacy_x86.yaml 

Acceptance criteria

  • AC1: Deleted files don't cause the CI to fail
Actions #1

Updated by szarate almost 2 years ago

  • Tracker changed from coordination to action
  • Category set to Refactor/Code Improvements
  • Status changed from New to Workable
Actions #2

Updated by VANASTASIADIS almost 2 years ago

  • Status changed from Workable to In Progress
  • Assignee set to VANASTASIADIS
Actions #3

Updated by VANASTASIADIS almost 2 years ago

CI has a weird behavior here. If a dev opens a pr just deleting a file (and removing it from the job_groups.yaml accordingly), the CI will not count the deleted file as changed, and will not try to run yamllint on it. Example: https://github.com/os-autoinst/opensuse-jobgroups/pull/240

But, if the dev adds a random change to any other yaml file to that pr, the CI counts both the changed file AND the deleted file as changed: https://github.com/os-autoinst/opensuse-jobgroups/pull/239

The culprit is probably the step Get modified job group yaml files in the static-check job of the CI (https://github.com/os-autoinst/opensuse-jobgroups/blob/316b798494090c1724896b83eda47f3a6a435638/.github/workflows/ci.yml#L29) - for some reason if there are only deleted files it doesn't count them, but if there are deleted AND changed files it counts them all as changed.

There are 2 solutions:
a) compliment the yamllint command with --ignore-nonexistent-files so that it doesn't fail if a file is missing. THat may sound a bit risky, but if a file gets accidentally deleted (and thus remains in the job_groups.yaml file) it will be caught in the next CI step (check for orphaned yaml files).
b) Try and make the Get modified job group yaml files step to always recognize deleted files and not add them to the changed files.

Actions #5

Updated by VANASTASIADIS almost 2 years ago

  • Status changed from In Progress to Resolved

pr merged: resolving

Actions

Also available in: Atom PDF