Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
|
Hugo preview removed because the pull request was closed. |
sarajkrishnasingh
left a comment
There was a problem hiding this comment.
Nice focused fix for #8636, and the verification in the description is exactly what a reviewer wants to see: 0 remaining ../ imagepath values in content-learn (down from 17), idempotency passing, and the converter report unchanged.
The NESTED_IMAGE_KEY handler fits the existing IMAGE_KEY flow well: it keeps indentation, quote style, and the trailing comma so the flow-style YAML stays valid, and paths it cannot bundle still raise the usual outside-the-bundle warning. The new test covers both the bundled and the unbundlable case, including the single-quote style.
Checks are green here (DCO, both build checks, verify-urls). The one failing test you flagged (normalizes /static/ prefix...) fails the same way on hugo without this change, so it reads as pre-existing and unrelated.
One small suggestion, left inline: the new test creates a temp dir with fs.mkdtempSync and never removes it. Cleaning it up keeps repeated runs tidy.
|
|
||
| test('nested meshesYouLearn imagepath values are bundled, and unbundlable ones warn', () => { |
There was a problem hiding this comment.
Small cleanup: this temp dir is never removed. t.after keeps repeated runs tidy:
| test('nested meshesYouLearn imagepath values are bundled, and unbundlable ones warn', () => { | |
| test('nested meshesYouLearn imagepath values are bundled, and unbundlable ones warn', (t) => { | |
| const tmp = fs.mkdtempSync(path.join(os.tmpdir(), 'l5-imagepath-')); | |
| t.after(() => fs.rmSync(tmp, { recursive: true, force: true })); |
There was a problem hiding this comment.
Done in 345954d: the test takes t and removes its temp dir in t.after. Thanks!
IMAGE_KEY only matches top-level front-matter keys, so the indented imagepath entries inside the learning-path meshesYouLearn list were copied through as ../../../src/... paths that don't exist in the Hugo site. Bundle them like cardImage, keeping indentation, quotes and the trailing comma, and warn when one can't be bundled. Fixes #8636 Signed-off-by: hiyach28 <hiyach28@gmail.com>
92cec2f to
a75fb62
Compare
Signed-off-by: hiyach28 <hiyach28@gmail.com>
|
The failing |
AliRana30
left a comment
There was a problem hiding this comment.
LGTM! Clean NESTED_IMAGE_KEY handling and solid test coverage with proper temp-dir cleanup.
|
This is a good item to add to the weekly Websites meeting agenda (meet.meshery.io/websites-minutes). You can add this item in the doc, attend, and present it. Meeting details can be found at https://meshery.io/calendar. |
Fixes #8636
Problem:
IMAGE_KEYonly matches top-level front-matter keys, so the indentedimagepathentries in the learning-pathmeshesYouLearnlists were copied through as../../../src/...paths. Those paths don't exist in the Hugo site, and no warning was raised.Change: a
NESTED_IMAGE_KEYhandler inconvertFrontMatterthat bundlesimagepaththe same waycardImageis bundled. It keeps the indentation, quote style and trailing comma, so the flow-style YAML stays valid. A path it can't bundle raises the usual "outside the page bundle" warning.Checked:
content-learnnow leaves 0../imagepath values (17 before). Each icon is copied into its course bundle, e.g.imagepath: "meshery-logo-light.svg".check-idempotency.mjspasses for content-learn (0 byte differences).CONVERTER_REPORT.mdproduces no changes.normalizes /static/ prefix…, which fails the same way onhugowithout this change (Windows path separator in the expected report).