Project

General

Profile

Actions

action #96675

closed

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

[qe-core] Add CI check preventing obsolete use of `check_var('VAR')

Added by apappas over 3 years ago. Updated almost 3 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Enhancement to existing tests
Target version:
Start date:
2021-08-09
Due date:
% Done:

0%

Estimated time:
Difficulty:
medium

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

Many uses of the check_var() have been obsoleted by fuctions like is_qemu and is_aarch64 which are more legible and should be the only way those conditions are checked.

Acceptance Criteria

  • AC1: Propose checks as an RFC in the os-autoinst-distri-opensuse repo.
  • AC2: Add a corresponding entry in the contributing document.
  • AC3: Make the mechanism extensible to new variables.

Initial Thoughts

  • 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.
Actions #1

Updated by apappas over 3 years ago

  • Assignee changed from apappas to dvenkatachala

Assigning to Dee who has already started working on this issue.

Actions #2

Updated by szarate over 3 years ago

Something else to keep in mind here, is that there's already something in the git repo:

https://github.com/os-autoinst/os-autoinst-distri-opensuse/blob/master/tools/check_code_style#L34

we don't need to necessarily adopt this, but is good to keep it in mind.

Actions #3

Updated by okurz about 3 years ago

  • Category set to Enhancement to existing tests
Actions #5

Updated by dvenkatachala about 3 years ago

  • Status changed from In Progress to Resolved

Replaced the function calls check_var('ARCH', '') with already defined functions(in the lib/Utils/Architectures.pm)
PR Merged: https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/13161

Actions #6

Updated by okurz about 3 years ago

  • Due date deleted (2021-09-01)
Actions #7

Updated by dvenkatachala about 3 years ago

  • Status changed from Resolved to Workable
Actions #8

Updated by dvenkatachala about 3 years ago

In the existing Perl module, we have called the functions check_var('ARCH', '') and check_var('BACKEND',''), replace these function calls with already defined functions in the lib/Utils/Architectures.pm and lib/Utils/Backends.pm.
Example: check_var('ARCH', 'aarch64') to is_aarch64 , check_var('ARCH', 's390x') to is_s390x.
PR Merged : https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/13161

Implement a CI check, which verifies function calls check_var('ARCH', '') and check_var('BACKEND','') when a new file is created or existing files are edited.

Actions #9

Updated by szarate about 3 years ago

  • Tracker changed from coordination to action
Actions #10

Updated by dvenkatachala about 3 years ago

  • Status changed from Workable to In Progress
Actions #11

Updated by dvenkatachala about 3 years ago

I had created PR for CI Story, https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/13456#partial-pull-merging. I will continue this work after my vacation.

Actions #13

Updated by dvenkatachala almost 3 years ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF