-
Notifications
You must be signed in to change notification settings - Fork 40
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
[tcgc] overwrite original value when set multiple value for same decorator #1606
Conversation
All changed packages have been documented.
Show changes
|
You can try these changes here
|
@timotheeguerin could you help to have a review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this current logic has some issue. Do you think this should emit a warning?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. all client decorator value should be scope orthometric. they should always be used in client.tsp
, so augment decorator is more common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is an azure decision though to have that client.tsp. Someone else could decide to use it inline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. if the value could overlap each other, then the order should be important, which may be confuse for customer i think. let me raise this discussion in the weekly sync after our national holiday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for clarity on the ideal design for decorators:
- Order on the element itself shouldn't be depended on. It is confusing(inverted). And if you don't allow multiple decorators(you just override) it is good to validate you don't define those twice
- Using the decorator on
model is
orop is
to override the base model/op should work and not complain about duplicate - Similarly using augment decorator to override what is defined locally shouldn't ideally complain either
- Multiple augment decorator are run in the order of declaration so later overrides. I think it can be ok to validate to don't augment twice but you might have to be careful also on the scope. E.g. if a library augmented a type and you want to reaugment it again might not want it to complain again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i got what you mean. then i think it is more effort than it's worth to check duplicate definition. i will change the logic to be incremental setting for all settings for one decorator, overwrite when same scope. what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've changed the logic, please help to review.
@tadelesh the release just went out, I feel it would be good to release this before next month's release, thoughts on updating this to the release branch? |
sure. changed branch. |
fix: #1036