new(plugin): actually allow listing tables, improve fields/tables ergonomics - #83
Conversation
The code was there but there was no way to obtain a TableFields object so it was effectively uncallable. Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
There was a problem hiding this comment.
Pull request overview
This PR improves the Falco plugin SDK’s tables ergonomics by making table/field listing usable and returning safer Rust wrappers instead of raw FFI structs.
Changes:
- Move/replace
TablesInput::list_tables()to return&[TableInfo](repr-transparent wrapper) instead of rawss_plugin_table_info. - Update imported table field listing to return
&[FieldInfo]and simplify theTable::list_fieldscall signature to take&TablesInput. - Add integration tests covering
list_tables()andlist_fields()behavior.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| falco_plugin/src/tables/vtable/mod.rs | Removes the old raw list_tables() impl from the vtable module. |
| falco_plugin/src/tables/mod.rs | Re-exports FieldTypeId publicly to support new wrapper APIs/tests. |
| falco_plugin/src/tables/import/table/raw.rs | Changes field listing to return FieldInfo slice and adds safety comment. |
| falco_plugin/src/tables/import/table/mod.rs | Updates Table::list_fields signature/return type to use TablesInput and FieldInfo. |
| falco_plugin/src/tables/import/table_input.rs | Adds TablesInput::list_tables() returning &[TableInfo]. |
| falco_plugin/src/tables/import/table_info.rs | Introduces TableInfo wrapper with name()/key_type() accessors. |
| falco_plugin/src/tables/import/mod.rs | Wires in and re-exports FieldInfo/TableInfo. |
| falco_plugin/src/tables/import/field_info.rs | Introduces FieldInfo wrapper with name()/read_only()/field_type() accessors. |
| falco_plugin_tests/tests/list_tables.rs | Adds an integration test validating table listing and key type. |
| falco_plugin_tests/tests/list_fields.rs | Adds an integration test validating field listing and field metadata. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
Signed-off-by: Grzegorz Nosek <grzegorz.nosek@sysdig.com>
|
LGTM label has been added. DetailsGit tree hash: 1ffc4541e7a3e8eec1d6f403c3d1d0cc40430469 |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ekoops, gnosek The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area plugin
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
list_tables()was impossible to call before 🤦Does this PR introduce a user-facing change?: