Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Validate scriban from cli #2800

Merged
merged 4 commits into from
Feb 6, 2023
Merged

Conversation

tevoinea
Copy link
Member

@tevoinea tevoinea commented Feb 3, 2023

Summary of the Pull Request

What is this about?

Adds a cli command onefuzz debug notification template. You pass a template string and it will attempt to render it for you via scriban.

Help text:

$ onefuzz debug notification template -h
usage: onefuzz debug notification template [-h] [-v] [--format {json,raw}] [--query QUERY] [--context TemplateRenderContext] template

positional arguments:
  template

options:
  -h, --help            show this help message and exit
  -v, --verbose         increase output verbosity
  --format {json,raw}   output format
  --query QUERY         JMESPath query string. See http://jmespath.org/ for more information and examples.
  --context TemplateRenderContext
                        JSON for TemplateRenderContext. use @file to read from a file

Closes #2501

Info on Pull Request

  • Adds the new template subcommand
  • Adds some new C# types that weren't migrated to pytypes
  • Update TaskConfig type to match C#

What does this include?

Validation Steps Performed

How does someone test & validate?

I ran the command with some valid and invalid scriban template strings to see if they're rendered correctly.

@tevoinea tevoinea requested review from chkeita and Porges February 3, 2023 20:31
@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2023

Codecov Report

Merging #2800 (c9e9fa1) into main (8f418f6) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #2800   +/-   ##
=======================================
  Coverage   29.93%   29.93%           
=======================================
  Files         324      324           
  Lines       38990    38990           
=======================================
  Hits        11671    11671           
  Misses      27319    27319           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@tevoinea tevoinea merged commit c1f6dfc into microsoft:main Feb 6, 2023
@AdamL-Microsoft AdamL-Microsoft mentioned this pull request Feb 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Scriban template verification
3 participants