Skip to content

Conversation

@Honny1
Copy link
Collaborator

@Honny1 Honny1 commented Nov 4, 2025

Summary by CodeRabbit

  • Refactor
    • Standardized task names and unified public variable name (role_name → benchmark_role_name) across benchmark tooling and shared tasks.
  • Bug Fixes
    • Removed legacy Windows tar-based image-load path; adjusted template nil-comparison for consistent behavior.
  • Chores
    • Pinned ansible-lint workflow to a fixed release and simplified its configuration.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 4, 2025
@openshift-ci
Copy link

openshift-ci bot commented Nov 4, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tosokin for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link

openshift-ci bot commented Nov 4, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link

coderabbitai bot commented Nov 4, 2025

Walkthrough

Renames the public variable role_name to benchmark_role_name across several benchmark task mains and the shared map_variables.yml; wraps anonymous includes with a named task. Removes a Windows-specific tarfile load branch in shared_tasks/pull_image.yml. Pins the ansible-lint action and simplifies its inputs. Tweaks two Jinja2 nil comparisons in a crc-timing task.

Changes

Cohort / File(s) Summary
Benchmark task includes
projects/container_bench/toolbox/container_bench_exec_benchmark/tasks/main.yml, projects/container_bench/toolbox/container_bench_helloworld_benchmark/tasks/main.yml, projects/container_bench/toolbox/container_bench_image_build_large_build_context_benchmark/tasks/main.yaml
Replace anonymous include_tasks with a named task Map long variable names to short aliases that includes ../../shared_tasks/map_variables.yml; change passed var role_name: "<role>"benchmark_role_name: "<role>".
Shared mapping task variable rename
projects/container_bench/toolbox/shared_tasks/map_variables.yml
Replace all usages and examples of role_name with benchmark_role_name for variable key construction (e.g., vars[benchmark_role_name + '_binary_path']).
Image pull logic (Windows branch removed)
projects/container_bench/toolbox/shared_tasks/pull_image.yml
Remove the Windows-specific task that loaded images from a local tarfile when tarfile_exists; only the Unix/macOS tar-load path remains.
Ansible lint workflow pin & input simplification
.github/workflows/ansible-lint.yml
Pin action to v25.9.2 and remove several with: inputs, leaving args: "-c ansible-config/ansible-lint.yml".
Jinja2 comparison operator change
projects/crc-timing/toolbox/crc_timing_refresh_image/tasks/main.yml
Change is not None checks to != None in two template blocks (no functional change expected).

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Playbook
    participant pull_image as pull_image.yml
    participant Registry

    Playbook->>pull_image: call pull_image (tarfile_exists?)
    alt tarfile_exists is true
        Note right of pull_image `#E6F2FF`: Windows tar-load branch removed
        pull_image->>Registry: load image from tar (Unix/macOS path)
        Registry-->>pull_image: image loaded
    else tarfile not present
        pull_image->>Registry: pull image from registry
        Registry-->>pull_image: image pulled
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Verify no remaining role_name references in callers, tests, or docs.
  • Confirm map_variables.yml public parameter rename doesn't break external integrations.
  • Check Windows image-pull expectations where the tar-load branch was removed.

Possibly related PRs

Poem

I am a rabbit, hopping through keys,
I swap long names with graceful ease,
The Windows tar branch took a leap away,
Benchmarks chatter with a brighter name today. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the changeset - resolving ansible-lint issues across container_bench toolbox files and related workflow configurations.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8c82c27 and ae8bea0.

📒 Files selected for processing (5)
  • projects/container_bench/toolbox/container_bench_exec_benchmark/tasks/main.yml (1 hunks)
  • projects/container_bench/toolbox/container_bench_helloworld_benchmark/tasks/main.yml (1 hunks)
  • projects/container_bench/toolbox/container_bench_image_build_large_build_context_benchmark/tasks/main.yaml (1 hunks)
  • projects/container_bench/toolbox/shared_tasks/map_variables.yml (1 hunks)
  • projects/container_bench/toolbox/shared_tasks/pull_image.yml (0 hunks)
💤 Files with no reviewable changes (1)
  • projects/container_bench/toolbox/shared_tasks/pull_image.yml
🚧 Files skipped from review as they are similar to previous changes (4)
  • projects/container_bench/toolbox/container_bench_exec_benchmark/tasks/main.yml
  • projects/container_bench/toolbox/container_bench_helloworld_benchmark/tasks/main.yml
  • projects/container_bench/toolbox/shared_tasks/map_variables.yml
  • projects/container_bench/toolbox/container_bench_image_build_large_build_context_benchmark/tasks/main.yaml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Honny1 Honny1 marked this pull request as ready for review November 4, 2025 08:57
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 4, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3246de and 8c82c27.

