Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

DEVPROD-2227: Remove family triggers from trigger definitions #2203

Merged
merged 6 commits into from
Jan 4, 2024

Conversation

minnakt
Copy link
Contributor

@minnakt minnakt commented Dec 21, 2023

DEVPROD-2227

Description

This PR removes the usage of family triggers from the trigger definitions.

It's too complicated to process which trigger we need to assign in the frontend. The notifications are already quite tricky and they would become even harder to understand if we added another layer of complexity. Instead, we will make up for it by doing some extra processing in the backend.

Evergreen PR

Copy link

cypress bot commented Dec 21, 2023

1 flaky test on run #15085 ↗︎

0 545 10 0 Flakiness 1
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Update triggers.ts
Project: Spruce Commit: 1c10279623
Status: Passed Duration: 18:00 💡
Started: Jan 4, 2024 10:31 PM Ended: Jan 4, 2024 10:49 PM

Review all test suite changes for PR #2203 ↗︎

@minnakt minnakt marked this pull request as ready for review December 21, 2023 17:16
@minnakt minnakt requested a review from a team December 21, 2023 17:17
@@ -309,7 +309,7 @@ export const projectTriggers: Trigger = {
[ProjectTriggers.SUCCESSFUL_TASK_EXCEEDS_DURATION]: {
trigger: TriggerType.SUCCESSFUL_EXCEEDS_DURATION,
resourceType: ResourceType.Task,
label: "The Runtime For a Successful Task Exceeds Some Duration",
label: "The runtime For a successful task exceeds some duration",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
label: "The runtime For a successful task exceeds some duration",
label: "The runtime for a successful task exceeds some duration",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you... 🥹

};

export const convertFamilyTrigger = (trigger: string) => {
export const fromFamilyTrigger = (trigger: string) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this function have a comment on why it's used?

Suggested change
export const fromFamilyTrigger = (trigger: string) => {
export const simplifyFamilyTrigger = (trigger: string) => {

@@ -25,9 +25,10 @@ const getTriggerText = (trigger: string, resourceType: string) => {
};

const getTriggerEnum = (trigger: string, resourceType: string) => {
const convertedTrigger = fromFamilyTrigger(trigger);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you improve the variable naming for convertedTrigger. The family conversion logic may also do well in the resolver.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The resolver is a good idea! I will file a ticket for it -- shouldn't be too difficult of a change!

@minnakt minnakt merged commit 68c9bb5 into evergreen-ci:main Jan 4, 2024
5 of 6 checks passed
@minnakt minnakt deleted the DEVPROD-2227 branch January 4, 2024 23:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants