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

Fix validate config #481

Merged
merged 4 commits into from
Aug 15, 2024
Merged

Fix validate config #481

merged 4 commits into from
Aug 15, 2024

Conversation

surge119
Copy link
Contributor

Summary

The initial implementation would fail for overrides, since the path provided into parse_rule is the override path, instead of the path to the config file, which is expected.

Test Plan

Included

@surge119 surge119 requested review from amyreese and zsol as code owners August 15, 2024 18:01
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 15, 2024
Copy link
Member

@amyreese amyreese left a comment

Choose a reason for hiding this comment

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

I'd prefer to use the root terminology instead of parse_path. Also, is there ever a case where root here wouldn't always be path.parent? Can we avoid the extra argument to validate_config and validate_rules, and just set root = path.parent at the top of the function?

Edit: in merge_configs, we just always pass path.parent straight through to parse_rule, and I think that's the correct behavior.

@surge119
Copy link
Contributor Author

Also, is there ever a case where root here wouldn't always be path.parent? Can we avoid the extra argument to validate_config and validate_rules, and just set root = path.parent at the top of the function?

Only because of testing. Since the tests use a temporary directory, using parent for them would cause them to fail. But I suppose the tests can create new rules to reference

@amyreese amyreese merged commit 4a85c0a into Instagram:main Aug 15, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants