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

Add router config validate subcommand #6131

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

andrewmcgivery
Copy link
Contributor

Add router config validate subcommand to allow validation of a Router config file without fully starting up the Router.

./router config validate <path-to-config-file.yaml>

Note: Didn't see any examples of how to directly unit test commands.. but I tested manually! 😅


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Tests added and passing3
    • Unit Tests
    • Integration Tests
    • Manual Tests

Exceptions

Note any exceptions here

Notes

Footnotes

  1. It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Oct 8, 2024

❌ Docs Preview Failed

Error

HttpError: Resource not accessible by personal access token - https://docs.github.com/rest/commits/statuses#create-a-commit-status

@andrewmcgivery andrewmcgivery marked this pull request as ready for review October 8, 2024 21:57
@andrewmcgivery andrewmcgivery requested review from a team as code owners October 8, 2024 21:57
Comment on lines +450 to +455
validate_yaml_configuration(
&config_string,
Expansion::default()?,
Mode::NoUpgrade,
)?
.validate()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

We also have other validation specific to plugins (not schema validation but the content of these configurations)

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean that's ok but we should at least document what it clearly does

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, not understanding your comment 😓

Are you saying that this code does more than just validate the Router config file?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm just saying that on plugins we have other config validations. For example here which validate that the config is logically correct, not only syntactically. So what I would like to have is to document that your new config validate will only validate it's syntactically correct regarding the json schema. That's all

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated!

@theJC
Copy link
Contributor

theJC commented Nov 6, 2024

Indeed is anxiously awaiting for this support to be added to improve our pipelines and shift left bad config as much as possible.

Based on the feedback, I believe there is just a documentation concern about indicating the scope of what it can validate and what it cannot. Any chance we can get this over the finish line with just a doc update?

@bnjjj
Copy link
Contributor

bnjjj commented Nov 7, 2024

@andrewmcgivery I added details on my comment. Let me know if you need more. Otherwise once it's documented it looks good to me

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.

4 participants