-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Nasir.thomas/AI-5146/ddev validate config fields #21744
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
base: master
Are you sure you want to change the base?
Nasir.thomas/AI-5146/ddev validate config fields #21744
Conversation
|
|
||
| from datadog_checks.dev.tooling.configuration.constants import OPENAPI_SCHEMA_PROPERTIES | ||
|
|
||
| ALLOWED_OPTION_FIELDS = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if the ALLOWED_OPTION_FIELDS would be better suited in datadog_checks.dev.tooling.configuration.constants since the file seemed specific to Open API constants. Please let me know if I should move it. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| - name: proxy_port | ||
| value: <PROXY_PORT> | ||
| description: The port of your proxy server. | ||
| value: | ||
| type: integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep snowflake proxy option values as mappings
The proxy_port option now defines value: <PROXY_PORT> at the option level before the nested value: block. Because write_option assigns option['value'] to this string and then expects a mapping (value['type'] and value_type_string(value)), rendering the example or running ddev validate config will fail with a type error (str is not subscriptable) and the proxy settings cannot be documented. The same structure is duplicated for proxy_user and proxy_password below.
Useful? React with 👍 / 👎.
|
Please disregard |
922bbba to
0df6e91
Compare
…6/ddev-validate-config-fields Merge master into nasir.thomas/AI-5146/ddev-validate-config-field
AAraKKe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the log delay @ddog-nasirthomas , I lost a bit of context of what we decided to do about what default and example meant. I remember though that the issue we discussed offline was outside the scope of this PR. I wanted to have the team come to agreement about what we wanted to do about this, in case it meant some changes from this pr. However, we never managed to discuss this.
I am approving it for now and discuss later the implications of what default/example mean.
Thanks for the contribution!
Review from AAraKKe is dismissed. Related teams and files:
- agent-integrations
- datadog_checks_dev/datadog_checks/dev/tooling/configuration/consumers/example.py
This comment has been minimized.
This comment has been minimized.
|
A new config fleet_configurable , was added in this PR. I added that new field to the allowed option level fields so this does not produce errors for other users. |
What does this PR do?
Value and Option level fields were validated following these docs: https://datadoghq.dev/integrations-core/meta/config-specs/#example-file-consumer
Motivation
https://datadoghq.atlassian.net/browse/AI-5146
The issue was that this spec.yaml:
generated this conf.yaml.example:
Instead of using "admin" as default, it used "example".
It seemed like it was skipping 'default' in this method:
The goal of this change was so that we could detect fields that did not exist for the option or value level attributes and notify the user when running ddev validate config.
Also, as shown in the example, the default field was not being respected even though it’s a valid field. This change ensures that default will now be properly respected.
Review checklist (to be filled by reviewers)
qa/skip-qalabel if the PR doesn't need to be tested during QA.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged