Skip to content

Conversation

briandelmsft and others added 30 commits May 26, 2025 16:52
Add mailMessage Entity Handling
Additional logging and error handling, updates for 3.10 builds
@briandelmsft briandelmsft requested a review from Copilot December 3, 2025 22:01
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 3, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@briandelmsft briandelmsft marked this pull request as ready for review December 4, 2025 03:06
@briandelmsft briandelmsft requested a review from piaudonn December 4, 2025 03:06
Copy link
Collaborator

@piaudonn piaudonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫰

@briandelmsft briandelmsft merged commit f1de6b6 into main Dec 11, 2025
3 checks passed
@briandelmsft briandelmsft deleted the build_v2_2_update1 branch December 11, 2025 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment