Skip to content

Inventory postprocessing filters#222

Merged
simu merged 8 commits into
masterfrom
inventory-postprocessing-filters
Oct 29, 2020
Merged

Inventory postprocessing filters#222
simu merged 8 commits into
masterfrom
inventory-postprocessing-filters

Conversation

@simu

@simu simu commented Oct 19, 2020

Copy link
Copy Markdown
Member

Resolves #156

Checklist

  • Keep pull requests small so they can be easily reviewed.
  • Update the documentation.
  • Update tests.
  • Update the ./CHANGELOG.md.
  • Link this PR to related issues.

@simu simu self-assigned this Oct 19, 2020
@simu simu force-pushed the inventory-postprocessing-filters branch 2 times, most recently from 08e0a69 to e4397a9 Compare October 19, 2020 15:51
@simu

simu commented Oct 19, 2020

Copy link
Copy Markdown
Member Author

Still TODO:

  • more robust filter validation
  • Correctly use component search path for inventory-based filters

@simu simu force-pushed the inventory-postprocessing-filters branch 5 times, most recently from 0d33c53 to 4989b8a Compare October 27, 2020 08:41
@simu simu marked this pull request as ready for review October 27, 2020 08:41
@simu simu requested review from chrisglass and srueg October 27, 2020 08:41

@chrisglass chrisglass left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

@simu simu force-pushed the inventory-postprocessing-filters branch 4 times, most recently from f7124a1 to 1ccf2bb Compare October 28, 2020 10:56
simu added 8 commits October 29, 2020 13:30
Refactor postprocessing filter code in preparation for moving filter
definitions into the inventory. Defining filters in the inventory will
allow us to rely on Kapitan (and reclass) to resolve inventory
references in the filter definitions.

This commit changes some of the postprocessing filter execution
internals to prepare the code base for an implementation which allows
both styles of filter definitions (in the inventory and in
postprocess/filters.yml) in a transitional period until all existing
components have been updated.

This commit does not yet introduce functionality to extract filters from
the inventory, but refactors the internal filter dict contents to reduce
the amount of required fields for filter definitions, especially for
builtin filters.
Postprocessing filters can also be defined under
`parameters.commodore.postprocess.filters` in component classes using
mostly the same format as `postprocess/filters.py`.

Notable changes to the filter definition format: Jsonnet filters need to
provide the full path to the directory holding the filter definition
(including the component directory) as `filterpath`. Filters which
require the component name need to set it as `component` in the filter
definition. Filters without `type` are not accepted if defined in the
inventory.
Retroactively name postprocessing filters defined in
`postprocess/filters.yml` "external" postprocessing filters.
@simu simu force-pushed the inventory-postprocessing-filters branch from 1ccf2bb to 88397eb Compare October 29, 2020 12:30
@simu simu merged commit 7270e11 into master Oct 29, 2020
@simu simu deleted the inventory-postprocessing-filters branch October 29, 2020 12:39
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.

Refactor postprocessing to define filters in inventory

3 participants