Skip to content

fix: Combining lua folder and string should have line breaks#732

Merged
michaeljguarino merged 1 commit intomainfrom
lua-folder-string-merge
Apr 15, 2026
Merged

fix: Combining lua folder and string should have line breaks#732
michaeljguarino merged 1 commit intomainfrom
lua-folder-string-merge

Conversation

@michaeljguarino
Copy link
Copy Markdown
Member

@michaeljguarino michaeljguarino commented Apr 14, 2026

Causes syntax errors if last file doesn't end in newline

Test Plan

Test environment: https://console.plrldemo.onplural.sh/cd/clusters/31c95d8f-983c-435a-8985-bd1327f4334a/services/5486a614-6793-474d-92d6-4a338d10eace/components

Checklist

  • I have added a meaningful title and summary to convey the impact of this PR to a user.
  • I have deployed the agent to a test environment and verified that it works as expected.
    • Agent starts successfully.
    • Service creation works without any issues when using raw manifests and Helm templates.
    • Service creation works when resources contain both CRD and CRD instances.
    • Service templating works correctly.
    • Service errors are reported properly and visible in the UI.
    • Service updates are reflected properly in the cluster.
    • Service resync triggers immediately and works as expected.
    • Sync waves annotations are respected.
    • Sync phases annotations are respected. Phases are executed in the correct order.
    • Sync hook delete policies are respected. Resources are not recreated once they reach the desired state.
    • Service deletion works and cleanups resources properly.
    • Services can be recreated after deletion.
    • Service detachment works and keeps resources unaffected.
    • Services can be recreated after detachment.
    • Service component trees are working as expected.
    • Cluster health statuses are being updated.
    • Agent logs do not contain any errors (after running for at least 30 minutes).
    • There are no visible anomalies in Datadog (after running for at least 30 minutes).
  • I have added tests to cover my changes.
  • If required, I have updated the Plural documentation accordingly.

Causes syntax errors if last file doesn't end in newline
@michaeljguarino michaeljguarino added the enhancement New feature or request label Apr 14, 2026
@michaeljguarino michaeljguarino requested a review from a team as a code owner April 14, 2026 21:50
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 14, 2026

Greptile Summary

This PR fixes a Lua syntax error that could occur when combining files from a Lua folder with an additional Lua script/file. The luaFolder helper already joins individual files with `"

", but the subsequent concatenation with luaStringhad no separator, meaning a missing trailing newline in the last folder file would run statements together illegally. The fix inserts"

"` at that join point, matching the existing inter-file separator pattern.

Confidence Score: 5/5

Safe to merge — single-line fix that correctly resolves the Lua concatenation issue.

The change is a minimal, well-scoped fix that mirrors the existing "

" separator already used inside luaFolder itself. No logic is altered beyond the join point, and trailing "

" when luaString is empty is harmless to the Lua runtime. No P0/P1 findings.

No files require special attention.

Important Files Changed

Filename Overview
pkg/manifests/template/helm.go Adds "\n\n" separator between luaFolder content and luaString to prevent Lua syntax errors when the last folder file lacks a trailing newline.

Reviews (1): Last reviewed commit: "fix: Combining lua folder and string sho..." | Re-trigger Greptile

@michaeljguarino michaeljguarino merged commit 6ed2ae4 into main Apr 15, 2026
187 of 249 checks passed
@michaeljguarino michaeljguarino deleted the lua-folder-string-merge branch April 15, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants