Project

General

Profile

Actions

coordination #96596

open

[qe-core][CI] CI/CD and Coding style improvements

Added by szarate about 2 years ago. Updated about 1 month ago.

Status:
Blocked
Priority:
Normal
Assignee:
Category:
Infrastructure
Target version:
Start date:
2021-08-09
Due date:
% Done:

72%

Estimated time:
(Total: 0.00 h)
Difficulty:
Sprint:
QE-Core: April Sprint 23 (Apr 05 - May 03)

Description

Story

As a code reviewer I would like the CI to do menial checks so that I can focus on bigger details and be more effective with my work.

Background

Often when doing the reviews on GH, reviewers tend to mention when:

  • File header not being updated
  • File without summary and mantainer field
    • Create a mantainer list and only allow a person to be mantainer in a module, if they're in such MANTAINERS
  • Syntax checkers for coding style
    • Things like if check_var('ARCH') instead of is_aarch64 being wildly used, When there is Utils::Architectures::is_aarch64. When finding the check_var syntax, propose the aforementioned function
    • Things like if check_var('BACKEND', 'qemu') instead of is_qemu being wildly used, When there are Utils::Backends::is_qemu. When finding the check_var syntax, propose the aforementioned function.
    • Mix between my $self = shift and my ($self) = @_, the proposal would be to stick to my ($self) = @_
  • Failures in the tidy checks that are often hard to find (Meaning, can we get comments on the offending lines?), which can be maybe generic enough to help with other parts of automated review.
  • Know which jobs would be possibly affected by certain code changes
    • Adding openqa-module-mapper in the current state, display last 20 jobs that are related to the changes in the PR.

AC's for feach item

  • AC1: Each subtask is proposed as an RFC in the os-autoinst-distri-opensuse repo.
  • AC2: There's a corresponding entry in the contributing document.

For syntax checking (check_var, get_var, script.*zypper... etc)

  • Create a hash table in yaml, json, xml, CORBA, toml, $MARKUPLANGUAGE to check with a regex for a syntax that when matching, would propose a suggestion.
  • Use etherpad.nue.suse.com/qe-core-proposed-syntax-checks to add the proposals.

Subtasks 12 (3 open9 closed)

action #96675: [qe-core] Add CI check preventing obsolete use of `check_var('VAR')Resolveddvenkatachala2021-08-09

Actions
action #96716: [qe-core][CI] Add CI check for module header not being updatedResolvedpunkioudi2021-08-10

Actions
action #97097: [qe-core][CI] Add syntax checkers to the CI to verify the parameter parsing (move away from my $self = shift)New2021-08-18

Actions
action #115343: [qe-core] os-autoinst-distri-opensuse checks for record_soft_failure without valid reference is ineffectiveResolvedrfan12022-10-11

Actions
action #117835: [qe-core] add some exceptions for `record_soft_fail` to check effective reference ticketsResolvedrfan12022-10-11

Actions
action #117118: [qe-core] CI/CD and Coding style improvements - Forbid usage of fgrep and egrepResolvedVANASTASIADIS2022-09-23

Actions
action #118582: [qe-core][CI][timeboxed:24h] Provide automated feedback on PR's when one or more checks failRejectedVANASTASIADIS2022-10-13

Actions
action #118588: [qe-core][CI] Anotate output when there are code violations on github's PR.Resolvedpdostal2022-10-13

Actions
action #121432: [qe-core][opensuse-jobgroups] CI does not support 'deleting a yaml file'.ResolvedVANASTASIADIS2022-12-05

Actions
action #122923: [qe-core][CI] Hide passing check messages from the CI logsResolvedrfan12022-10-13

Actions
action #124688: [qe-core] Reduce execution of compile testsBlockedrfan12023-02-16

Actions
action #126518: [qe-core] Metadata check does not show up on GH like tidy (for instance) doesNew2023-03-23

Actions

Related issues 2 (1 open1 closed)

Related to openQA Tests - action #51230: [qe-core][functional] Unify all usages of systemctlBlocked2019-05-07

Actions
Related to openQA Tests - action #116599: [qe-core] SCC regcodes leaking mitigation - wheels fail in CI Compile checks when enabledResolveddheidler2022-09-15

Actions
Actions #1

Updated by szarate about 2 years ago

  • Description updated (diff)
Actions #3

Updated by szarate about 2 years ago

  • Description updated (diff)
Actions #4

Updated by szarate about 2 years ago

  • Description updated (diff)
Actions #5

Updated by szarate about 2 years ago

  • Description updated (diff)
Actions #6

Updated by szarate about 2 years ago

  • Description updated (diff)

For getting modified files in the current changeset: git status --porcelain "${files[@]}" | awk '{ print $2 }'

Actions #7

Updated by szarate about 2 years ago

  • Project changed from 175 to openQA Tests
  • Category set to Infrastructure
  • Target version set to QE-Core: Ready
Actions #8

Updated by tjyrinki_suse over 1 year ago

  • Status changed from New to Workable
Actions #9

Updated by szarate over 1 year ago

  • Status changed from Workable to New
Actions #10

Updated by szarate over 1 year ago

  • Target version deleted (QE-Core: Ready)
Actions #11

Updated by szarate over 1 year ago

  • Related to action #51230: [qe-core][functional] Unify all usages of systemctl added
Actions #12

Updated by szarate about 1 year ago

  • Related to action #115343: [qe-core] os-autoinst-distri-opensuse checks for record_soft_failure without valid reference is ineffective added
Actions #13

Updated by szarate about 1 year ago

  • Related to action #116599: [qe-core] SCC regcodes leaking mitigation - wheels fail in CI Compile checks when enabled added
Actions #14

Updated by szarate about 1 year ago

  • Tracker changed from coordination to action
Actions #15

Updated by szarate about 1 year ago

  • Tracker changed from action to coordination
Actions #16

Updated by szarate about 1 year ago

  • Subject changed from [qe-core][CI] Implement checks in the CI for common errors/coding style to [qe-core][CI] CI/CD and Coding style improvements
  • Status changed from New to Blocked
  • Assignee set to szarate
  • Target version set to QE-Core: Ready
Actions #17

Updated by szarate about 1 year ago

  • Parent task deleted (#95161)

Removing parent for now, this is a separate epic on it's own

Actions #19

Updated by szarate about 1 year ago

This ticket should help with preparing of the automated deployments or rather the triggering of new Service Packs into Development or Maintenance phases, for this we need a new epic.

This epic should stay only for static checks and code improvements.

  • automatic push of use strict; warnings and testapi goes in here too.
Actions #20

Updated by szarate 12 months ago

  • Sprint set to QE-Core: October Sprint (Sep 28 - Oct 26)
  • Tags set to qe-core-october-sprint
Actions #21

Updated by szarate 12 months ago

  • Related to deleted (action #115343: [qe-core] os-autoinst-distri-opensuse checks for record_soft_failure without valid reference is ineffective)
Actions #22

Updated by szarate 11 months ago

  • Sprint changed from QE-Core: October Sprint (Sep 28 - Oct 26) to QE-Core: November Sprint (Nov 09 - Nov 22)
Actions #23

Updated by szarate 10 months ago

  • Tracker changed from coordination to action
Actions #24

Updated by szarate 10 months ago

  • Tracker changed from action to coordination
Actions #25

Updated by szarate 10 months ago

  • Sprint changed from QE-Core: November Sprint (Nov 09 - Dec 07) to QE-Core: December Sprint (Dec 07 - Jan 04)
Actions #26

Updated by szarate 9 months ago

From: https://suse.slack.com/archives/C02CANHLANP/p1673359533046859?thread_ts=1673351658.066219&cid=C02CANHLANP

I always ended up calling the stuff directly on my own and never bothered to go further, but having make targets that allow parameters makes so much more sense...
and having a target similar to make tidy, we can actually do the same with make tests so the behavior only affects modified files.

Actions #27

Updated by pvorel 9 months ago

From our discussion in RC linked in previous: It'd be great to have way to easily run all tests which are in CI (./tools/check_metadata, ./tools/tidy, ...) on single file or list of specified files. What I usually need is to quickly test 1-3 files. Make targets used for testing, which are specified in top level Makefile are run on all files, which does not scale.

There could be ./tools/test-everything, which would expect list of files and run all tests on them (or at least these which can be run easily locally). The problem is that some commands are defined in the top level Makefile (e.g. perlcritic), all of these would have to be also put as scripts in ./tools/. Having commands defined in Makefile can brings complications (at least you need to have make installed, I'd try to have minimum scripting in Makefile, just call scripts in ./tools/).

Not only I want fast way to test everything I modified locally. Other problem, which bothers me is the long output, when everything is tested with pipes. Pipes does not print affected file, thus I need to scroll to find which tool reported particular error and run it locally on files I modified to see the problem.

Running locally I get files:

./tools/check_metadata $(git ls-files)
Missing Copyright <year> SUSE LLC in data/ai_ml/tvm/post_processing.py
Missing '# Summary: <multi line summary of test>' in data/apparmor/adminer.php5
Missing '# Maintainer: <email address>' in data/apparmor/adminer.php5

But in CI I see many useless output, which makes things hard to find:

tools/check_metadata $(git ls-files "tests/**.pm")
# Maintainer: Guillaume GARDET <guillaume@opensuse.org>
# Maintainer: Guillaume GARDET <guillaume@opensuse.org>
# Maintainer: QE Security <none@suse.de>`

The same problem is with other tests perlcritic.

Actions #28

Updated by szarate 9 months ago

  • Sprint changed from QE-Core: December Sprint (Dec 07 - Jan 11) to QE-Core: January Sprint (Jan 11 - Feb 08)
Actions #29

Updated by szarate 8 months ago

  • Sprint changed from QE-Core: January Sprint (Jan 11 - Feb 08) to QE-Core: February Sprint (Feb 08 - Mar 08)
Actions #31

Updated by szarate 7 months ago

  • Tags changed from qe-core-october-sprint to qe-core-october-sprint, qe-core-february-sprint

missed to add the tag

Actions #32

Updated by szarate 7 months ago

  • Sprint changed from QE-Core: February Sprint (Feb 08 - Mar 08) to QE-Core: March Sprint (Mar 08 - Apr 05)
Actions #33

Updated by szarate 6 months ago

  • Sprint changed from QE-Core: March Sprint (Mar 08 - Apr 05) to QE-Core: April Sprint 23 (Apr 05 - May 03)
Actions #34

Updated by szarate 5 months ago

  • Sprint changed from QE-Core: April Sprint 23 (Apr 05 - May 03) to QE-Core: May Sprint 23 (May 10 - May 31)
Actions #35

Updated by szarate 5 months ago

  • Sprint changed from QE-Core: May Sprint 23 (May 10 - May 31) to QE-Core: April Sprint 23 (Apr 05 - May 03)
Actions

Also available in: Atom PDF