Skip to content

Commit

Permalink
feat: add completed event as webhook event (#6968)
Browse files Browse the repository at this point in the history
Now feature completed event can be used with webhook.
  • Loading branch information
sjaanus authored May 2, 2024
1 parent 95ebe25 commit 5c61667
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/addons/feature-event-formatter-md.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import {
CHANGE_REQUEST_SCHEDULED_APPLICATION_SUCCESS,
CHANGE_REQUEST_SCHEDULED_APPLICATION_FAILURE,
CHANGE_REQUEST_SCHEDULE_SUSPENDED,
FEATURE_COMPLETED,
} from '../types';

interface IEventData {
Expand Down Expand Up @@ -200,6 +201,10 @@ const EVENT_MAP: Record<string, IEventData> = {
action: '*{{user}}* updated *{{feature}}* metadata in project *{{project}}*',
path: '/projects/{{event.project}}/features/{{event.featureName}}',
},
[FEATURE_COMPLETED]: {
action: '*{{feature}}* was marked as completed in project *{{project}}*',
path: '/projects/{{event.project}}/features/{{event.featureName}}',
},
[FEATURE_POTENTIALLY_STALE_ON]: {
action: '*{{feature}}* was marked as potentially stale in project *{{project}}*',
path: '/projects/{{event.project}}/features/{{event.featureName}}',
Expand Down
2 changes: 2 additions & 0 deletions src/lib/addons/webhook-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
CHANGE_REQUEST_SCHEDULED_APPLICATION_FAILURE,
CHANGE_REQUEST_SCHEDULED,
CHANGE_REQUEST_SCHEDULE_SUSPENDED,
FEATURE_COMPLETED,
} from '../types/events';
import type { IAddonDefinition } from '../types/model';

Expand Down Expand Up @@ -103,6 +104,7 @@ const webhookDefinition: IAddonDefinition = {
FEATURE_REVIVED,
FEATURE_STALE_ON,
FEATURE_STALE_OFF,
FEATURE_COMPLETED,
FEATURE_ENVIRONMENT_ENABLED,
FEATURE_ENVIRONMENT_DISABLED,
FEATURE_STRATEGY_REMOVE,
Expand Down
1 change: 1 addition & 0 deletions website/docs/reference/integrations/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ You can choose to trigger updates for the following events (we might add more ev
- feature-strategy-remove
- feature-stale-on
- feature-stale-off
- feature-completed
- feature-environment-enabled
- feature-environment-disabled
- feature-variants-updated
Expand Down

0 comments on commit 5c61667

Please sign in to comment.