Skip to content

Commit

Permalink
Merge pull request #1069 from mulkieran/version-3.6.1
Browse files Browse the repository at this point in the history
Version 3.6.1
  • Loading branch information
mulkieran authored Apr 19, 2024
2 parents 7f7addb + 850a9a3 commit 1b8f182
Show file tree
Hide file tree
Showing 37 changed files with 605 additions and 423 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ name: stratis-cli dummy CI
on:
push:
branches:
- master
- patch-3.6.0
pull_request:
branches:
- master
- patch-3.6.0

workflow_dispatch:

Expand Down
32 changes: 20 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: stratis-cli CI
on:
push:
branches:
- master
- patch-3.6.0
paths-ignore:
- 'CHANGES.txt'
- '**/README.rst'
Expand All @@ -14,7 +14,7 @@ on:
- '.packit.yaml'
pull_request:
branches:
- master
- patch-3.6.0
paths-ignore:
- 'CHANGES.txt'
- '**/README.rst'
Expand All @@ -41,41 +41,46 @@ jobs:
python3-packaging
python3-psutil
python3-wcwidth
task: PYTHONPATH=./src make -f Makefile lint
task: >
PATH=${PATH}:/github/home/.local/bin PYTHONPATH=./src
make -f Makefile lint
- dependencies: black python3-isort
task: make -f Makefile fmt-ci
- dependencies: shfmt
task: make -f Makefile fmt-shell-ci
runs-on: ubuntu-latest
container: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT
container: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: >
dnf install -y
make
pip
python-unversioned-command
${{ matrix.dependencies }}
- name: Display Python version
run: python --version
- name: Install pyright
run: pip install --user pyright
- name: Run test
run: ${{ matrix.task }}

check-typos:
runs-on: ubuntu-latest
container: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT
container: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT
steps:
- name: Install dependencies
run: >
dnf install -y
clang
glibc-static
make
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
components: cargo
toolchain: 1.73.0 # CURRENT DEVELOPMENT RUST TOOLCHAIN
toolchain: 1.77.2 # CURRENT DEVELOPMENT RUST TOOLCHAIN
- uses: baptiste0928/cargo-install@v2
with:
crate: typos-cli
Expand All @@ -89,10 +94,10 @@ jobs:
# MANDATORY CHECKS USING CURRENT DEVELOPMENT ENVIRONMENT
- task: make -f Makefile all-tests
rust_log: RUST_LOG=stratisd=debug
image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT
image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT
- task: make -f Makefile coverage-no-html
rust_log:
image: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT
image: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT
# MANDATORY CHECKS USING LOWEST SUPPORTED ENVIRONMENT PROXY
- task: make -f Makefile all-tests
rust_log: RUST_LOG=stratisd=debug
Expand All @@ -103,7 +108,7 @@ jobs:
# yamllint disable rule:line-length
options: --privileged --userns=host --ipc=host -v /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro -v /usr/share/dbus-1:/usr/share/dbus-1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: >
dnf install -y
Expand Down Expand Up @@ -131,6 +136,9 @@ jobs:
toolchain: 1.71.1 # LOWEST SUPPORTED RUST TOOLCHAIN
- name: Check out stratisd
run: git clone https://github.com/stratis-storage/stratisd.git
- name: Use stratisd 3.6.7
run: git checkout tags/stratisd-v3.6.7 -b version-3.6.7
working-directory: ./stratisd
- name: Build stratisd
run: PROFILEDIR=debug make build-all
working-directory: ./stratisd
Expand Down Expand Up @@ -166,7 +174,7 @@ jobs:
steps:
- name: Display Python version
run: python3 --version
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: >
dnf install -y
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: stratis-cli CI for support code
on:
push:
branches:
- master
- patch-3.6.0
paths-ignore:
- 'CHANGES.txt'
- '**/README.rst'
Expand All @@ -14,7 +14,7 @@ on:
- 'shell-completion/**'
pull_request:
branches:
- master
- patch-3.6.0
paths-ignore:
- 'CHANGES.txt'
- '**/README.rst'
Expand All @@ -33,9 +33,9 @@ jobs:
- dependencies: yamllint
task: make -f Makefile yamllint
runs-on: ubuntu-latest
container: fedora:38 # CURRENT DEVELOPMENT ENVIRONMENT
container: fedora:39 # CURRENT DEVELOPMENT ENVIRONMENT
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install dependencies
run: >
dnf install -y
Expand Down
46 changes: 0 additions & 46 deletions .github/workflows/weekly.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ actions:
- "git clone https://github.com/stratis-storage/ci --depth=1 ../distro"
- "mv ../distro/mockbuild_test/stratis-cli.spec ../distro/stratis-cli.spec"
create-archive:
- "sed -i '/Requires.*stratisd/d' ../distro/stratis-cli.spec"
- "sh -c 'python3 ../distro/release_management/create_artifacts.py ../distro/ --pre-release --specfile-path=../distro/stratis-cli.spec stratis-cli $(rpmspec -q --srpm --qf %{Version} ../distro/stratis-cli.spec)'"
- "sh -c 'python3 ../distro/release_management/create_artifacts.py ../distro/ --pre-release --specfile-path=../distro/stratis-cli.spec stratis-cli'"
fix-spec-file:
- "echo 'skipping automatic fix-spec-file actions'"
get-current-version:
Expand Down
38 changes: 38 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@
stratis-cli 3.6.1
=================
Required stratisd version: 3.6.0

Recommended development environment: Fedora 38

* New commits:
* Remove weekly CI
* Run CI against patch branch
* Use stratid 3.6.7

* Cherry-picked commits:
* Do not specify the version to create_archive.py
* Use create_artifacts.py to remove Requires line
* github actions: update recommended Rust to 1.74.0
* Advance current development environment to Fedora 39
* github actions: update recommended Rust to 1.74.1
* github actions: update recommended Rust to 1.75.0
* Use checkout@v4
* Disable pylint fixme check
* Add a Makefile variable for pylint disables
* Make a group for Clevis-related pool create options
* Post-process namespace to detect parser errors
* Fix some parser tests
* Enforce precise parsing requirements for Clevis options
* github actions: update recommended Rust to 1.76.0
* Eliminate redundant action specifications
* Do not specify default value of None
* Simplify use of enums as choices in parser
* Use enum for Clevis choices
* Run pyright checks
* Use type keyword argument rather than action
* github actions: update recommended Rust to 1.77.0
* Allow two abbreviations
* github actions: update recommended Rust to 1.77.2
* Replace getpass with custom implementation that uses sys.stdin


stratis-cli 3.6.0
=================
Required stratisd version: 3.6.0
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,22 @@ UNITTEST_OPTS = --verbose
# need to be warned.
BANDIT_SKIP = --skip B404

PYLINT_DISABLE = --disable=fixme

.PHONY: lint
lint:
pylint setup.py
pylint bin/stratis
pylint src/stratis_cli --disable=duplicate-code --ignore=_introspect.py
pylint tests/whitebox --disable=duplicate-code
pylint setup.py ${PYLINT_DISABLE}
pylint bin/stratis ${PYLINT_DISABLE}
pylint src/stratis_cli --disable=duplicate-code ${PYLINT_DISABLE} --ignore=_introspect.py
pylint tests/whitebox --disable=duplicate-code ${PYLINT_DISABLE}
bandit setup.py ${BANDIT_SKIP}
bandit bin/stratis ${BANDIT_SKIP}
# Ignore B101 errors. We do not distribute optimized code, i.e., .pyo
# files in Fedora, so we do not need to have concerns that assertions
# are removed by optimization.
bandit --recursive ./src ${BANDIT_SKIP},B101
bandit --recursive ./tests ${BANDIT_SKIP}
pyright

.PHONY: fmt
fmt:
Expand Down
8 changes: 8 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[default.extend-words]
# Misidentified as misspelling of "BE"
DBE = "DBE"

[default.extend-identifiers]
# Misidentified as misspelling of "on"
pn = "pn"

[files]
# typos tries to correct the spelling of D-Bus signatures
extend-exclude = ["_introspect.py"]
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.pyright]
include = ["src", "tests", "bin"]
2 changes: 1 addition & 1 deletion src/stratis_cli/_actions/_bind.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def unbind(namespace):

unbind_method = (
Pool.Methods.UnbindClevis
if namespace.method == EncryptionMethod.CLEVIS.value
if namespace.method is EncryptionMethod.CLEVIS
else Pool.Methods.UnbindKeyring
)

Expand Down
2 changes: 1 addition & 1 deletion src/stratis_cli/_actions/_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
General constants.
"""
# isort: THIRDPARTY
from packaging.specifiers import Version
from packaging.version import Version

SERVICE = "org.storage.stratis3"
TOP_OBJECT = "/org/storage/stratis3"
Expand Down
6 changes: 3 additions & 3 deletions src/stratis_cli/_actions/_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

def get_timeout(value):
"""
Turn an input str or int into a float timeout value.
Turn an input str or int (milliseconds) into an int timeout value (secs).
:param value: the input str or int
:type value: str or int
:raises StratisCliEnvironmentError:
:returns: float
:returns: int
"""

maximum_dbus_timeout_ms = 1073741823
Expand Down Expand Up @@ -58,4 +58,4 @@ def get_timeout(value):
)

# Convert from milliseconds to seconds
return timeout_int / 1000
return timeout_int // 1000
9 changes: 6 additions & 3 deletions src/stratis_cli/_actions/_list_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ def _print_detail_view(self, mopool, size_change_codes):

clevis_info_str = (
_non_existent_or_inconsistent_to_str(
EncryptionInfoClevis(mopool.ClevisInfo()), interp=_clevis_to_str
EncryptionInfoClevis(mopool.ClevisInfo()),
interp=_clevis_to_str, # pyright: ignore [ reportArgumentType ]
)
if encrypted
else "unencrypted"
Expand Down Expand Up @@ -449,7 +450,8 @@ def _print_detail_view(self, pool_uuid, pool):
"unencrypted"
if clevis_info is None
else _non_existent_or_inconsistent_to_str(
clevis_info, interp=_clevis_to_str
clevis_info,
interp=_clevis_to_str, # pyright: ignore [ reportArgumentType ]
)
)
print(f"Clevis Configuration: {clevis_info_str}")
Expand All @@ -472,7 +474,8 @@ def clevis_str(value):
return "unencrypted"

return _non_existent_or_inconsistent_to_str(
value, interp=lambda _: "present"
value,
interp=lambda _: "present", # pyright: ignore [ reportArgumentType ]
) # pragma: no cover

def key_description_str(value):
Expand Down
Loading

0 comments on commit 1b8f182

Please sign in to comment.