Skip to content

fix(tests): accept quoted url values in url_present_in_outputs_yaml#241

Merged
JacobPEvans-personal merged 1 commit into
mainfrom
fix/hec-url-test-helper-quotes
May 24, 2026
Merged

fix(tests): accept quoted url values in url_present_in_outputs_yaml#241
JacobPEvans-personal merged 1 commit into
mainfrom
fix/hec-url-test-helper-quotes

Conversation

@JacobPEvans-personal
Copy link
Copy Markdown
Member

Summary

The configmap template for Cribl Stream wraps the HEC URL in double quotes (`k8s/monitoring/cribl-stream-standalone/configmap-cribl-config.yaml:12`), so after `sed` substitution the deployed `outputs.yml` renders as:

```yaml
url: "https://10.0.1.200:8088/services/collector"
```

But the test helper's regex (`tests/helpers.py:151`) required strictly unquoted values:

```python
re.search(rf"^\surl:\s{re.escape(url)}\s*$", yaml_text, re.MULTILINE)
```

Result: false negative on every run. `test_splunk_hec_url_matches_secret` has failed continuously since this template/test pair was introduced, blocking the E2E gate on PRs #234 and #237.

Fix

Allow an optional matching pair of single or double quotes around the URL value:

```python
re.search(rf"""^\surl:\s(['"]?){re.escape(url)}\1\s*$""", yaml_text, re.MULTILINE)
```

The `\1` back-reference forces matching pairs only — `url: "..."` matches, `url: '...'` matches, `url: ...` matches, but `url: "...` (mismatched) does not.

Test plan

  • Helper unit-tested against six representative cases:
    • double-quoted ✓ True (was False — this is the bug)
    • single-quoted ✓ True
    • unquoted ✓ True (preserves prior behavior)
    • mismatched-quote ✓ False
    • unsubstituted placeholder ✓ False
    • different URL ✓ False
  • `pre-commit run --files tests/helpers.py` — passes (ruff lint + format)
  • CI: E2E `test_splunk_hec_url_matches_secret` should now pass

Assisted-by: Claude noreply@anthropic.com

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the url_present_in_outputs_yaml helper function in tests/helpers.py to support matching URLs enclosed in optional single or double quotes. This adjustment prevents false negatives when validating YAML configurations where URLs are quoted, such as those produced by Cribl Stream configmap templates. I have no feedback to provide as there were no review comments.

JacobPEvans-personal added a commit that referenced this pull request May 24, 2026
The ignorePatterns entry pointed at `kubernetes-monitoring` — the
repo's previous name before c21d9ca renamed it to `orbstack-kubernetes`.
The pattern hasn't matched any actual self-references since that rename,
which means every github.com self-ref in CHANGELOG.md (release-please
compare links), docs, and READMEs has been getting hit by markdown-link-check
and randomly failing pre-commit with transient GitHub 502s. PRs #234,
#237, #240, #241 have all hit this flake in the last 24 hours.

Fix: update the pattern to the current repo name. Self-references are
safe to skip because the CHANGELOG compare links and issue links are
machine-generated by release-please and can't have typos; cross-repo
links are still validated.

Assisted-by: Claude <noreply@anthropic.com>
JacobPEvans-personal added a commit that referenced this pull request May 24, 2026
…242)

The ignorePatterns entry pointed at `kubernetes-monitoring` — the
repo's previous name before c21d9ca renamed it to `orbstack-kubernetes`.
The pattern hasn't matched any actual self-references since that rename,
which means every github.com self-ref in CHANGELOG.md (release-please
compare links), docs, and READMEs has been getting hit by markdown-link-check
and randomly failing pre-commit with transient GitHub 502s. PRs #234,
#237, #240, #241 have all hit this flake in the last 24 hours.

Fix: update the pattern to the current repo name. Self-references are
safe to skip because the CHANGELOG compare links and issue links are
machine-generated by release-please and can't have typos; cross-repo
links are still validated.

Assisted-by: Claude <noreply@anthropic.com>
@JacobPEvans-personal JacobPEvans-personal force-pushed the fix/hec-url-test-helper-quotes branch from 87f83ea to 329b918 Compare May 24, 2026 22:43
The configmap template for Cribl Stream wraps the HEC URL in double
quotes (k8s/monitoring/cribl-stream-standalone/configmap-cribl-config.yaml
line 12), so after sed substitution the deployed outputs.yml renders as:

    url: "https://10.0.1.200:8088/services/collector"

The helper's regex required strictly unquoted values, giving a false
negative on every run and failing test_splunk_hec_url_matches_secret.
This has blocked PR #234 and #237 on E2E for two days.

Fix: allow an optional matching pair of single or double quotes around
the URL value. Tested against six representative cases (double-quoted,
single-quoted, unquoted, mismatched-quote, unsubstituted placeholder,
different URL) — all behave correctly.

Assisted-by: Claude <noreply@anthropic.com>
@JacobPEvans-personal JacobPEvans-personal force-pushed the fix/hec-url-test-helper-quotes branch from 329b918 to 075dddc Compare May 24, 2026 22:50
@JacobPEvans-personal JacobPEvans-personal merged commit cf933b2 into main May 24, 2026
17 checks passed
@JacobPEvans-personal JacobPEvans-personal deleted the fix/hec-url-test-helper-quotes branch May 24, 2026 23:10
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