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

Guardian policy embedded code testing/debugging facility for Custom Logic, Calculate, etc blocks #4304

Open
anvabr opened this issue Oct 24, 2024 · 0 comments
Labels

Comments

@anvabr
Copy link
Collaborator

anvabr commented Oct 24, 2024

Problem description

Currently when defining a chunk of a source code in, for example, the calculate block policy authors often find it difficult to detect logical or even syntax errors as there is no facility to debug, test run, view or at least print-out the values of the variables in the block. The only method of debugging provided by Guardian currently is to run the policy end-to-end, and try to identify issues from the logs/error codes. This is too time consuming and labor intensive.

Requirements

  • Introduce the 'Test' button to all places where source or math code can be inputted in Guardian policy which would trigger the 'in place' execution of the code based on the execution context and defined inputs/outputs of the block. This tool could prompt the user for input data when required.
  • Add ability to 'print' (i.e. log) data and variable values somewhere when test-running policy (e.g. in Dry-run mode). This way policy authors would be able to examine the data structures passed into the functions and identify unexpected behaviour in this area.
  • Add recommendations to the documentation wrt running this code in an separate developer environment, i.e. all the needed execution context such as imported libraries etc so those developers who prefer to use their code editors can replicate the execution of the code there.

Definition of done

  • Functionality introduced as described above
  • Documentation updated

Acceptance criteria

  • Policy authors are able to run tests on the Guardian policy code embeddings without the need to execute the entire policy end-to-end.
@anvabr anvabr changed the title Guardian policy embedded code inserts testing/debugging facility for Custom Logic, Calculate, etc blocks Guardian policy embedded code testing/debugging facility for Custom Logic, Calculate, etc blocks Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants