From b6ca6f31c07ca188e923c1ddc06e2d19c43adccf Mon Sep 17 00:00:00 2001 From: Elastic Jasper Date: Wed, 27 Apr 2016 19:47:22 -0400 Subject: [PATCH] Backport PR #6773 --------- **Commit 1:** [state] add configurable warning level based on url length * Original sha: 55db90d3ab1d3ae8fef8c450b72c351978a67ab0 * Authored by spalger on 2016-04-04T21:57:45Z **Commit 2:** [state] add a hard length limit that will start throwing errors * Original sha: 64699aa53df0f20fd4a962dbd3e14a092b9d8355 * Authored by spalger on 2016-04-04T22:14:06Z **Commit 3:** Merge branch 'master' of github.com:elastic/kibana into implement/betterWarningForUrlLength * Original sha: 4c70d6959d2c07fc0a4de2a58cb68e8846d7eb1d * Authored by spalger on 2016-04-06T07:05:47Z **Commit 4:** [dashboard] cleanup quietly to prevent error * Original sha: 1dace5c5a3a585a699d079865320129130df0357 * Authored by spalger on 2016-04-06T08:50:55Z **Commit 5:** [errorview] add url overflow display * Original sha: 8b4ebf5fcfb3d119da21dc88c46acedc55582370 * Authored by spalger on 2016-04-06T08:51:47Z **Commit 6:** [errorview] persist the overflow url so that refresh works * Original sha: e308db927c9895e330a04fb3a8dccf7dc86aec22 * Authored by spalger on 2016-04-06T09:05:13Z **Commit 7:** Merge branch 'master' of github.com:elastic/kibana into implement/betterWarningForUrlLength * Original sha: 121e4f23f4d4830230c7e7b65d8119a1cf824a93 * Authored by spalger on 2016-04-15T18:49:12Z **Commit 8:** [config] remove url limit config, it should adapt automatically * Original sha: 281b38b4afcae934a19edfd29ac14a3b52d68c73 * Authored by spalger on 2016-04-15T23:38:05Z **Commit 9:** [chrome] rework url overflow detection The previous version of this pr relied on the State service to catch times when the URL would grow out of control. While overflows will commonly occur in the State service, this didn't handle urls that were navigated to using a link. They worked because the state service would eventually be called, but the failure was unexpected and required interaction to trigger. This new approach does the checking at a higher level, in the chrome. We also removed the `url:limit` configuration value in favor of browser detection (I was not able to find or come up with a way to quietly and quickly feature detect this). The new limits are 2000 characters for IE and 25000 for all other browsers. * Original sha: 116521c6be68676ac2c808bfb065d209f3fa708c * Authored by spalger on 2016-04-15T23:40:18Z **Commit 10:** Merge branch 'master' of github.com:elastic/kibana into implement/betterWarningForUrlLength * Original sha: aa030d758958821c387dba19defb2ab5d1fafaff * Authored by spalger on 2016-04-26T16:51:22Z **Commit 11:** [ui/config] remove unused default * Original sha: b333c514cc44df787b6fe997dc6f70a04755498e * Authored by spalger on 2016-04-26T16:52:29Z **Commit 12:** Merge branch 'master' of github.com:elastic/kibana into implement/betterWarningForUrlLength * Original sha: 133d7e577ab16343b50e556d14b66096a5f73c4d * Authored by spalger on 2016-04-27T23:17:44Z **Commit 13:** [urlOverflow] assign magic numbers to variables * Original sha: 8b978818fca895400aac640391d253528586ae50 * Authored by spalger on 2016-04-27T23:24:17Z --- backport--instructions.rej | 83 ++++++++++++++++++++++++++++++ backport-commit-message.rej | 86 ++++++++++++++++++++++++++++++++ backport-guided-begin.rej | 12 +++++ backport-guided-finish.rej | 10 ++++ backport-wrangle-into-commit.rej | 12 +++++ 5 files changed, 203 insertions(+) create mode 100644 backport--instructions.rej create mode 100644 backport-commit-message.rej create mode 100755 backport-guided-begin.rej create mode 100755 backport-guided-finish.rej create mode 100755 backport-wrangle-into-commit.rej diff --git a/backport--instructions.rej b/backport--instructions.rej new file mode 100644 index 0000000000000..a164847cc834c --- /dev/null +++ b/backport--instructions.rej @@ -0,0 +1,83 @@ +Backport of PR #6773 to branch 4.x failed + +https://github.com/elastic/kibana/pull/6773 + + +- 4 patches failed to apply +- 4 patches were applied successfully + +------------------------------------- + +At this point, you need to manually resolve these conflicts on your machine and +push the changes back up to this upstream branch so the PR is updated with your +changes. The following instructions and scripts should help with that. + +All of the provided scripts assume that the remote "upstream" is where the +backport branch exists and that your local branch has the exact same name as +the upstream branch. + +First, check out this branch locally: + + git fetch upstream jasper/backport/6773/4.x + git checkout jasper/backport/6773/4.x + +Now, just follow one of these two paths: + + +1. GUIDED BACKPORT + +You should do the guided backport if you want to apply the backported changes +while resolving the conflicts on each commit. For most cases, this is what you +want to do. + +The following script will rebase the commits that need to be backported onto +a new temporary branch. Resolve any conflicts as you normally would during a +rebase. Do not remove these backport-*.rej files, and feel free to add +additional commits if that's necessary: + + sh backport-guided-begin.rej + +Once the conficts are resolved and the rebase is completed, the following +script will update the local backport branch with the changes, remove the +temporary branch that was created, remove the remnants of this backport commit +and squash the newly resolved commits (and any others you may have added) into +a single backport commit with the proper commit message: + + sh backport-guided-finish.rej + +At this point, you should be on the local backport branch, and it should be +exactly 1 commit ahead of the intended target. The commit message should be +very similar if not identical to the PR itself, and the changeset should +include all of the changes you intended to backport and none of these +backport-*.rej files. + +Now just replace the contents of the pull request with your local changes: + + git push -f upstream jasper/backport/6773/4.x + + +2. ALMOST COMPLETELY MANUAL + +You should do this option if there are just so many conflicts that it's easier +to rebuild the entire changeset from scratch. You'll still work on the local +backport branch which should be up to date with the intended target. + +Feel free to add as many commits as you'd like and don't worry about fancy +commit messages - we're just going to squash them down and replace the message +when you're finished. + +Once the changes are committed on your local backport branch, the following +script will remove the remnants of this backport commit and squash the newly +created commits into a single backport commit with the proper commit message. + + sh backport-wrangle-into-commit.rej + +At this point, you should be on the local backport branch, and it should be +exactly 1 commit ahead of the intended target. The commit message should be +very similar if not identical to the PR itself, and the changeset should +include all of the changes you intended to backport and none of these +backport-*.rej files. + +Now just replace the contents of the pull request with your local changes: + + git push -f upstream jasper/backport/6773/4.x diff --git a/backport-commit-message.rej b/backport-commit-message.rej new file mode 100644 index 0000000000000..d61407f7a6ef2 --- /dev/null +++ b/backport-commit-message.rej @@ -0,0 +1,86 @@ +Backport PR #6773 +--------- + +**Commit 1:** +[state] add configurable warning level based on url length + +* Original sha: 55db90d3ab1d3ae8fef8c450b72c351978a67ab0 +* Authored by spalger on 2016-04-04T21:57:45Z + +**Commit 2:** +[state] add a hard length limit that will start throwing errors + +* Original sha: 64699aa53df0f20fd4a962dbd3e14a092b9d8355 +* Authored by spalger on 2016-04-04T22:14:06Z + +**Commit 3:** +Merge branch 'master' of github.com:elastic/kibana into implement/betterWarningForUrlLength + +* Original sha: 4c70d6959d2c07fc0a4de2a58cb68e8846d7eb1d +* Authored by spalger on 2016-04-06T07:05:47Z + +**Commit 4:** +[dashboard] cleanup quietly to prevent error + +* Original sha: 1dace5c5a3a585a699d079865320129130df0357 +* Authored by spalger on 2016-04-06T08:50:55Z + +**Commit 5:** +[errorview] add url overflow display + +* Original sha: 8b4ebf5fcfb3d119da21dc88c46acedc55582370 +* Authored by spalger on 2016-04-06T08:51:47Z + +**Commit 6:** +[errorview] persist the overflow url so that refresh works + +* Original sha: e308db927c9895e330a04fb3a8dccf7dc86aec22 +* Authored by spalger on 2016-04-06T09:05:13Z + +**Commit 7:** +Merge branch 'master' of github.com:elastic/kibana into implement/betterWarningForUrlLength + +* Original sha: 121e4f23f4d4830230c7e7b65d8119a1cf824a93 +* Authored by spalger on 2016-04-15T18:49:12Z + +**Commit 8:** +[config] remove url limit config, it should adapt automatically + +* Original sha: 281b38b4afcae934a19edfd29ac14a3b52d68c73 +* Authored by spalger on 2016-04-15T23:38:05Z + +**Commit 9:** +[chrome] rework url overflow detection + +The previous version of this pr relied on the State service to catch times when the URL would grow out of control. While overflows will commonly occur in the State service, this didn't handle urls that were navigated to using a link. They worked because the state service would eventually be called, but the failure was unexpected and required interaction to trigger. + +This new approach does the checking at a higher level, in the chrome. + +We also removed the `url:limit` configuration value in favor of browser detection (I was not able to find or come up with a way to quietly and quickly feature detect this). The new limits are 2000 characters for IE and 25000 for all other browsers. + +* Original sha: 116521c6be68676ac2c808bfb065d209f3fa708c +* Authored by spalger on 2016-04-15T23:40:18Z + +**Commit 10:** +Merge branch 'master' of github.com:elastic/kibana into implement/betterWarningForUrlLength + +* Original sha: aa030d758958821c387dba19defb2ab5d1fafaff +* Authored by spalger on 2016-04-26T16:51:22Z + +**Commit 11:** +[ui/config] remove unused default + +* Original sha: b333c514cc44df787b6fe997dc6f70a04755498e +* Authored by spalger on 2016-04-26T16:52:29Z + +**Commit 12:** +Merge branch 'master' of github.com:elastic/kibana into implement/betterWarningForUrlLength + +* Original sha: 133d7e577ab16343b50e556d14b66096a5f73c4d +* Authored by spalger on 2016-04-27T23:17:44Z + +**Commit 13:** +[urlOverflow] assign magic numbers to variables + +* Original sha: 8b978818fca895400aac640391d253528586ae50 +* Authored by spalger on 2016-04-27T23:24:17Z \ No newline at end of file diff --git a/backport-guided-begin.rej b/backport-guided-begin.rej new file mode 100755 index 0000000000000..aa2ab8915a784 --- /dev/null +++ b/backport-guided-begin.rej @@ -0,0 +1,12 @@ +#!/bin/sh + +REMOTE="upstream" +BRANCH="jasper/backport/6773/4.x" +WORKING_BRANCH="tmp/$BRANCH" +STARTING_SHA="55db90d3ab1d3ae8fef8c450b72c351978a67ab0" +ENDING_SHA="8b978818fca895400aac640391d253528586ae50" + +git fetch $REMOTE + +git checkout -b $WORKING_BRANCH $ENDING_SHA +git rebase $STARTING_SHA^ --onto $BRANCH diff --git a/backport-guided-finish.rej b/backport-guided-finish.rej new file mode 100755 index 0000000000000..8d1d81774ed70 --- /dev/null +++ b/backport-guided-finish.rej @@ -0,0 +1,10 @@ +#!/bin/sh + +BRANCH="jasper/backport/6773/4.x" +WORKING_BRANCH="tmp/$BRANCH" + +git checkout $BRANCH +git reset --hard $WORKING_BRANCH +git branch -D $WORKING_BRANCH + +sh backport-wrangle-into-commit.rej diff --git a/backport-wrangle-into-commit.rej b/backport-wrangle-into-commit.rej new file mode 100755 index 0000000000000..4e366695f8813 --- /dev/null +++ b/backport-wrangle-into-commit.rej @@ -0,0 +1,12 @@ +#!/bin/sh + +REMOTE="upstream" +BRANCH="jasper/backport/6773/4.x" +COMMIT_MSG=`cat backport-commit-message.rej` + +git reset --soft $REMOTE/$BRANCH +git stash +git reset --hard HEAD^ +git stash apply --index + +git commit -m "$COMMIT_MSG" --no-verify