Skip to content

new api to get triggers #11021

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

Merged
merged 11 commits into from
Apr 24, 2025
Merged

Conversation

patelchandni
Copy link
Contributor

Issue describing the changes in this PR

New GET admin/host/triggers API needed for Functions Deployment Manager will return sync trigger payload.
It is using ResourceContainsSecrets Attribute.

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
    • Otherwise: Link to backporting PR
  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

@patelchandni patelchandni requested a review from a team as a code owner April 22, 2025 16:08
Copy link
Contributor

@eliaslopezgt eliaslopezgt left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@patelchandni patelchandni force-pushed the developer/chandnipatel/getTriggersAPI branch from af0f59e to eaf25df Compare April 22, 2025 21:09
@fabiocav fabiocav requested a review from Copilot April 23, 2025 21:03
Copy link

@Copilot 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 a new GET API endpoint (admin/host/triggers) for retrieving trigger payloads to support the Functions Deployment Manager and refactors the result types used for trigger operations. Key changes include:

  • Renaming SyncTriggersResult to TriggersOperationResult and updating associated tests.
  • Adding a new TriggersResult class to encapsulate the triggers payload.
  • Incorporating a new GetTriggersAsync method in IFunctionsSyncManager and its implementation in FunctionsSyncManager.
  • Creating a new controller endpoint with appropriate authorization and logging for trigger retrieval.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/WebJobs.Script.Tests/FunctionsSyncServiceTests.cs Updated test to expect TriggersOperationResult instead of SyncTriggersResult.
test/WebJobs.Script.Tests/Controllers/Admin/KeysControllerTests.cs Updated setup to use the new TriggersOperationResult.
test/WebJobs.Script.Tests.Integration/* Modified several integration tests to use the new TriggersOperationResult.
test/WebJobs.Script.Tests.Integration/Management/FunctionsSyncManagerTests.cs Added new test coverage for the GetTriggersAsync API.
src/WebJobs.Script/Diagnostics/MetricEventNames.cs Added new metric constant for GetTriggersInvoked.
src/WebJobs.Script.WebHost/Management/TriggersResult.cs Introduced a new class to return trigger payload content.
src/WebJobs.Script.WebHost/Management/TriggersOperationResult.cs Renamed and updated result type documentation.
src/WebJobs.Script.WebHost/Management/IFunctionsSyncManager.cs Updated interface to support the new GetTriggersAsync method.
src/WebJobs.Script.WebHost/Management/FunctionsSyncManager.cs Implemented GetTriggersAsync and refactored TrySyncTriggersAsync to return the new result type.
src/WebJobs.Script.WebHost/Controllers/HostController.cs Added a new endpoint for retrieving triggers with proper authorization and metrics logging.

@patelchandni patelchandni merged commit ce4fa5f into dev Apr 24, 2025
9 checks passed
@patelchandni patelchandni deleted the developer/chandnipatel/getTriggersAPI branch April 24, 2025 14:23
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.

6 participants