Skip to content

Add comprehensive Google-style docstrings to microsoft-agents-a365-notifications#94

Merged
pontemonti merged 6 commits intomainfrom
copilot/improve-reference-documentation
Feb 6, 2026
Merged

Add comprehensive Google-style docstrings to microsoft-agents-a365-notifications#94
pontemonti merged 6 commits intomainfrom
copilot/improve-reference-documentation

Conversation

Copy link
Contributor

Copilot AI commented Dec 18, 2025

Documentation Improvements for microsoft-agents-a365-notifications

  • Explore repository structure and current documentation state
  • Review all Python files in notifications library
  • Verify copyright headers are present (all files have them)
  • Check for "Kairo" keyword (none found)
  • Add comprehensive Google-style docstrings to agent_notification.py
    • Document AgentNotification class with detailed description and examples
    • Document all public decorator methods (on_email, on_word, on_excel, on_powerpoint, etc.)
    • Document AgentHandler type alias with comprehensive explanation
    • Document private helper methods
  • Add comprehensive docstrings to model files
    • agent_notification_activity.py - Document class, constructor, and all properties
    • notification_types.py - Document enum with descriptions for each value
    • agent_subchannel.py - Document enum with descriptions for each subchannel
    • agent_lifecycle_event.py - Document enum with descriptions for each event
    • email_reference.py - Document class and all fields
    • wpx_comment.py - Document class and all fields
    • email_response.py - Document class and static method with example
  • Update module-level __init__.py docstrings
  • Fix code style issues
    • Add missing copyright headers to all model files
    • Fix import ordering per ruff linting rules
    • Update type hints from Optional[X] to X | None
    • Use standard type annotation instead of non-standard builtins.type
  • Run ruff linter to verify formatting
  • Address code review feedback
  • Run security checks (CodeQL - no issues found)

Summary

All files in the microsoft-agents-a365-notifications library now have comprehensive Google-style docstrings that will generate proper reference documentation on learn.microsoft.com. Fixed type annotation issue by replacing non-standard builtins.type with standard type annotation.

Original prompt

This section details on the original issue you should resolve

<issue_title>Improve reference documentation for microsoft-agents-a365-notifications library</issue_title>
<issue_description>The learn.microsoft.com reference content for the libraries in this repo is here: Microsoft Agent 365 SDK for Python

The content found in this generated reference comes from the comments that developers add to code. Many of the packages, modules, classes, and enums in this library have no clear comments, or the comments are incorrectly formatted.

For example, the documentation includes text like this:

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

The text [ValidationError][pydantic_core.ValidationError] should be a link to another reference site ValidationError.

Those comments that exist seem to use Google/Numpy style docstrings. For consistency, all comments should use this style.

The learn.microsoft.com reference generation supports only the following Google doc string fields:

  • Args (alias of Parameters)
  • Arguments (alias of Parameters)
  • Example
  • Examples
  • Methods
  • Parameters
  • Return (alias of Returns)
  • Returns
  • Raises
  • References
  • See Also

reStructuredText (RST) formatted doc strings are also supported, but should not be mixed.

The documenting-api.md file I've uploaded includes all the instructions for documenting a Python library for reference document generation. documenting-api.md

To reduce the potential issues with this experiment, limit changes to only the microsoft-agents-a365-notifications library.

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: JimDaly <6353736+JimDaly@users.noreply.github.com>
Copilot AI changed the title [WIP] Update reference documentation for microsoft-agents-a365-notifications Add comprehensive Google-style docstrings to microsoft-agents-a365-notifications Dec 18, 2025
Copilot AI requested a review from JimDaly December 18, 2025 18:23
@JimDaly JimDaly marked this pull request as ready for review December 18, 2025 18:29
@JimDaly JimDaly requested a review from a team as a code owner December 18, 2025 18:29
Copilot AI review requested due to automatic review settings December 18, 2025 18:29
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 adds comprehensive Google-style docstrings to the microsoft-agents-a365-notifications library to enable proper API documentation generation for learn.microsoft.com. The changes include detailed documentation for all public classes, methods, enums, and type aliases, along with code style improvements.

Key changes:

  • Added Google-style docstrings with Args, Returns, Example, and Attributes sections to all public APIs
  • Added copyright headers to model files
  • Modernized type annotations from Optional[X] to X | None syntax

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
setup.py Fixed import ordering to follow PEP 8 (stdlib imports alphabetically sorted)
models/wpx_comment.py Added copyright header, class docstring, and modernized type annotations
models/notification_types.py Added copyright header and comprehensive enum docstring with attribute descriptions
models/email_response.py Added copyright header, class and method docstrings with examples
models/email_reference.py Added copyright header, class docstring, and modernized type annotations
models/agent_subchannel.py Added copyright header and enum docstring describing subchannel types
models/agent_notification_activity.py Added copyright header, comprehensive class docstring with args/raises/example, property docstrings, and as_model method documentation
models/agent_lifecycle_event.py Added copyright header and enum docstring describing lifecycle events
models/init.py Added copyright header and module-level docstring
agent_notification.py Added copyright header, comprehensive class docstring, type alias documentation, and detailed docstrings for all decorator methods with examples
init.py Reordered imports alphabetically for consistency

rahuldevikar761
rahuldevikar761 previously approved these changes Jan 6, 2026
Co-authored-by: JimDaly <6353736+JimDaly@users.noreply.github.com>
Copy link
Collaborator

@rahuldevikar761 rahuldevikar761 left a comment

Choose a reason for hiding this comment

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

Blocking the PR to review again

@pontemonti pontemonti requested a review from a team as a code owner February 6, 2026 17:31
@pontemonti pontemonti enabled auto-merge (squash) February 6, 2026 19:04
Copy link
Member

@JimDaly JimDaly left a comment

Choose a reason for hiding this comment

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

I can approve to the fact that these improved comments generated by Copilot are added.

I can't verify that they are correct. Looks like dev team members have reviewed this.

@pontemonti pontemonti merged commit 66e7be6 into main Feb 6, 2026
8 checks passed
@pontemonti pontemonti deleted the copilot/improve-reference-documentation branch February 6, 2026 19:31
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.

Improve reference documentation for microsoft-agents-a365-notifications library

5 participants