Skip to content

[5.x] Correct display of warning header#10595

Merged
jbudz merged 1 commit into5.xfrom
jasper/backport/10470/5.x
Feb 27, 2017
Merged

[5.x] Correct display of warning header#10595
jbudz merged 1 commit into5.xfrom
jasper/backport/10470/5.x

Conversation

@elastic-jasper
Copy link
Copy Markdown
Contributor

Correct display of warning header

Backports PR #10470

Commit 1:
Correct display of warning header

Elasticsearch produces warning headers for the use of deprecated
features. These warning headers can contain commas which breaks the
splitting of multiple values on commas. Upstream Elasticsearch has
changed the warning headers to be specification compliant so that these
headers can be safely split (the warning text and warning date must be
quoted, so splits should only occur on commas that are not contained in
quotes). Additionally, the upstream change includes additional details
that are not needed for display in Console (a warning code, the
Elasticsearch version that produced the warning, and the warning
date). This commit corrects the splitting logic in Console to only split
on commas not contained in quotes, and to extract the warning text from
each warning header.

Commit 2:
Safer regex handling

If the warning header from Elasticsearch comes back in the wrong format,
this could lead to the regex not matching which would lead to a
blow-up. While Elasticsearch should not do this, let us be defensive
here.

Commit 3:
Stricter handling of warning headers

Commit 4:
Add tests for deprecation messages

Backports PR #10470

**Commit 1:**
Correct display of warning header

Elasticsearch produces warning headers for the use of deprecated
features. These warning headers can contain commas which breaks the
splitting of multiple values on commas. Upstream Elasticsearch has
changed the warning headers to be specification compliant so that these
headers can be safely split (the warning text and warning date must be
quoted, so splits should only occur on commas that are not contained in
quotes). Additionally, the upstream change includes additional details
that are not needed for display in Console (a warning code, the
Elasticsearch version that produced the warning, and the warning
date). This commit corrects the splitting logic in Console to only split
on commas not contained in quotes, and to extract the warning text from
each warning header.

* Original sha: 02896ea
* Authored by Jason Tedor <jason@tedor.me> on 2017-02-20T20:44:14Z

**Commit 2:**
Safer regex handling

If the warning header from Elasticsearch comes back in the wrong format,
this could lead to the regex not matching which would lead to a
blow-up. While Elasticsearch should not do this, let us be defensive
here.

* Original sha: 7f98c48
* Authored by Jason Tedor <jason@tedor.me> on 2017-02-22T20:23:35Z

**Commit 3:**
Stricter handling of warning headers

* Original sha: f14055c
* Authored by Jason Tedor <jason@tedor.me> on 2017-02-24T19:08:28Z

**Commit 4:**
Add tests for deprecation messages

* Original sha: 8a9f432
* Authored by Jason Tedor <jason@tedor.me> on 2017-02-27T15:42:56Z
@elastic-jasper elastic-jasper added the backport This PR is a backport of another PR label Feb 27, 2017
@jbudz jbudz merged commit 4b954d4 into 5.x Feb 27, 2017
@epixa epixa deleted the jasper/backport/10470/5.x branch February 28, 2017 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants