Skip to content
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

Omit field from mapping payload if it matches index field; Abort detector creation when mapping has failed #752

Conversation

amsiglan
Copy link
Collaborator

Description

In this PR we have updated two behaviors:

  1. A fix was made as part of return rule fields which do not have aliases security-analytics#652 where rule fields that match with index fields are now shown as part of automatic mappings in the view mappings API. However, a field cannot be mapped backed to itself in an index i.e. an alias name cannot be same as the index field name, so as part of create mapping API payload we should omit the automatically mapped field that matched an index field.
  2. If create mapping fails when user hits Create Detector, then we should abort the creation altogether. This behavior was regressed in an earlier version. This PR fixes that.

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

…fails

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Merging #752 (352cfa1) into main (b581e58) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #752      +/-   ##
==========================================
- Coverage   31.28%   31.28%   -0.01%     
==========================================
  Files         150      150              
  Lines        4913     4920       +7     
  Branches      880      882       +2     
==========================================
+ Hits         1537     1539       +2     
- Misses       3192     3197       +5     
  Partials      184      184              

see 2 files with indirect coverage changes

@amsiglan amsiglan added backport 2.x backport 2.11 PRs to be backported to 2.11 branch labels Oct 25, 2023
@amsiglan amsiglan merged commit 1419650 into opensearch-project:main Oct 25, 2023
10 of 13 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 25, 2023
…fails (#752)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 1419650)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 25, 2023
…fails (#752)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 1419650)
AWSHurneyt pushed a commit that referenced this pull request Oct 25, 2023
…fails (#752) (#768)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 1419650)

Co-authored-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
amsiglan added a commit that referenced this pull request Nov 21, 2023
…eld; Abort detector creation when mapping has failed (#767)

* updated field mappings service; abort detector creation when mapping fails (#752)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 1419650)

* updated workflow file

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>

---------

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Co-authored-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 1, 2023
…fails (#752)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 1419650)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Dec 1, 2023
…fails (#752)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 1419650)
amsiglan added a commit that referenced this pull request Dec 1, 2023
…fails (#752) (#820)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 1419650)

Co-authored-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
amsiglan added a commit that referenced this pull request Dec 1, 2023
…fails (#752) (#820)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 1419650)

Co-authored-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
amsiglan added a commit that referenced this pull request Dec 6, 2023
…fails (#752) (#819)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 1419650)

Co-authored-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants