Skip to content

ast: add DefaultModuleLoader#7794

Merged
srenatus merged 1 commit intoopen-policy-agent:mainfrom
srenatus:sr/tkwvvxknqool
Jul 23, 2025
Merged

ast: add DefaultModuleLoader#7794
srenatus merged 1 commit intoopen-policy-agent:mainfrom
srenatus:sr/tkwvvxknqool

Conversation

@srenatus
Copy link
Copy Markdown
Contributor

This provides the means to inject modules for all invocations of the ast package in an executable. It's handy if you want to include your own set of base modules, with helper functions.

Since the module loader can be provided via other means, we need to check both possibilities:

  1. If there hasn't been a module loader set up before, just use the default module loader.

  2. If there had been one set up before, run that first, then run the default one, and merge the results. This can be iterated, of course, if need be -- and should reach a fix point given that the individual loaders do.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 23, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit ba5eb8a
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/6881401958037b000965d4fd
😎 Deploy Preview https://deploy-preview-7794--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 23, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit bf1044e
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/6881409441bad50008206f58
😎 Deploy Preview https://deploy-preview-7794--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 23, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit ebd1998
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/6881471f96afd90008c2f076
😎 Deploy Preview https://deploy-preview-7794--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Member

@philipaconrad philipaconrad left a comment

Choose a reason for hiding this comment

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

This looks great so far! I'd love to add some tests for this, if possible. 😅

@srenatus
Copy link
Copy Markdown
Contributor Author

Test added ✔️

This provides the means to inject modules _for all invocations of the
ast package in an executable_. It's handy if you want to include your
own set of base modules, with helper functions.

Since the module loader can be provided via other means, we need to
check both possibilities:

1. If there hasn't been a module loader set up before, just use
   the default module loader.

2. If there had been one set up before, run that first, then run
   the default one, and merge the results. This can be iterated,
   of course, if need be -- and should reach a fix point given
   that the individual loaders do.

Signed-off-by: Stephan Renatus <stephan@styra.com>
@srenatus srenatus enabled auto-merge (rebase) July 23, 2025 20:36
@srenatus srenatus disabled auto-merge July 23, 2025 20:47
@srenatus srenatus merged commit a2c769f into open-policy-agent:main Jul 23, 2025
31 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.

2 participants