8000 Delay data sources initialization, wire ingestion to init by puerco · Pull Request #5091 · mindersec/minder · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Delay data sources initialization, wire ingestion to init #5091

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 2 commits into from
Nov 29, 2024

Conversation

puerco
Copy link
Contributor
@puerco puerco commented Nov 28, 2024

Summary

This PR modifies the data source init logic to delay the rego function registration until the ingestion results are available.

We also wire the ingestion results to the data source initialization in preparation to pass them to the DS Call() method but it stops there to isolate the Call() update into its own PR to discuss (#5093).

Fixes #5088

/cc @JAORMX

Change Type

Mark the type of change your PR introduces:

  • Bug fix (resolves an issue without affecting existing features)
  • Feature (adds new functionality without breaking changes)
  • Breaking change (may impact existing functionalities or require documentation updates)
  • Documentation (updates or additions to documentation)
  • Refactoring or test improvements (no bug fixes or new functionality)

Testing

Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.

Review Checklist:

  • Reviewed my own code for quality and clarity.
  • Added comments to complex or tricky code sections.
  • Updated any affected documentation.
  • Included tests that validate the fix or feature.
  • Checked that related changes are merged.

This commit initializes the data sources functions later in the rego evaluator
lifecycle, creating them after registering the built-in library.

Signed-off-by: Adolfo García Veytia (Puerco) <puerco@stacklok.com>
Thist commit wires the ingestion results to the data source function
initialization to make it available in the DS func call.

Signed-off-by: Adolfo García Veytia (Puerco) <puerco@stacklok.com>
@puerco puerco force-pushed the datasources-init-late branch from 2f69c46 to 4e8424e Compare November 28, 2024 22:34
@coveralls
Copy link

Coverage Status

coverage: 55.158% (+0.03%) from 55.131%
when pulling 4e8424e on puerco:datasources-init-late
into 2853910 on mindersec:main.

@JAORMX JAORMX merged commit 258f3e2 into mindersec:main Nov 29, 2024
27 checks passed
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.

data sources: Expose ingestion results to data source functions
3 participants
0