Skip to content
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

feat: support _meta.pre_function to execute custom logic before execution of each phase #11793

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

Revolyssup
Copy link
Contributor

@Revolyssup Revolyssup commented Nov 29, 2024

Add pre_function to the meta of the plugin to allow some personalized code to run before all plugins run. For example, register personalized variables so that these temporary variables can be referenced and used in the plugin.

Description

Fixes # (issue)
Add pre_function to the meta of the plugin to allow some personalized code to run before all plugins run. For example, register personalized variables so that these temporary variables can be referenced and used in the plugin.

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Nov 29, 2024
@Revolyssup Revolyssup changed the title feat: support _meta.pre_function to execute custom logic before execu… feat: support _meta.pre_function to execute custom logic before execution of each phase Nov 29, 2024
nic-6443
nic-6443 previously approved these changes Dec 3, 2024
@membphis
Copy link
Member

membphis commented Dec 5, 2024

@Revolyssup some CI test cases failed

image

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 24, 2024
|os|print|tonumber|math|pcall|xpcall|unpack
|pairs|ipairs|assert|module|package
|coroutine|[gs]etfenv|next|rawget|rawset
|loadstring|dofile|collectgarbage|load
Copy link
Contributor Author

Choose a reason for hiding this comment

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

load is added here which is not present in original lj-relang causing lint check to fail

@@ -0,0 +1,228 @@
#!/usr/bin/env perl
Copy link
Member

Choose a reason for hiding this comment

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

can we update the tool utils/lj-releng in a separate PR?

one PR for one thing
small PR is easier to review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants