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

Changed logger.py to comply with MS Flow HTTP code #385

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

w33ts
Copy link

@w33ts w33ts commented Oct 22, 2024

Proposed changes

As Microsoft has started to deprecate the "Incoming Webhook" functionality in favor of their workflow features, the standard HTTP response code is now 202, instead of just 200.

Change: I amended the response code checker just a hair to include both 200 and 202 for backwards compatibility on line 310 of logger.py.

Reference about 202 response code: https://community.dynamics.com/blogs/post/?postid=d914a6af-bef3-417f-a02b-0571610e3a05

Types of changes

What types of changes does your code introduce to this repository?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • Lint and unit tests pass locally with my changes (if applicable)
  • I have run pre-commit (pre-commit in the repo)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Linked to the relevant github issue or github discussion

Further comments

I did not run any pre-commit checks, as I'm unable to get a proper development environment spun up right this moment to test, but I did test it in a production canary by modifying the logger.py and it resolved the error popping up in the logs.

Initial error:
image

After updating logger.py:
image

If absolutely necessary, I'll see if I can find some time to spin up a GitHub Workspace and run the pre-commit hooks.

Thank you!

As Microsoft has started to deprecate the "Incoming Webhook" functionality in favor of their workflow features, the standard HTTP response code is now 202, instead of just 200. 

I amended the response code checker just a hair to include both 200 and 202 for backwards compatibility.

Reference about 202 response code: https://community.dynamics.com/blogs/post/?postid=d914a6af-bef3-417f-a02b-0571610e3a05

Signed-off-by: w33ts <aaron@cyber.info>
@w33ts w33ts marked this pull request as draft October 22, 2024 20:25
@w33ts
Copy link
Author

w33ts commented Oct 22, 2024

I'm converting this to a draft for now. As I'm continuing to push through getting this to fully work with Adaptive Cards, it is becoming clear that the whole Teams handler will need to be updated with a new schema, especially since MS is deprecating the "Incoming Webhooks" very, very soon. I'll set aside some time to work on getting this fully working with workflows and no support for their old webhooks, as you can't even create them anymore and will be fully shutting down soon.

@w33ts
Copy link
Author

w33ts commented Oct 22, 2024

Quick update, I've gotten it delivering notifications to Teams in a relatively pleasant way:

Anchored-Pumper-Fool
Blue-Frack-Headass
Retrofitted-Clown-Pump

I've added a mapping to make the key values a bit prettier and then added a filter to cut out 1001 logtypes so the webhook is only receiving alerts. There is a boolean setup in the config in case people do want these alerts:
Devoted-Wiffle-Muffin

I'll work on getting these changes into my branch and add to the documentation to cover this because I had no idea the Teams handler was even a thing until I looked at the code base lol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant