[PLGN-699] - Microsoft Teams- Using regex match rather than regex search when getting the channel ids based on the channel names supplied by users#2298
Merged
rbowden-r7 merged 3 commits intodevelopfrom Feb 7, 2024
Conversation
…channel ids based on the channel names supplied by users
igorski-r7
approved these changes
Feb 7, 2024
jerichardson-r7
approved these changes
Feb 7, 2024
ablakley-r7
approved these changes
Feb 7, 2024
joneill-r7
pushed a commit
that referenced
this pull request
Feb 7, 2024
…rch when getting the channel ids based on the channel names supplied by users (#2298) * PLGN-699-Using regex match rather than regex search when getting the channel ids based on the channel names supplied by users * PLGN-699-Updating the help.md version message * PLGN-699 - fix typo
rbowden-r7
added a commit
that referenced
this pull request
Feb 7, 2024
…rch when getting the channel ids based on the channel names supplied by users (#2298) * PLGN-699-Using regex match rather than regex search when getting the channel ids based on the channel names supplied by users * PLGN-699-Updating the help.md version message * PLGN-699 - fix typo
rbowden-r7
added a commit
that referenced
this pull request
Feb 7, 2024
* [PLGN-699] - Microsoft Teams- Using regex match rather than regex search when getting the channel ids based on the channel names supplied by users (#2298) * PLGN-699-Using regex match rather than regex search when getting the channel ids based on the channel names supplied by users * PLGN-699-Updating the help.md version message * PLGN-699 - fix typo * PLGN-697 - Using urllib parse to ensure any symbols in the team name are parsed correctly (#2299) PLGN-697-Adding the updates to help.md file PLGN-697-making api capitalized in the help.md PLGN-697-Updating unit test to reflect new url encoding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Changes
Description
Describe the proposed changes:
The users had notided when using a channel name such
alertsas in input paramater, the messages were sometimes instead getting posted to a differenert channelhigh severity alerts. This was due to us getting all channel names, then using that list to find out the id of the chanel to post the message to. As we were using regex serach to determine a match, if the list of channels came back withhigh severity alertsfirst in the list the message would be posted there rather than toalerts.searchtomatchto ensure that we are always selecting the correct channelhttps://rapid7.atlassian.net/browse/PLGN-699
PR Requirements
Developers, verify you have completed the following items by checking them off:
Testing
Unit Tests
Review our documentation on generating and writing plugin unit tests
In-Product Tests
tests have been ran using docker and postman and the tests were now consitent of the correct channel being selected
If you are an InsightConnect customer or have access to an InsightConnect instance, the following in-product tests should be done:
Style
Review the style guide
USER nobodyin theDockerfilewhen possiblerapid7/insightconnect-python-3-38-slim-plugin:{sdk-version-num}andrapid7/insightconnect-python-3-38-plugin:{sdk-version-num}insight-plugin validatewhich callsicon_validateto linthelp.mdFunctional Checklist
tests/directory created withinsight-plugin samplestests/$action_bad.jsoninsight-plugin run -T tests/example.json --debug --jqinsight-plugin run -T all --debug --jq(use PR format at end)insight-plugin run -R tests/example.json --debug --jqinsight-plugin run --debug --jq(use PR format at end)Assessment
You must validate your work to reviewers:
insight-plugin validateand make sure everything passesinsight-plugin run -A. For single action validation:insight-plugin run tests/{file}.json -Ainsight-plugin ... | pbcopy) and paste the output in a new post on this PRexample of search, where if

high severity alertscomes before alerts we get back not the correct id we wantexample of match , where if

high severity alertscomes before alerts we get back the correct id we want