📒 Files selected for processing (7)
  • .github/workflows/ansible-lint.yml (1 hunks)
  • projects/container_bench/toolbox/container_bench_exec_benchmark/tasks/main.yml (1 hunks)
  • projects/container_bench/toolbox/container_bench_helloworld_benchmark/tasks/main.yml (1 hunks)
  • projects/container_bench/toolbox/container_bench_image_build_large_build_context_benchmark/tasks/main.yaml (1 hunks)
  • projects/container_bench/toolbox/shared_tasks/map_variables.yml (1 hunks)
  • projects/container_bench/toolbox/shared_tasks/pull_image.yml (0 hunks)
  • projects/crc-timing/toolbox/crc_timing_refresh_image/tasks/main.yml (2 hunks)
💤 Files with no reviewable changes (1)
  • projects/container_bench/toolbox/shared_tasks/pull_image.yml
🚧 Files skipped from review as they are similar to previous changes (2)
  • projects/container_bench/toolbox/container_bench_helloworld_benchmark/tasks/main.yml
  • projects/container_bench/toolbox/container_bench_image_build_large_build_context_benchmark/tasks/main.yaml
🔇 Additional comments (4)
projects/container_bench/toolbox/container_bench_exec_benchmark/tasks/main.yml (1)

11-14: Named task with explicit variable passing looks good.

The refactored approach with a named task and explicit benchmark_role_name variable is cleaner and more maintainable than the previous pattern. The variable value correctly matches the role identifier.

projects/container_bench/toolbox/shared_tasks/map_variables.yml (1)

6-13: Variable renaming is consistent and correctly applied.

All variable references have been updated from role_name to benchmark_role_name. The dynamic key construction pattern (e.g., vars[benchmark_role_name + '_binary_path']) is correct and will properly map to the caller's prefixed variables (e.g., container_bench_exec_benchmark_binary_path).

.github/workflows/ansible-lint.yml (2)

35-58: Simplified configuration is cleaner and more maintainable.

The removal of redundant with: blocks (targets, override-deps, etc.) in favor of the explicit args: "-c ansible-config/ansible-lint.yml" approach is a good improvement. This makes the workflow more straightforward and easier to maintain.


37-37: v25.9.2 is a stable and current ansible-lint release.

Version v25.9.2 is an official stable release published Oct 8, 2025, and is the current release on PyPI and in the repository as of Nov 4, 2025. The version pin to v25.9.2 provides reproducibility while ensuring a stable, tested release.

]
EOF
when: crc_timing_refresh_image_disk_size is not None
when: crc_timing_refresh_image_disk_size != None
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify that != None comparison resolves the ansible-lint violations.

The changes replace Jinja2 test operators (is not None) with comparison operators (!= None). While both syntaxes work, Jinja2 idiomatically prefers test operators like is not none (lowercase none) over direct comparisons to None.

Confirm that this change (!= None) is indeed what ansible-lint expects and that it resolves the specific lint rule violations. If ansible-lint recommends a different approach, it may be that lowercase is not none (the Jinja2 test operator) is actually the preferred style.

Also applies to: 111-111


🌐 Web query:

What does ansible-lint recommend for checking None values in Jinja2 conditionals and when clauses?

💡 Result:

Use the Jinja2 none test (is none / is not none) rather than comparing to None/ "None" or relying on truthiness. Also prefer checking defined/undefined when appropriate to avoid broken conditionals. [1][2][3]

References:

  • ansible.builtin.none test (use "var is none" / "var is not none"). [1]
  • Ansible broken-conditionals guidance (avoid truthy/non-boolean conditionals; use explicit tests). [2]
  • ansible-lint docs / usage (lint enforces good Jinja2 spacing/tests and flags problematic conditionals). [3]

Replace != None comparisons with Jinja2 test operator is not none (lowercase).

The changes incorrectly replace is not None with != None, but ansible-lint recommends using Jinja2 test operators (is not none with lowercase none) rather than comparing to None. The current changes move away from idiomatic Jinja2 syntax instead of toward it.

Update both line 100 and line 111 to use is not none (lowercase none) instead:

  • Line 100: when: crc_timing_refresh_image_disk_size is not none
  • Line 111: {% if crc_timing_refresh_image_disk_size is not none %}
🤖 Prompt for AI Agents
In projects/crc-timing/toolbox/crc_timing_refresh_image/tasks/main.yml around
lines 100 and 111, the code uses `!= None` which is not idiomatic Jinja2;
replace those comparisons with the Jinja2 test operator using lowercase `none`.
Change the when at line 100 to use `is not none` and update the Jinja2
conditional at line 111 to `{% if crc_timing_refresh_image_disk_size is not none
%}`, ensuring both use the `is not none` form.

@kpouget
Copy link
Contributor

kpouget commented Nov 4, 2025

thanks @Honny1 , merging this

@kpouget kpouget merged commit f9e4df1 into openshift-psap:main Nov 4, 2025
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants