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

Support Multiple Schema Validations #1066

Conversation

samtholiya
Copy link
Collaborator

@samtholiya samtholiya commented Feb 14, 2025

Why Draft

  • I want to refactor the code to be more beautiful
  • add some trace and debug logs.
  • Adding test cases
  • The atmos schema i downloaded from our prod website is not updated. We need to udpate that as well
  • add a way to validate only partial yaml schema's based on keys provided by users
  • Find a better UX than the bellow.
    image

what

  • Added a new validator command to the CLI.
  • This command verifies the YAML structure of the atmos CLI.
  • f a schema key is present in the YAML, it validates the structure against the schema.

why

  • Ensures that configuration files follow the correct YAML structure.
  • Prevents misconfigurations and errors caused by invalid or malformed YAML.
  • Adds an extra layer of validation by enforcing schema compliance when applicable.
  • Improves reliability and usability of the CLI by catching issues early.

references

@mergify mergify bot added the triage Needs triage label Feb 14, 2025
var ErrAtmosSchemaNotFound = errors.New("atmos schema not found")

var atmosData = map[string][]byte{
"atmos://schema": []byte(atmosSchema),
Copy link
Member

Choose a reason for hiding this comment

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

Please see the ticket this is not right

@osterman osterman changed the title add validate schema Support Multiple Schema Validations Feb 15, 2025
coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 18, 2025
@mergify mergify bot removed the triage Needs triage label Feb 18, 2025
@mergify mergify bot added the triage Needs triage label Feb 19, 2025
@samtholiya samtholiya force-pushed the feature/dev-3030-implement-schema-validation-for-vendoring-and-atmos branch from 250b633 to 07f768c Compare February 25, 2025 19:52
Copy link

mergify bot commented Feb 26, 2025

💥 This pull request now has conflicts. Could you fix it @samtholiya? 🙏

@mergify mergify bot added the conflict This PR has conflicts label Feb 26, 2025
@mergify mergify bot removed the conflict This PR has conflicts label Feb 26, 2025
@samtholiya samtholiya force-pushed the feature/dev-3030-implement-schema-validation-for-vendoring-and-atmos branch 2 times, most recently from 4d3f699 to 248ad73 Compare February 27, 2025 09:05
@samtholiya samtholiya force-pushed the feature/dev-3030-implement-schema-validation-for-vendoring-and-atmos branch from 248ad73 to 8e2067a Compare February 27, 2025 09:08
Copy link

mergify bot commented Feb 28, 2025

Warning

This PR exceeds the recommended limit of 1,000 lines.

Large PRs are difficult to review and may be rejected due to their size.

Please verify that this PR does not address multiple issues.
Consider refactoring it into smaller, more focused PRs to facilitate a smoother review process.

@samtholiya samtholiya changed the base branch from main to feature/dev-3056-refactor-gogetter-utility-for-better-testability-and March 4, 2025 20:23
Copy link

mergify bot commented Mar 4, 2025

💥 This pull request now has conflicts. Could you fix it @samtholiya? 🙏

Copy link

mergify bot commented Mar 4, 2025

Important

Cloud Posse Engineering Team Review Required

This pull request modifies files that require Cloud Posse's review. Please be patient, and a core maintainer will review your changes.

To expedite this process, reach out to us on Slack in the #pr-reviews channel.

@mergify mergify bot added conflict This PR has conflicts needs-cloudposse Needs Cloud Posse assistance labels Mar 4, 2025
…estability-and' into feature/dev-3030-implement-schema-validation-for-vendoring-and-atmos
@mergify mergify bot removed the conflict This PR has conflicts label Mar 4, 2025
Copy link

codecov bot commented Mar 4, 2025

Codecov Report

Attention: Patch coverage is 41.11675% with 116 lines in your changes missing coverage. Please review.

Project coverage is 19.95%. Comparing base (dd3ed57) to head (bbda1d9).

Files with missing lines Patch % Lines
pkg/datafetcher/mock_fetch_schema.go 0.00% 30 Missing ⚠️
pkg/validator/schema_validator.go 55.35% 19 Missing and 6 partials ⚠️
cmd/validate_schema.go 16.00% 21 Missing ⚠️
pkg/validator/mock_schema_validator.go 0.00% 15 Missing ⚠️
internal/exec/validate_schema.go 60.86% 8 Missing and 1 partial ⚠️
pkg/downloader/mock_file_downloader_interface.go 0.00% 9 Missing ⚠️
pkg/datafetcher/fetch_schema.go 80.95% 3 Missing and 1 partial ⚠️
pkg/downloader/file_downloader.go 57.14% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@                                            Coverage Diff                                            @@
##           feature/dev-3056-refactor-gogetter-utility-for-better-testability-and    #1066      +/-   ##
=========================================================================================================
+ Coverage                                                                  19.72%   19.95%   +0.22%     
=========================================================================================================
  Files                                                                        174      182       +8     
  Lines                                                                      18885    19082     +197     
=========================================================================================================
+ Hits                                                                        3726     3807      +81     
- Misses                                                                     14443    14550     +107     
- Partials                                                                     716      725       +9     
Flag Coverage Δ
unittests 19.95% <41.11%> (+0.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

mergify bot commented Mar 4, 2025

💥 This pull request now has conflicts. Could you fix it @samtholiya? 🙏

@mergify mergify bot added the conflict This PR has conflicts label Mar 4, 2025
@cloudposse cloudposse deleted a comment from github-actions bot Mar 4, 2025
@cloudposse cloudposse deleted a comment from github-actions bot Mar 4, 2025
@cloudposse cloudposse deleted a comment from github-actions bot Mar 4, 2025
@cloudposse cloudposse deleted a comment from github-actions bot Mar 4, 2025
@mergify mergify bot removed the triage Needs triage label Mar 4, 2025
…estability-and' into feature/dev-3030-implement-schema-validation-for-vendoring-and-atmos
@mergify mergify bot removed the conflict This PR has conflicts label Mar 4, 2025
@samtholiya
Copy link
Collaborator Author

New pr with rebased things: #1147

@samtholiya samtholiya closed this Mar 14, 2025
@mergify mergify bot removed the needs-cloudposse Needs Cloud Posse assistance label Mar 14, 2025
@samtholiya samtholiya deleted the feature/dev-3030-implement-schema-validation-for-vendoring-and-atmos branch March 14, 2025 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants