Skip to content

Fix NoneType errors and simplify proxy conditionals#29

Merged
MiguelCarpio merged 3 commits into
rhos-vaf:mainfrom
MiguelCarpio:Fix_NoneType
Jul 14, 2026
Merged

Fix NoneType errors and simplify proxy conditionals#29
MiguelCarpio merged 3 commits into
rhos-vaf:mainfrom
MiguelCarpio:Fix_NoneType

Conversation

@MiguelCarpio

@MiguelCarpio MiguelCarpio commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

  • Remove redundant default('') calls at usage sites.
  • Simplify conditionals from length check | length > 0 to truthiness test.
  • Support HTTPS-only proxy configurations.
  • Add bidirectional fallback, so HTTP falls back to HTTPS and vice versa.

Why do we need this PR?

  • To prevent NoneType errors when used with Jinja2 length filter or string interpolation.
  • Empty strings and None are both falsy in Jinja2, so the verbose | length > 0 pattern is unnecessary for string variables.
  • The proxy guards only checked gpu_validation_http_proxy, ignoring HTTPS-only setups.

@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 91338e0c-9ae1-435f-a59e-a77bb169b1fd

📥 Commits

Reviewing files that changed from the base of the PR and between e463c52 and 530a070.

📒 Files selected for processing (3)
  • gpu-validation/tasks/proxy.yaml
  • gpu-validation/tasks/setup.yaml
  • gpu-validation/templates/vllm-serve.service.j2
🚧 Files skipped from review as they are similar to previous changes (3)
  • gpu-validation/tasks/setup.yaml
  • gpu-validation/templates/vllm-serve.service.j2
  • gpu-validation/tasks/proxy.yaml

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved proxy configuration so HTTP settings can fall back to the HTTPS proxy when no HTTP proxy is provided.
    • Applied consistent proxy behavior across system environments, package management, container services, and VM connectivity checks.
    • Improved handling of optional memory page-size settings, preventing unintended hugepage configuration when unset.
  • Configuration
    • Empty proxy and memory page-size settings are now represented explicitly, improving predictable configuration behavior.

Walkthrough

GPU validation defaults now use explicit empty strings for memory page size and SSH proxy command. Task conditions use direct values, while proxy setup and service templates support either HTTP or HTTPS proxy values with HTTP-to-HTTPS fallback.

Changes

GPU validation configuration

Layer / File(s) Summary
Explicit empty-string defaults
gpu-validation/defaults/main.yaml
gpu_validation_mem_page_size and gpu_validation_ssh_proxy_command now default to explicit empty strings.
Direct task value checks
gpu-validation/tasks/vm_deploy.yaml, gpu-validation/tasks/vm_image.yaml
SSH polling and hugepage conditions use configured values directly without default('') fallbacks.
Proxy fallback and rendering
gpu-validation/tasks/setup.yaml, gpu-validation/tasks/proxy.yaml, gpu-validation/templates/vllm-serve.service.j2
Proxy setup is enabled when either proxy variable is truthy, and HTTP proxy settings fall back to the HTTPS proxy value across environment, dnf, Podman, and vLLM service configuration.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: NoneType error fixes and simpler proxy conditionals.
Description check ✅ Passed The description matches the changeset by describing the proxy fallback updates and simplified Jinja2 conditionals.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

bogdando
bogdando previously approved these changes Jul 14, 2026
Set empty string defaults ('') for gpu_validation_ssh_proxy_command
and gpu_validation_mem_page_size to prevent NoneType errors when
used with Jinja2 length filter or string interpolation. Remove
redundant default('') calls at usage sites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Empty strings and None are both falsy in Jinja2, so the verbose
'| length > 0' pattern is unnecessary for string variables.
Replaced with simple '{% if var %}' checks in setup.yaml,
vllm-serve.service.j2, and vm_image.yaml.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gpu-validation/tasks/setup.yaml`:
- Line 11: Update the guards in gpu-validation/tasks/setup.yaml at lines 11-11
and gpu-validation/templates/vllm-serve.service.j2 at lines 8-8 and 23-23 to use
gpu_validation_http_proxy or gpu_validation_https_proxy. This must include
proxy.yaml and emit both host and container proxy variables whenever either
proxy configuration is set.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: d4be2836-0bcf-4920-a73b-b7f6972ed289

📥 Commits

Reviewing files that changed from the base of the PR and between afb811c and e463c52.

📒 Files selected for processing (3)
  • gpu-validation/tasks/setup.yaml
  • gpu-validation/tasks/vm_image.yaml
  • gpu-validation/templates/vllm-serve.service.j2
🚧 Files skipped from review as they are similar to previous changes (1)
  • gpu-validation/tasks/vm_image.yaml

Comment thread gpu-validation/tasks/setup.yaml Outdated
The proxy guards only checked gpu_validation_http_proxy, ignoring
HTTPS-only setups. Updated all guards to trigger on either proxy
being set and added bidirectional fallback so HTTP falls back to
HTTPS and vice versa.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MiguelCarpio MiguelCarpio changed the title Fix NoneType errors in empty default variables Fix NoneType errors and simplify proxy conditionals Jul 14, 2026
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Comment thread gpu-validation/templates/vllm-serve.service.j2
@MiguelCarpio
MiguelCarpio merged commit aa1582f into rhos-vaf:main Jul 14, 2026
2 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