action #96675
closedcoordination #96596: [qe-core][CI] CI/CD and Coding style improvements
[qe-core] Add CI check preventing obsolete use of `check_var('VAR')
0%
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.
Updated by apappas about 3 years ago
- Assignee changed from apappas to dvenkatachala
Assigning to Dee who has already started working on this issue.
Updated by szarate about 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.
Updated by okurz about 3 years ago
- Category set to Enhancement to existing tests
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
Updated by dvenkatachala about 3 years ago
- Status changed from Resolved to Workable
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.
Updated by szarate about 3 years ago
- Tracker changed from coordination to action
Updated by dvenkatachala about 3 years ago
- Status changed from Workable to In Progress
Updated by dvenkatachala almost 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.
Updated by dvenkatachala over 2 years ago
Updated by dvenkatachala over 2 years ago
- Status changed from In Progress to Resolved