Skip to content

feat(teams): introduce Teams Workflows service #414

Merged
pasha-codefresh merged 13 commits intoargoproj:masterfrom
pasha-codefresh:feat/ms-team-webhook-support
Dec 23, 2025
Merged

feat(teams): introduce Teams Workflows service #414
pasha-codefresh merged 13 commits intoargoproj:masterfrom
pasha-codefresh:feat/ms-team-webhook-support

Conversation

@pasha-codefresh
Copy link
Copy Markdown
Member

Closes: argoproj/argo-cd#18981

  • Added a new Teams Workflows service as a recommended replacement for the deprecated Office 365 Connectors, which will retire on March 31, 2026.
  • Updated the Teams documentation to reflect the deprecation notice and migration instructions to Teams Workflows.
  • Enhanced the overview of Teams services to include details about the new Teams Workflows service and its configuration.
  • Updated the service structure to accommodate the new Teams Workflows notification type.

This change aims to improve notification capabilities and ensure users transition smoothly to the new service.

pasha and others added 3 commits November 30, 2025 00:17
…entation

- Added a new Teams Workflows service as a recommended replacement for the deprecated Office 365 Connectors, which will retire on March 31, 2026.
- Updated the Teams documentation to reflect the deprecation notice and migration instructions to Teams Workflows.
- Enhanced the overview of Teams services to include details about the new Teams Workflows service and its configuration.
- Updated the service structure to accommodate the new Teams Workflows notification type.

This change aims to improve notification capabilities and ensure users transition smoothly to the new service.
…nction

- Removed error handling from teamsWorkflowsNotificationToAdaptiveCard function, returning only the adaptive card.
- Updated the calling function to reflect the change, eliminating unnecessary error checks.

This change streamlines the code by assuming successful conversion, enhancing readability and maintainability.
Copy link
Copy Markdown
Contributor

@ppapapetrou76 ppapapetrou76 left a comment

Choose a reason for hiding this comment

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

Can we please add UTs for the new code?

Comment thread pkg/services/teams-workflows.go
Comment thread pkg/services/teams-workflows.go Outdated
Comment thread pkg/services/teams-workflows.go Outdated
Comment thread pkg/services/teams-workflows.go Outdated
Comment thread pkg/services/teams-workflows.go Outdated
Comment thread pkg/services/teams-workflows.go Outdated
Comment thread pkg/services/teams-workflows.go Outdated
Comment thread docs/services/teams-workflows.md Outdated
@pasha-codefresh
Copy link
Copy Markdown
Member Author

pasha-codefresh commented Dec 21, 2025

It was resolved in this PR
#421

pasha added 6 commits December 22, 2025 00:49
…ructure

- Added logging for webhook URL when sending Teams Workflows messages.
- Introduced new types for adaptive messages and attachments to align with Teams Workflows requirements.
- Updated the `teamsWorkflowsNotificationToReader` function to wrap Adaptive Card payloads in the expected message structure.
- Enhanced the adaptive card element to include a color property for better customization.

These changes improve the integration with Teams Workflows and ensure proper message formatting.
- Updated test cases in `teams-workflows_test.go` to streamline the logic for checking element types in adaptive cards.
- Replaced nested conditionals with early continue statements for improved readability and maintainability.
- Ensured that the presence of required elements like "TextBlock" and "FactSet" is still validated effectively.

These changes enhance the clarity of the test code while maintaining its functionality.
…alidation

- Updated the `validateWorkflowsWebhookURL` function to use `errors.New` instead of `fmt.Errorf` for error messages related to webhook URL validation.
- This change enhances consistency in error handling and improves readability of the code.

These modifications streamline the error reporting process within the Teams Workflows service.
- Consolidated the template parsing logic in the GetTemplater method by reusing the texttemplate instance for all template fields.
- This change reduces redundancy and improves code maintainability while ensuring consistent error handling across all template parsing operations.

These modifications enhance the clarity and efficiency of the Teams Workflows notification service.
- Enhanced error messages in the Send method of the teamsWorkflowsService to provide more context when failures occur during HTTP client creation, message payload generation, and posting to the webhook.
- This change improves the clarity of error reporting, making it easier to diagnose issues in the Teams Workflows integration.

These modifications contribute to better maintainability and debugging capabilities within the service.
- Revised the configuration instructions for setting up Power Automate Workflows in Microsoft Teams, enhancing clarity and detail.
- Removed deprecated steps related to Office 365 Connectors and emphasized the transition to Power Automate.
- Added a note directing users to the dedicated Teams Workflows documentation for comprehensive guidance.

These changes improve the user experience by providing clearer and more accurate setup instructions for Teams notifications.
pasha added 3 commits December 22, 2025 17:30
…entation

- Eliminated the outdated webhook URL for Office 365 Connectors from the documentation, aligning with the transition to Power Automate Workflows.
- This update ensures that users have access to the most current and relevant information for configuring Teams Workflows.

These changes enhance the accuracy of the documentation and support users in adopting the latest integration practices.
- Simplified the template parsing logic in the TeamsWorkflowsNotification by directly creating new texttemplate instances for each field, enhancing code clarity and maintainability.
- Updated the test assertions in teams_test.go to reflect the new behavior where a response body of "1" is considered a success, regardless of the status code.
- Adjusted the test assertions in teams-workflows_test.go for consistency and clarity.

These changes improve the overall structure and readability of the code while ensuring accurate test coverage for the Teams Workflows functionality.
- Deleted the TestWorkflowsURLPattern function from teams_test.go as it contained outdated test cases for deprecated webhook URLs.
- This cleanup aligns the test suite with the current state of the Teams Workflows integration, ensuring that only relevant tests are maintained.

These changes enhance the maintainability of the test code by removing unnecessary and obsolete tests.
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.

O365 connectors within Teams deprecation notice with Argo CD notifications

4 participants