Skip to content

Handle incompatible yq implementations - #5253

Open
ZiyamSanthosh wants to merge 1 commit into
thunder-id:mainfrom
ZiyamSanthosh:fix-5216-yq-compatibility
Open

Handle incompatible yq implementations#5253
ZiyamSanthosh wants to merge 1 commit into
thunder-id:mainfrom
ZiyamSanthosh:fix-5216-yq-compatibility

Conversation

@ZiyamSanthosh

@ZiyamSanthosh ZiyamSanthosh commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Purpose

Prevent setup.sh and build.sh from terminating when an incompatible yq implementation is present in PATH.

Fixes #5216

Approach

  • Verify that the detected yq supports the required eval syntax before using it.
  • Use the existing grep/awk configuration fallback when the compatibility probe fails.
  • Apply the same check to both setup and source-build configuration parsing.

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. Not required for this change.
    • Ran Vale and fixed all errors and warnings
  • Tests provided. No new automated test framework was introduced for this shell capability check.
    • Unit Tests
    • Integration Tests
  • Breaking changes. None.
    • Breaking changes section filled.
    • breaking change label added.

Validation

  • bash -n setup.sh build.sh
  • git diff --check
  • Verified the compatibility probe against Python/jq yq 3.1.0, which is rejected and therefore selects the existing fallback.

Security checks

  • Followed secure coding standards.
  • Confirmed that this PR does not commit keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • Bug Fixes
    • Improved configuration parsing when the installed yq tool is unavailable or not functioning correctly.
    • Automatically falls back to an alternate parsing method instead of producing empty configuration values.

Fixes thunder-id#5216

Signed-off-by: ZiyamSanthosh <santhoshziyam@gmail.com>
@ZiyamSanthosh
ZiyamSanthosh force-pushed the fix-5216-yq-compatibility branch from 9c660da to 94284e1 Compare September 2, 2026 06:35
@ZiyamSanthosh ZiyamSanthosh added the trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes label Sep 2, 2026
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 6f70369b-b5d2-473c-96dd-a3486860d77d

📥 Commits

Reviewing files that changed from the base of the PR and between 4be6fa7 and 94284e1.

📒 Files selected for processing (2)
  • build.sh
  • setup.sh

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The read_config functions in build.sh and setup.sh now verify that yq eval executes successfully before using the yq parsing path. Non-functional yq installations use the existing grep/awk fallback.

Changes

yq validation fallback

Layer / File(s) Summary
Validate yq before configuration parsing
build.sh, setup.sh
Both read_config functions require a successful yq eval '.' /dev/null probe before using yq. Non-functional installations fall back to grep/awk parsing.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 94284

The scripts now reject incompatible yq implementations and use the existing fallback parser, preserving configuration parsing without introducing an actionable merge-blocking risk.

Suggested reviewers: brionmario, thamindudilshan, senthalan

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: handling incompatible yq implementations.
Description check ✅ Passed The description covers the purpose, implementation approach, related issue, validation, checklist status, and security checks. It explains why documentation and automated tests were not added.
Linked Issues check ✅ Passed The changes satisfy issue #5216 by validating yq compatibility before use and selecting the existing grep/awk fallback when the probe fails. The fix applies to setup.sh and build.sh, including the aff…
Out of Scope Changes check ✅ Passed The changes are limited to yq compatibility detection in setup.sh and build.sh. Both files support the stated objectives, and no unrelated changes are identified.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files.
Full details: Linked Issues check

Explanation

The changes satisfy issue #5216 by validating yq compatibility before use and selecting the existing grep/awk fallback when the probe fails. The fix applies to setup.sh and build.sh, including the affected setup flow.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@ZiyamSanthosh ZiyamSanthosh added trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes and removed trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes labels Sep 2, 2026
@ZiyamSanthosh ZiyamSanthosh added trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes and removed trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes labels Sep 4, 2026
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes Type/Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setup.sh fails with Debian yq and does not generate certificates

1 participant