Skip to content

Conversation

@mmyyrroonn
Copy link
Contributor

@mmyyrroonn mmyyrroonn commented Nov 28, 2019

Fix #10854 #10869


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
Member

Choose a reason for hiding this comment

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

--rewrite-rule-set

Copy link
Member

Choose a reason for hiding this comment

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

rewrite_rule_set

Copy link
Member

Choose a reason for hiding this comment

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

Do we need add completer=get_ag_subresource_completion_list() for "rewrite_rule_set"?

@yonzhan yonzhan added this to the S162 milestone Dec 1, 2019
Copy link
Member

Choose a reason for hiding this comment

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

what's practice to set min_api version? I thought it's for azure stack. is it possible to specify version at global level, instead of in business logic code? it's hard for maintenance.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Based on my current knowledge, the current practice is to set min_api version like these across services like network/storage. We can discuss a solution to set the version at global level.

Copy link
Member

Choose a reason for hiding this comment

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

again, it looks really bad for adding hardcode versions in different piece of codes but same purpose. at least define something like global var rewrite_rule_set_min_version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A possible reason behind hardcode might be if we need to define a global var, the name might be ag_url_path_map_rewrite_rule_set_min_version. This api-version is limited in these two commands az network application-gateway url-path-map create/update

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yungezz Currently, we set min_api=2019-04-01 in _param.py too. I just checked the structure in cmd and we can also get this information. How about we support something like cmd.support_parameter(rewrite_rule_set) so that we can remove this hardcode version and keep the version information limited in _param.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can also work for multi api if I write the check like if rewrite_rule_set is None

Copy link
Member

Choose a reason for hiding this comment

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

thanks @myronfanqiu . sounds good to add in cmd. Image one day, you'll need update versoin for a feature like rewrite_rule_set, how it's possible to find out all instance of hardcode version. meanwhile, bad readability.
Eventually, I would like we have this practice tested/verified, and make it into cli command guideline.

@mmyyrroonn mmyyrroonn requested a review from jiasli as a code owner December 6, 2019 07:13
@mmyyrroonn mmyyrroonn requested review from jsntcy and yungezz December 9, 2019 01:43
@mmyyrroonn
Copy link
Contributor Author

@yungezz Hello. I included two kinds of solution in this PR. After re-thinking the structure, I think _param.py is a quite good place to store the min_api version for each parameter. We can discuss the solution again.

Copy link
Member

Choose a reason for hiding this comment

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

just a wild thinking, do you think it make sense that cli might be asked to have multiple min_api_version, such as one for azure stack, one for JEDI, one for moon_cake?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, min_api is based on the first time this param appears in python SDK/swagger spec. Unless we need to choose different package version(not api-version) of sdk for different cloud, I cannot image we need to support multiple min_api_version.

Copy link
Member

Choose a reason for hiding this comment

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

Since min API version is constant (will not change in the future), I prefer hard-code it to eliminate the over-complexity.

Copy link
Member

Choose a reason for hiding this comment

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

it's not about one api version, pls look at the whole file, or cli codes in general, lots of api version, even in one rp, one resource, min_api_version is on property level. This introduces bad readability and heavy maintenance effort. purpose of the comments is general improving code readability, maintenance. while for how to generalize the way, we can discuss. that's the context why @myronfanqiu provided 2 options open for discussion. If more concern, let's discuss offline.

Copy link
Member

Choose a reason for hiding this comment

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

zan!

@mmyyrroonn mmyyrroonn force-pushed the fix-10854-associate-rule-set-to-request-routing-rules branch from 83b08b2 to 3ab8040 Compare December 9, 2019 05:19
@mmyyrroonn mmyyrroonn force-pushed the fix-10854-associate-rule-set-to-request-routing-rules branch from 3ab8040 to 71b58a2 Compare December 10, 2019 07:05
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.

[AppGw] Rewrite rule set can't be associated with Request routing rules

5 participants