Copilot commented on code in PR #2222:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2222#discussion_r3672188760
##########
behave_framework/src/minifi_behave/core/helpers.py:
##########
@@ -53,31 +62,35 @@ def wait_for_condition(condition: Callable[[], bool],
timeout_seconds: float, ba
if condition():
return True
if bail_condition():
- logging.warning("Bail condition evaluated to 'True', aborting
wait.")
+ logger.warning("Bail condition evaluated to 'True', aborting
wait.")
log_due_to_failure(context)
return False
remaining_time = timeout_seconds - (time.monotonic() - start_time)
sleep_time = min(1.0, remaining_time)
if sleep_time > 0:
time.sleep(sleep_time)
except Exception as ex:
- logging.warning("Exception while waiting for condition: %s", ex)
+ logger.warning("Exception while waiting for condition: %s", ex)
log_due_to_failure(context)
return False
- logging.warning("Timed out after %d seconds while waiting for condition",
timeout_seconds)
+ logger.warning(
+ "Timed out after %d seconds while waiting for condition",
timeout_seconds
+ )
Review Comment:
The log message uses a `%d` formatter, but `timeout_seconds` is typed/used
as a float (and may be non-integer at runtime). This can raise a `TypeError`
during logging. Use `%s` / `%.2f` formatting, or switch to f-string formatting
to safely handle floats.
##########
.github/workflows/ci.yml:
##########
@@ -603,15 +603,15 @@ jobs:
name: minifi_rs_behave
path: minifi_rust/minifi_rs_behave/output
linters:
- name: "C++ lint + Shellcheck + Flake8 + Cargo fmt check + Clippy check"
- runs-on: ubuntu-22.04-arm
+ name: "C++ lint + Shellcheck + Ruff + Cargo fmt check + Clippy check"
+ runs-on: ubuntu-24.04-arm
timeout-minutes: 15
steps:
- id: checkout
uses: actions/checkout@v6
- id: install_deps
- run: sudo apt update && sudo apt install -y flake8
+ run: pipx install ruff
Review Comment:
The previous Flake8 wrapper explicitly excluded directories like
`thirdparty/`, `build/`, and various virtualenv dirs. With `ruff check` invoked
without an explicit path/exclude list (and no `exclude` configured in
`ruff.toml`), the lint surface area may unintentionally expand (including
vendored/third-party code), increasing runtime and maintenance noise. Consider
aligning Ruff’s scope with the old behavior via `exclude` in `ruff.toml`
(preferred) or by passing explicit include/exclude arguments in CI.
##########
.github/workflows/ci.yml:
##########
@@ -623,10 +623,10 @@ jobs:
continue-on-error: true
run: ./run_shellcheck.sh .
- - id: flake8_check
- name: Flake8 check
+ - id: python_check
+ name: Python check
continue-on-error: true
- run: ./run_flake8.sh .
+ run: ruff check && ruff format --check
Review Comment:
The previous Flake8 wrapper explicitly excluded directories like
`thirdparty/`, `build/`, and various virtualenv dirs. With `ruff check` invoked
without an explicit path/exclude list (and no `exclude` configured in
`ruff.toml`), the lint surface area may unintentionally expand (including
vendored/third-party code), increasing runtime and maintenance noise. Consider
aligning Ruff’s scope with the old behavior via `exclude` in `ruff.toml`
(preferred) or by passing explicit include/exclude arguments in CI.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]