Project

General

Profile

action #96675

coordination #96596: [qe-core][CI] Implement checks in the CI for common errors/coding style

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

Added by apappas 5 months ago. Updated 2 months ago.

Status:
In Progress
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.

History

#1 Updated by apappas 5 months ago

  • Assignee changed from apappas to dvenkatachala

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

#2 Updated by szarate 5 months 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.

#3 Updated by okurz 5 months ago

  • Category set to Enhancement to existing tests

#5 Updated by dvenkatachala 4 months 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

#6 Updated by okurz 4 months ago

  • Due date deleted (2021-09-01)

#7 Updated by dvenkatachala 4 months ago

  • Status changed from Resolved to Workable

#8 Updated by dvenkatachala 4 months 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.

#9 Updated by szarate 4 months ago

  • Tracker changed from coordination to action

#10 Updated by dvenkatachala 4 months ago

  • Status changed from Workable to In Progress

#11 Updated by dvenkatachala 2 months 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.

Also available in: Atom PDF