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

Config file error message for duplicate keys fixed and improved #1547

Merged

Conversation

amart241
Copy link
Collaborator

@amart241 amart241 commented Feb 3, 2025

🗣 Description

💭 Motivation and context

This will fix add an error message when 2 or more keys are added to a yaml config file. This will resolve #1218.

Closes #1218

🧪 Testing

I have ran this update with several config files to make sure it works as well as a unit test.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • PR targets the correct parent branch (e.g., main or release-name) for merge.
  • Changes are limited to a single goal - eschew scope creep!
  • Changes are sized such that they do not touch excessive number of files.
  • These code changes follow the ScubaGear content style guide.
  • Related issues these changes resolve are linked preferably via closing keywords.
  • All relevant type-of-change labels added.
  • All relevant project fields are set.
  • All relevant repo and/or project documentation updated to reflect these changes.
  • Unit tests added/updated to cover PowerShell and Rego changes.
  • All relevant functional tests passed.
  • All automated checks (e.g., linting, static analysis, unit/smoke tests) passed.

✅ Pre-merge checklist

  • PR passed smoke test check.

  • Feature branch has been rebased against changes from parent branch, as needed

    Use Rebase branch button below or use this reference to rebase from the command line.

  • Resolved all merge conflicts on branch

  • Notified merge coordinator that PR is ready for merge via comment mention

  • Demonstrate changes to the team for questions and comments.
    (Note: Only required for issues of size Medium or larger)

✅ Post-merge checklist

  • Feature branch deleted after merge to clean up repository.
  • Verified that all checks pass on parent branch (e.g., main or release-name) after merge.

@amart241 amart241 added this to the Lionfish milestone Feb 3, 2025
@amart241 amart241 self-assigned this Feb 3, 2025
@amart241 amart241 added the enhancement This issue or pull request will add new or improve existing functionality label Feb 3, 2025
@amart241 amart241 requested review from adhilto and schrolla February 3, 2025 16:44
@schrolla
Copy link
Collaborator

schrolla commented Feb 3, 2025

@amart241 Can you rework the PR title to better indicate what it actually fixes? Maybe something like "Improve config file invalid syntax error feedback"?

@schrolla
Copy link
Collaborator

schrolla commented Feb 3, 2025

@amart241 Also, please set the project fields for the PR per the pre-approval checklist.

@amart241 amart241 changed the title Loading of config file needs better error handling 1218 Config file error message for duplicate keys fixed and improved Feb 3, 2025
Copy link
Collaborator Author

@amart241 amart241 left a comment

Choose a reason for hiding this comment

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

Changed files according to feedback.

@amart241 amart241 requested a review from adhilto February 4, 2025 15:28
amart241 and others added 3 commits February 6, 2025 09:17
Swore I made this change already, committing again

Co-authored-by: Alden Hilton <[email protected]>
I like this suggestion and that is why I used write-warning to begin with it wasn't printing out.

Co-authored-by: Alden Hilton <[email protected]>
Changes based on @schrolla and @adhilto suggestions
Copy link
Collaborator Author

@amart241 amart241 left a comment

Choose a reason for hiding this comment

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

Done with new comments

Copy link
Collaborator

@schrolla schrolla left a comment

Choose a reason for hiding this comment

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

Latest updates address previous comments. Final test has the error coming thru looking clean and readable by the user. Well done.

@schrolla
Copy link
Collaborator

schrolla commented Feb 7, 2025

@nanda-katikaneni This PR is ready for merge.

@nanda-katikaneni nanda-katikaneni merged commit e5d8fb6 into main Feb 7, 2025
28 checks passed
@nanda-katikaneni nanda-katikaneni deleted the Loading-of-config-file-needs-better-error-handling-1218 branch February 7, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This issue or pull request will add new or improve existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loading of config file needs better error handling
4 participants