No description
Find a file
2020-11-16 09:24:35 +01:00
.vscode Code from rfmcheck experiment ported and refactored, TODO: tests and comments 2020-10-28 17:39:01 +01:00
icas1helper use new python script for requirements tracing 2020-11-16 09:24:35 +01:00
test Cleanup, fixes and documentation 2020-10-30 18:31:59 +01:00
.gitignore Extend gitignore for VS Code, Linux, Windows, MacOS and VIM 2020-10-28 14:53:21 +01:00
config.yaml Used repo list, doc comments 2020-11-04 08:32:34 +01:00
icas1helper.bat Cleanup, fixes and documentation 2020-10-30 18:31:59 +01:00
icas1helper.py checkout command added 2020-11-04 11:50:21 +01:00
icas1helper.sh Cleanup, fixes and documentation 2020-10-30 18:31:59 +01:00
install.bat Code from rfmcheck experiment ported and refactored, TODO: tests and comments 2020-10-28 17:39:01 +01:00
install.sh Code from rfmcheck experiment ported and refactored, TODO: tests and comments 2020-10-28 17:39:01 +01:00
LICENSE.md Initial commit 2020-10-28 09:46:20 +01:00
README.md checkout command added 2020-11-04 11:50:21 +01:00
requirements.txt Requirements module 2020-11-02 17:45:14 +01:00
test.py Cleanup core 2020-10-29 17:29:03 +01:00

ICAS1Helper

This Python tool should help with common ICAS1 development tasks and ensure a process conform handling.

Installation

This tool comes with a list of required Python dependencies, see requirements.txt

You can setup a virtual environment and install all dependencies:

  • on Windows with: install.bat
  • on Linux with: install.sh

This will create a new virtual environment and install all required dependencies into this environment.

Configuration

ICAS1Helper is configured using some default configuration files.

config.yaml

This file comes with the tool and contains a set of default parameters for ICAS1, e.g. the Jenkins and Jira URLs.

~/icas1helper.yaml

The icas1helper.yaml placed in your home folder can be used to extend and overwrite settings of config.yaml.

~/.icas1helper.secrets.yaml

The .icas1helper.secrets.yaml places in your home folder is used as a secret store. You can use this file to save your credentials for the different servers, but be aware that the contents are encoded using aes256, but the password is either the hardcoded fallback in config.py or in one of your other configuration files. An attacker can easily decrypt and see your password with this knowledge, but it is still better than storing the credentials as plain text.

Usage

This tool is intended for command line usage. There are helper script for Windows (icas1helper.bat) and Linux (icas1helper.sh) to invoke the tool. This scripts enable the virtual environment and forward all arguments to icas1helper.py, which is the main Python file.

ICAS1Helper support "commands" as first argument, which can require further parameters. For a description of the commands see the following sections.

ci: check state of CI build

The command "ci" checks the CI build in the Jenkins server. An example output looks like:

PS C:\git\icas1helper> .\icas1helper.bat ci
Last CI build: 4368
Last CI build is still running, getting previous build.
Last finished CI build: 4367
CI build is OK.
True

This command relies on the configuration parameters:

  • jenkins, url: should point to the Jenkins root URL, e.g. https://hpc-jenkins-icas
  • jenkins, ci: should give the CI jobs path, e.g. /job/ICAS1_build_ci/

branch: create a new branch

The command "branch" creates a new branch based on devel, as default, oder the given branch name. Usage: icas1helper branch []

An example output looks like:

PS C:\Windows\system32> icas1helper.bat branch "ICAS1-12345 a test ticket"
Using base branch: devel
Created new feature branch: ICAS1-12345_a_test_ticket based on devel

This command relies on the configuration parameters:

  • repo, path: the local base folder of all git repos, e.g. C:\git\
  • repo, main: the name of the default repository, e.g. meta-icas1-linux
  • git, dev_base: the name of main development branch, e.g. devel

feat-branch: create a new feature branch

The command "branch" creates a new feature branch based on devel, as default, oder the given branch name. Usage: icas1helper branch []

An example output looks like:

PS C:\git\icas1helper> .\icas1helper.bat feat-branch 14797
INFO:root:Loading config file: config.yaml
INFO:root:Executing command: feat-branch
INFO:root:Arguments: ['14797']
Jira password:

DevTools listening on ws://127.0.0.1:58462/devtools/browser/fe7034a3-7ac3-4094-9e32-1bf8a1ab913c
[19448:15576:1102/080133.093:ERROR:device_event_log_impl.cc(208)] [08:01:33.093] Bluetooth: bluetooth_adapter_winrt.cc:1205 Getting Radio failed. Chrome will be unable to change the power state by itself.
[19448:15576:1102/080133.121:ERROR:device_event_log_impl.cc(208)] [08:01:33.121] Bluetooth: bluetooth_adapter_winrt.cc:1283 OnPoweredRadioAdded(), Number of Powered Radios: 1
[19448:15576:1102/080133.123:ERROR:device_event_log_impl.cc(208)] [08:01:33.123] Bluetooth: bluetooth_adapter_winrt.cc:1298 OnPoweredRadiosEnumerated(), Number of Powered Radios: 1
INFO:root:Jira login as thir820 successful.
INFO:root:Feature branch name for 14797: ICAS1-14797_DLT_timestamp_missing_for_some
INFO:root:Using base branch: devel
Created new feature branch: ICAS1-14797_DLT_timestamp_missing_for_some based on devel

This command relies on the configuration parameters:

  • repo, path: the local base folder of all git repos, e.g. C:\git\
  • repo, main: the name of the default repository, e.g. meta-icas1-linux
  • git, url: the base URL of the Jira server, e.g. https://jira.elektrobit.com
  • jira, project: the key of the Jira project, e.g. ICAS1

requirements: check requirements coverage

The command "requirements" runs the requirements tracing script and evaluates the result.

An example output looks like:

PS C:\git\icas1helper> .\icas1helper.bat requirements
INFO:root:Loading config file: C:\Users\thir820\.icas1helper.secrets.yaml
INFO:root:Loading config file: config.yaml
INFO:root:Debug mode: False
INFO:root:Executing command: requirements
Requirements tracing updated.
INFO:root:SWRS.Linux.EOLTester.Kernel: approved partially
INFO:root:SWRS.Linux.EOLTests: approved partially
...

Covered requirements: 604
Uncovered requirements: 65

This command relies on the configuration parameters:

  • repo, path: the local base folder of all git repos, e.g. C:\git\
  • repo, main: the name of the default repository, e.g. meta-icas1-linux

requirements-details: print requirements issue details

The command "requirements" prints the issue details for the last requirements tracing script result. This command needs and installed version of 'ripgrep'.

An example output looks like:

PS C:\git\icas1helper> .\icas1helper.bat requirements-details
INFO:root:Loading config file: C:\Users\thir820\.icas1helper.secrets.yaml
INFO:root:Loading config file: config.yaml
INFO:root:Debug mode: False
INFO:root:Executing command: requirements-details
INFO:root:SWRS.Linux.EOLTester.Kernel: approved partially
...
INFO:root:SWRS.Linux.systemd.generators: approved partially

Covered requirements: 604
Uncovered requirements: 65

---
SWRS.AP_TEE.UIDForwarding: status=approved coverage=partially
- doc\ireqs\linux.reqm
- doc\code-reviews\misc_swrs.reqm

---
SWRS.CoreDumpFiles.Content: status=approved coverage=partially
- recipes-core\pre-init\files\coredump-filter
- doc\ireqs\linux.reqm
...

This command relies on the configuration parameters:

  • repo, path: the local base folder of all git repos, e.g. C:\git\
  • repo, main: the name of the default repository, e.g. meta-icas1-linux

log: print change history for files

The command "log" prints the history for a set of files. Usage: icas1helper.py log ...

An example output looks like:

PS C:\Users\thir820> icas1helper.bat log README.md
INFO:root:Loading config file: C:\Users\thir820\.icas1helper.secrets.yaml
INFO:root:Loading config file: config.yaml
INFO:root:Debug mode: False
INFO:root:Executing command: log
INFO:root:Arguments: ['README.md']
File: README.md:
- Modified: Thomas Irgang (thir820) <thomas.irgang@elektrobit.com> Tue Oct 20 11:29:08 2020 +0200
- Summary: ICAS1-26280 Add commit template

- Modified: Kanzler Frank <Frank.Kanzler@elektrobit.com> Tue Sep 11 15:28:09 2018 +0200
- Summary: Initial commit

This command relies on the configuration parameters:

  • repo, path: the local base folder of all git repos, e.g. C:\git\
  • repo, main: the name of the default repository, e.g. meta-icas1-linux

checkout: checkout branch for all repos

The command "checkout" activates the given branch for all repos. Usage: icas1helper.py checkout

An example output looks like:

PS C:\Users\thir820\Desktop> icas1helper.bat checkout devel
INFO:root:Loading config file: C:\Users\thir820\.icas1helper.secrets.yaml
INFO:root:Loading config file: config.yaml
INFO:root:Debug mode: False
INFO:root:Executing command: checkout
INFO:root:Arguments: ['devel']
INFO:root:Checkout branch for meta-icas1-linux.
INFO:root:Checkout branch devel of C:\git\meta-icas1-linux.
INFO:root:Checkout branch for meta-icas1-linux-evo.
INFO:root:Checkout branch devel of C:\git\meta-icas1-linux-evo.
INFO:root:Checkout branch for meta-icas1-linux-mopf.
INFO:root:Checkout branch devel of C:\git\meta-icas1-linux-mopf.
Checkout of devel done.

This command relies on the configuration parameters:

  • repo, path: the local base folder of all git repos, e.g. C:\git\
  • git, repos: list of all repository names

sec-param: add an encrypted parameter

The command "sec-param" adds a new encrypted parameter to ~/.icas1helper.secrets.yaml. Usage: icas1helper.py sec-param ...

An example output looks like:

PS C:\Windows\system32> icas1helper.bat sec-param jira user2 world
INFO:root:Loading config file: C:\Users\thir820\.icas1helper.secrets.yaml
INFO:root:Loading config file: config.yaml
INFO:root:Executing command: sec-param
INFO:root:Arguments: ['jira', 'user2', 'world']
INFO:root:Loading config file: config.yaml
INFO:root:Add entry user2 to .icas1helper.secrets.yaml

This command relies on the configuration parameters:

  • repo, path: the local base folder of all git repos, e.g. C:\git\
  • repo, main: the name of the default repository, e.g. meta-icas1-linux
  • git, dev_base: the name of main development branch, e.g. devel

check-param: show a parameter value

The command "check-param" shows a parameter value. Usage: icas1helper.py check-param ...

An example output looks like:

PS C:\Windows\system32> icas1helper.bat check-param jira user2
INFO:root:Loading config file: C:\Users\thir820\.icas1helper.secrets.yaml
INFO:root:Loading config file: config.yaml
INFO:root:Executing command: check-param
INFO:root:Arguments: ['jira', 'user2']
INFO:root:Loading config file: config.yaml
Value: world

This command relies on the configuration parameters:

  • repo, path: the local base folder of all git repos, e.g. C:\git\
  • repo, main: the name of the default repository, e.g. meta-icas1-linux
  • git, dev_base: the name of main development branch, e.g. devel

Tests

You can run all unit tests using test.py.

Bug reports

If you find a bug, please write a descriptive mail to thomas.irgang@elektrobit.com