Skip to content

add check on "VRL compilation warning"#3345

Open
vparfonov wants to merge 1 commit into
openshift:masterfrom
vparfonov:checkVrlWarn
Open

add check on "VRL compilation warning"#3345
vparfonov wants to merge 1 commit into
openshift:masterfrom
vparfonov:checkVrlWarn

Conversation

@vparfonov

@vparfonov vparfonov commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Description

This PR add checking what VRL code has no warnings

/cc
/assign

Links

  • Depending on PR(s):
  • GitHub issue:
  • JIRA:
  • Enhancement proposal:

Summary by CodeRabbit

  • Tests
    • Improved functional test cleanup and diagnostics.
    • Collector logs are now checked for VRL compilation warnings during successful tests.
    • Test artifacts and container logs continue to be preserved when tests fail.

@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 Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

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
📝 Walkthrough

Walkthrough

Updates collector cleanup to defer client closure, preserve failure artifact collection, and validate successful-test collector logs for VRL compilation warnings.

Changes

Collector cleanup validation

Layer / File(s) Summary
Cleanup lifecycle and log assertion
test/framework/functional/framework.go
Adds Gomega support, defers client closure, retains failure log artifact flushing, and asserts that successful-test collector logs do not contain VRL compilation warnings.

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

Suggested reviewers: clee2691, cahartma

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The template sections are present, but the mandatory /cc and /assign entries and supporting links are missing, and the intent is only minimally described. Add concrete /cc and /assign commands, expand the description with context and rationale, and fill in relevant dependency or issue links.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: adding a check for VRL compilation warnings.
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.

@openshift-ci

openshift-ci Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

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

@vparfonov

Copy link
Copy Markdown
Contributor Author

/test functional-target

3 similar comments
@vparfonov

Copy link
Copy Markdown
Contributor Author

/test functional-target

@vparfonov

Copy link
Copy Markdown
Contributor Author

/test functional-target

@vparfonov

Copy link
Copy Markdown
Contributor Author

/test functional-target

@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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

1 similar comment
@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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

@vparfonov
vparfonov marked this pull request as ready for review July 17, 2026 12:40
@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 Jul 17, 2026
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 17, 2026
@openshift-ci
openshift-ci Bot requested review from Clee2691 and cahartma July 17, 2026 12:42

@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

🧹 Nitpick comments (2)
test/framework/functional/framework.go (2)

152-154: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider simplifying the redundant strings.Contains pre-check.

The strings.Contains check gates the gomega.Expect(...).ToNot(gomega.ContainSubstring(...)) assertion, but the assertion alone already handles both the pass and fail cases. The pre-check only adds a log.Info diagnostic before the guaranteed failure. If the diagnostic log is desired, consider using gomega.Expect with a custom failure message instead to reduce the double-check pattern.

🤖 Prompt for 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.

In `@test/framework/functional/framework.go` around lines 152 - 154, Simplify the
VRL warning assertion in the collector log validation by removing the redundant
strings.Contains pre-check and its log.Info call. Use the existing gomega.Expect
assertion directly, adding a custom failure message only if diagnostic context
is needed.

136-157: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use if/else for mutually exclusive g.Failed() branches.

if g.Failed() and if !g.Failed() are mutually exclusive. Combining them into an if/else avoids evaluating g.Failed() twice and makes the intent clearer.

♻️ Proposed refactor
 		if g.Failed() {
 			for _, container := range f.Pod.Spec.Containers {
 				log.Info("Dumping logs for container", "container", container.Name)
 				logs, err := oc.Logs().WithNamespace(f.Namespace).WithPod(f.Pod.Name).WithContainer(container.Name).Run()
 				if err != nil {
 					log.Error(err, "Unable to retrieve logs", "container", container.Name)
 				}
 				if _, err = fmt.Fprintln(f.delayedWriter, logs); err != nil {
 					log.Error(err, "Error writing", "container", container.Name)
 				}
 			}
 			f.delayedWriter.FlushToArtifactsDir(fmt.Sprintf("%s_%d.log", g.FileName(), g.LineNumber()))
-		}
-
-		if !g.Failed() {
+		} else {
 			if collectorLogs, err := f.ReadCollectorLogs(); err == nil {
 				if strings.Contains(collectorLogs, "VRL compilation warning") {
 					log.Info("VRL compilation warning detected in collector logs")
 					gomega.Expect(collectorLogs).ToNot(gomega.ContainSubstring("VRL compilation warning"))
 				}
 			}
 		}
🤖 Prompt for 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.

In `@test/framework/functional/framework.go` around lines 136 - 157, Refactor the
adjacent g.Failed() checks into a single if/else structure: keep the container
log dumping and artifact flushing in the failed branch, and move the
collector-log validation into the else branch. Avoid evaluating g.Failed() twice
while preserving both branches’ existing behavior.
🤖 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 `@test/framework/functional/framework.go`:
- Around line 150-156: Update the ReadCollectorLogs error path in the existing
collector-log validation block to log the returned error when reading logs
fails. Preserve the current VRL warning check for successful reads, but ensure
failures are visible in test output instead of being silently ignored.

---

Nitpick comments:
In `@test/framework/functional/framework.go`:
- Around line 152-154: Simplify the VRL warning assertion in the collector log
validation by removing the redundant strings.Contains pre-check and its log.Info
call. Use the existing gomega.Expect assertion directly, adding a custom failure
message only if diagnostic context is needed.
- Around line 136-157: Refactor the adjacent g.Failed() checks into a single
if/else structure: keep the container log dumping and artifact flushing in the
failed branch, and move the collector-log validation into the else branch. Avoid
evaluating g.Failed() twice while preserving both branches’ existing behavior.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8abb3771-9d9a-4ece-a57d-6c2fe47b63cd

📥 Commits

Reviewing files that changed from the base of the PR and between 549022c and 301bd7a.

📒 Files selected for processing (2)
  • test/framework/functional/framework.go
  • test/functional/outputs/syslog/rfc5424_test.go

Comment thread test/framework/functional/framework.go
@vparfonov
vparfonov force-pushed the checkVrlWarn branch 3 times, most recently from b9e9363 to 364b67c Compare July 17, 2026 13:39
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 17, 2026

@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 `@test/framework/functional/framework.go`:
- Around line 150-155: The VRL warning assertion in the collector-log handling
occurs after the g.Failed() check, so its first failure skips artifact
collection. Update the flow around ReadCollectorLogs and the warning Expect to
perform the warning check before failure-artifact handling, or flush artifacts
immediately before asserting, ensuring FlushToArtifactsDir runs when this
assertion fails.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7dd6c76b-7042-4aa1-8d61-cb8cbf127b42

📥 Commits

Reviewing files that changed from the base of the PR and between b9e9363 and 364b67c.

📒 Files selected for processing (3)
  • test/framework/functional/framework.go
  • test/functional/outputs/syslog/rfc3164_test.go
  • test/functional/outputs/syslog/rfc5424_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/functional/outputs/syslog/rfc3164_test.go

Comment on lines +150 to +155
if !g.Failed() {
if collectorLogs, err := f.ReadCollectorLogs(); err != nil {
log.Error(err, "Unable to read collector logs for VRL warning check")
} else if strings.Contains(collectorLogs, "VRL compilation warning") {
log.Info("VRL compilation warning detected in collector logs")
gomega.Expect(collectorLogs).ToNot(gomega.ContainSubstring("VRL compilation warning"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Capture failure artifacts when the warning assertion fails.

g.Failed() is evaluated before gomega.Expect. If a VRL warning is the first failure, the assertion marks the test failed after the artifact-dump branch was skipped, so FlushToArtifactsDir is never called. Run the warning check before failure-artifact handling, or explicitly flush artifacts before asserting.

🤖 Prompt for 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.

In `@test/framework/functional/framework.go` around lines 150 - 155, The VRL
warning assertion in the collector-log handling occurs after the g.Failed()
check, so its first failure skips artifact collection. Update the flow around
ReadCollectorLogs and the warning Expect to perform the warning check before
failure-artifact handling, or flush artifacts immediately before asserting,
ensuring FlushToArtifactsDir runs when this assertion fails.

Signed-off-by: Vitalii Parfonov <vparfono@redhat.com>
@openshift-ci

openshift-ci Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

@vparfonov: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-target 6cd7bda link true /test e2e-target
ci/prow/functional-target 6cd7bda link true /test functional-target
ci/prow/e2e-using-bundle 6cd7bda link false /test e2e-using-bundle
ci/prow/lint 6cd7bda link true /test lint

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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.

1 participant