Build v2.3 - Multiple Enhancements including mailMessage processing#231
Merged
briandelmsft merged 38 commits intomainfrom Dec 11, 2025
Merged
Build v2.3 - Multiple Enhancements including mailMessage processing#231briandelmsft merged 38 commits intomainfrom
briandelmsft merged 38 commits intomainfrom
Conversation
Owner
briandelmsft
commented
Dec 3, 2025
- Fixes MailMessage Enrichment #54
- Fixes Surface the onPremisesSyncEnabled #141
- Fixes Remove cryptography module pinning #186
- Fixes Upgrade to Python 3.12 #187
- Fixes 500 Series Error Retries #198
- Fixes Update Function Extension Bundle #199
- Fixes Add logging messages to each module #204
- Fixes Error Handling: Add token check to base module to ensure at least the minimal permissions are present #206
- Fixes Logging Enhancement: Incident changes such as Comments, tags and tasks silently fail without any logging #209
- Fixes Debug Module - Comment, task, tag improvements #213
- Fixes Scoring Module: Accept strings for ModuleBody #219
- Fixes BUG - Exchange Module throws exception when OOF is scheduled #220
- Fixes Possible Exception when Filename contains more than just a file name #221
Merge with changes in main
Add mailMessage Entity Handling
Additional logging and error handling, updates for 3.10 builds
…STAT-Function into build_v2_2_update1
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces version 2.3 of STAT with significant enhancements focused on mail message processing, improved error handling, and better logging capabilities across all modules. The changes fix 13 issues and introduce comprehensive support for MailMessage entities throughout the codebase.
Key Changes
- MailMessage Entity Support: Complete implementation of mail message entity processing, enrichment via Microsoft Graph API, and integration into KQL queries and incident comments
- Enhanced Error Handling: New exception classes (
STATServerError,STATFailedToDecodeToken,STATInsufficientPermissions) and improved retry logic with logging for API calls - Logging Improvements: Added structured logging across all modules to track invocations and API failures
Reviewed changes
Copilot reviewed 29 out of 30 changed files in this pull request and generated 26 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/base.py | Adds mail message enrichment, permission checks, and reformats incident comments with improved HTML structure |
| classes/init.py | Introduces new exception classes and adds MailMessages/CreatedTime properties to BaseModule with supporting KQL methods |
| shared/rest.py | Enhances error handling with server error retries, adds permission validation functions, and implements logging throughout |
| shared/data.py | Adds ISO 8601 datetime conversion utility with timezone handling |
| modules/kql.py | Integrates mail entities into KQL query generation |
| modules/exchange.py | Improves OOF date parsing with exception handling and adds message trimming |
| modules/scoring.py | Adds JSON string parsing support for ModuleBody |
| tests/test_stat_base.py | Adds assertions for MailMessages count validation |
| tests/test_rest.py | Adds tests for new permission checking functions |
| tests/test_data.py | Adds comprehensive datetime conversion tests |
| host.json | Updates extension bundle from v3 to v4 |
| requirements.txt | Removes cryptography version constraint |
| debug/debug.py | Adds debug functions for comment, task, and tag operations |
| .vscode/* | Updates launch and task configurations for improved debugging |
| .github/workflows/stat_function_build.yml | Modifies pip install to use Linux-compatible binaries |
| README.md | Updates AZURE_AUTHORITY_HOST to include protocol |
Comments suppressed due to low confidence (3)
modules/base.py:277
- Except block directly handles BaseException.
except:
modules/exchange.py:124
- Except block directly handles BaseException.
except:
shared/rest.py:475
- Except block directly handles BaseException.
except:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.


