-
Notifications
You must be signed in to change notification settings - Fork 263
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
feature(service): Implements traffic splitting and tagging targets #345
Conversation
started to play with it... one initial comment: |
Unless we drop the requirement of all revision names starting with |
@duglin : Thanks for testing it.
The way I'd use that flag as easy way to re-present the desired state on CLI, for eg:
helps make identifying latestRevision reference in traffic block by a flag than an assumed value.
Personally, -1 for any assumptions, I'd rather want to write exact revision names on CLIs. BTW, did you notice you can also do
If one doesn't want to repeat |
oh wait, using I still think:
is more friendly than:
But oh well. Still need to play more with tag names and multiple "latest" blocks.... |
What’s the ` at the end of your command here? Typo? |
👍🏽👍🏽 |
wrt. to
vs
I'm clearly for the So my suggestion would be:
with latest handling done by a marker value. This looks like a nice and concise UX. |
@maximilien : Typo, fixed it. |
For discussion on having dedicated flag to reference latest revision, I'd prefer to use separate flags ( We'll need bring docs for this, IMO we had that 'special word' represented by flag My take on re-presenting the YAMLs via CLI UX is to give users convenient flags that are easy to remember and use, I don't think number of flags should be a concern if they are used for specific operations, like these flags will be used for specific operations and we'll have 2 for traffic and 3 for tagging, that number sounds fine to me. |
If we're to use special word and omit the
Something to note here is that it allows only Would |
it's actually because |
@duglin LATEST is equally forbidden and there is no chance of interference with shell special characters nor that it can be used as a regular revision name. The same here: LATEST will never be sent but has the special meaning for the client to specify the 'latest'. I have no super strong opinion, but think LATEST (all upper case) might make more sense (except when the user gets confused with the casing, in which case a special prefix character like |
Let's make a vote for these three options
|
Vote for |
Vote for |
Vote for |
@rhuss : I like your suggestion. I am +1 to change the current |
+1 to removing the unnecessary |
@duglin @rhuss : Updated the PR per suggestions, please git it a spin. If the UX surface looks good, I'll go ahead by adding rest of the items in the checklist. |
yep - I know LATEST is disallowed too, it's just less clear to a newbie that it's special. I think a special char (like |
/test pull-knative-client-integration-tests-latest-release |
f6c94d7
to
96992be
Compare
The following is the coverage report on pkg/.
|
ok, so this is what I'm seeing:
does appear to work, so that's good. However, my first attempt at it I tried to just setup the traffic block w/o any tags and just have 2 50% sections:
Should I be able to do this? |
@duglin About the second item as below, I think we disallow duplicated revision reference. I have added a check and it will report an error from the client instead of the server, the code should have been included in this PR request.
Now you will get something as below,
|
If the desired state expect to have same revision in multiple targets, user must tag them for |
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.
Clean code. I like how you handled precedence. LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jimcurtis, maximilien, navidshaikh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@sixolet @maximilien @cppforlife: I've rebased and squashed, PTAL. |
/lgtm |
/lgtm |
@navidshaikh and @zhanggbj I think it’s not merging because you need to rebase, conflict with: |
96992be
to
38a9e2b
Compare
The following is the coverage report on pkg/.
|
- Add e2e tests - Use '=' for traffic and tag assignment instead of ':' - Use --tag and --untag flags for tagging traffic targets - Use --traffic flag for setting traffic portions - Allow --traffic portion to either take revisionName or tagName - Uses @latest identifier for referencing latest revision of service - Dont throw error if requested revision=tag pair is same - Support having multiple tags for a revision - creates a new target in traffic block if revision present in traffic block with new tag requested - creates N new targets in traffic block if revision absent in traffic block with Nxnew tags requested - Ensure updating tag of @latest requires --untag flag - streamline updating tag for latestReadyRevision - adds respective tests - adds tests for ensuring given traffic sum to 100 on CLI and fail fast - Add note about preference of order in case where tagOfOneRevision == revisionOfAnother, first tags are checked and assigned traffic if any, as tags are supposed to be unique in traffic block and should be referenced in such scenario. - Remove the examples from flag description, moves it to service update command example section - Pass only traffic block to compute trffic, makes it better to consume. - Cover more error cases for invalid value format for assignments, covers a=b=c, a=, =b, or variants of them - Separate and improves the error messages - Add unit tests for traffic computing - Add sanity checks in dedicated function verifyInputSanity - traffic perents should sum to 100 - individual percent should be in 0-100 - repetition of @latest or tagName or revisionRef is disallowed - Verify traffic percents sum to 100 on client side and fail fast - Add e2e tests for traffic splitting - create and update service, assign tags and set traffic to make an existing state - run the scenario on existing state of service - form the desired state traffic block - extract the traffic block and form the traffic block struct actual state - assert.DeepEqual actual and desired traffic blocks - Use logic to generate service name in the same way as namespace, use different service name per test case - Run e2e test for traffic splitting in parallel - Use timeout duration of 30m for e2e tests, use timeout parameter for go_test_e2e library function - Use tagName in flag description of --untag, avoiding conflict with --tag flag - Update CHANGELOG
38a9e2b
to
e7b4d8b
Compare
The following is the coverage report on pkg/.
|
/lgtm |
Fix #210
Introduced 3 flags for working with traffic:
--traffic
,--tag
,--untag
.Use
@latest
identifier to reference latest revision for--traffic
and--tag
flags.Added first cut, please give it a try by building the client from this PR,
see if there are use cases you need and not covered here.
PR is WIP and requires following to be complete:
Add check to verify if given revision exists(open Invalid revision names are accepted in the revision template serving#5094)