Skip to content

Feat: Add YAML validation for compose content in deployment flows#46

Open
austin047 wants to merge 2 commits intoflatrun:mainfrom
austin047:fix/yaml-validation
Open

Feat: Add YAML validation for compose content in deployment flows#46
austin047 wants to merge 2 commits intoflatrun:mainfrom
austin047:fix/yaml-validation

Conversation

@austin047
Copy link

  • Add a method to validate compose Yaml
  • Use validation in NewDeploymentModal and DeploymentDetailView before submission

@austin047 austin047 marked this pull request as ready for review February 19, 2026 00:43
@sourceant
Copy link

sourceant bot commented Feb 19, 2026

Code Review Summary

This PR introduces YAML syntax validation for Docker Compose content before it is sent to the backend. It also includes UI improvements for password fields and updates the environment configuration.

🚀 Key Improvements

  • Added yaml package for client-side parsing.
  • Implemented a central validateComposeYaml utility.
  • Added password visibility toggles in the deployment modal.
  • Integrated validation into NewDeploymentModal and DeploymentDetailView.

💡 Minor Suggestions

  • Enable unique key checking in YAML parser.
  • Consider a reusable component for password inputs.

Copy link

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

return { valid: false, error: "Compose content is empty" };
}
try {
parse(trimmed);
Copy link

Choose a reason for hiding this comment

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

By default, the yaml package's parse function might only throw for critical syntax errors. For stricter validation (e.g., catching duplicate keys which are common in Compose files), it is better to check for warnings or use a stricter parsing configuration if available in the version installed.

Suggested change
parse(trimmed);
parse(trimmed, { uniqueKeys: true });

@@ -1 +1 @@
VITE_API_URL=http://localhost:8080
Copy link

Choose a reason for hiding this comment

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

The API URL has been changed from port 8080 to 8090 and appended with /api. Ensure this change is intentional for the example environment and matched in server-side configurations.

Suggested change
VITE_API_URL=http://localhost:8080
VITE_API_URL=http://localhost:8090/api

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

Comments