Skip to content

Conversation

@Juliehzl
Copy link
Contributor

@Juliehzl Juliehzl commented Sep 1, 2019


This checklist is used to make sure that common guidelines for a pull request are followed.

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

  • I adhere to the Command Guidelines.

Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest --handle-extended-json-format, -j with help text calling out we will deal with comments, multi-line strings. To me, send unmodified isn't some detail that end users would care. Please correct me if I am wrong.
CC: @alex-frankel

Choose a reason for hiding this comment

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

works for me

Copy link
Contributor Author

@Juliehzl Juliehzl Sep 16, 2019

Choose a reason for hiding this comment

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

Sounds good! I prefer adding --handle-extended-json-format to validate command at the same time. What about your opinion?

Copy link
Collaborator

Choose a reason for hiding this comment

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

agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed

Given validate command is in another custom function, I think we can leave it in next sprint. Because it may be better if we can investigate the behavior in create command after this release and if no problem, I can add it in validate command and I also have enough time to do that.

@yonzhan yonzhan added this to the Sprint 74 milestone Sep 17, 2019
@yonzhan
Copy link
Collaborator

yonzhan commented Sep 17, 2019

@Juliehzl please merge this PR before this sprint build.

@Juliehzl
Copy link
Contributor Author

@yugangw-msft Have some changes after your review. If it is good to merge, you can help me merge it or I will merge it.

@RehanSaeed
Copy link

When will this get released?


minified = jsmin(template)
# Get rid of multi-line strings. Note, we are not sending it on the wire rather just extract parameters to prompt for values
result = re.sub(r'"[^"]*?\n[^"]*?(?<!\\)"', '"#Azure Cli#"', minified, re.DOTALL)
Copy link
Member

Choose a reason for hiding this comment

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

re.DOTALL changes the behavior of .:

https://docs.python.org/3/library/re.html#re.DOTALL

re.DOTALL
Make the '.' special character match any character at all, including a newline; without this flag, '.' will match anything except a newline. Corresponds to the inline flag (?s).

But there is no . in the regex at all.


class JsonCTemplate(object):
def __init__(self, template_as_bytes):
self.template_as_bytes = template_as_bytes
Copy link
Member

@jiasli jiasli Apr 4, 2022

Choose a reason for hiding this comment

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

The name template_as_bytes is misleading.

I debugged test_resource.DeploymentTest.test_group_deployment, and saw its value is actually a str:

image

(I found this when reviewing #21220.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants