Skip to content

Load plugin schemas after built-in schemas #1608

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

Merged
merged 5 commits into from
Apr 30, 2021

Conversation

dominiklohmann
Copy link
Member

📔 Description

This change allows for plugins to override bundled schemas as part of their installation. The plugin schemas reside in <datadir>/vast/plugin/<plugin>/schema, while the builtin schemas reside in <datadir>/vast/schema. The load order guarantees that plugins are able to reliably override the schemas bundled with VAST.

📝 Checklist

  • All user-facing changes have changelog entries.
  • The changes are reflected on docs.tenzir.com/vast, if necessary.
  • The PR description contains instructions for the reviewer, if necessary.

🎯 Review Instructions

Commit-by-commit.

@dominiklohmann dominiklohmann added the feature New functionality label Apr 29, 2021
@dominiklohmann dominiklohmann requested a review from a team April 29, 2021 14:08
This change allows for plugins to override bundled schemas as part of
their installation. The plugin schemas reside in
`<datadir>/vast/plugin/<plugin>/schema`, while the builtin schemas
reside in `<datadir>/vast/schema`. The load order guarantees that
plugins are able to reliably override the schemas bundled with VAST.
@dominiklohmann dominiklohmann force-pushed the story/ch23333/plugin-schemas branch from b800f00 to 570a449 Compare April 29, 2021 14:24
The "bare mode" (`vast.disable-default-config-dirs`) must also disable
the developer-oriented plugin autoloading feature, otherwise the
integration tests load plugins they're not supposed to load.
@dominiklohmann dominiklohmann force-pushed the story/ch23333/plugin-schemas branch from 570a449 to 19be2da Compare April 29, 2021 15:19
Copy link
Member

@lava lava left a comment

Choose a reason for hiding this comment

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

Code looks good apart from some minor comments.

I didn't personally test this, but I trust you already did while working on the matcher.

#if !VAST_ENABLE_RELOCATABLE_INSTALLATIONS
result.insert(VAST_SCHEMADIR);
insert_dirs_for_datadir(VAST_DATADIR);
#endif
Copy link
Member

Choose a reason for hiding this comment

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

Not the scope of this PR, but shouldn't the loop below be in an #else block?

Copy link
Member Author

Choose a reason for hiding this comment

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

That'd break integration tests from within the build directory.

@dominiklohmann dominiklohmann merged commit 6031fb6 into master Apr 30, 2021
@dominiklohmann dominiklohmann deleted the story/ch23333/plugin-schemas branch April 30, 2021 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants