Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: serverSide validation error markers #190

Merged
merged 4 commits into from
Nov 14, 2023

Conversation

roshan-gh
Copy link
Contributor

No description provided.

@roshan-gh roshan-gh self-assigned this Nov 9, 2023
Copy link

vercel bot commented Nov 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
otelbin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 14, 2023 9:16am

@@ -99,6 +102,28 @@ export function validateOtelCollectorConfigurationAndSetMarkers(
}
if (!totalErrors.jsYamlError) {
customValidate(mainItemsData, serviceItemsData, errorMarkers, totalErrors, configData);
const serverSideErrorElement = findErrorElement(serverSideValidationPath, parsedYamlConfig);
Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: Add tests for this :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the functions that used for serverSide markers are already have tests. (used the same functions as for ajv error markers) @bripkens

Copy link
Member

Choose a reason for hiding this comment

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

So if that is the case, does that mean that this new code can be deleted and there will be a red test? :)

@roshan-gh
Copy link
Contributor Author

@bripkens removed server-side word

@mmanciop
Copy link
Member

mmanciop commented Nov 10, 2023

We need to deduplicate errors on the same path: if two errors are found on the same path, the server-side error takes precedence, see attached screenshot (repro).

Screenshot 2023-11-10 at 11 42 58

Copy link
Member

@mmanciop mmanciop left a comment

Choose a reason for hiding this comment

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

We need error deduplication, see comment.

Copy link
Member

@bripkens bripkens left a comment

Choose a reason for hiding this comment

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

Let's get this merged and then iterate on the presentation and de-duplication.

@bripkens bripkens force-pushed the server-side-validation-marker branch from db19955 to 2bc1570 Compare November 14, 2023 09:14
Copy link

sonarcloud bot commented Nov 14, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bripkens bripkens merged commit 5a9dc78 into main Nov 14, 2023
9 checks passed
@bripkens bripkens deleted the server-side-validation-marker branch November 14, 2023 09:19
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants