Skip to content
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

Refactor automation builder. #15494

Merged
merged 5 commits into from
Feb 6, 2025
Merged

Refactor automation builder. #15494

merged 5 commits into from
Feb 6, 2025

Conversation

samwho
Copy link
Collaborator

@samwho samwho commented Feb 5, 2025

Description

Most calls to createAutomationBuilder followed the same pattern: they passed in config, set a name, maybe set an appId that always matched config.getAppId(). I've simplified this pattern so that you only have to do createAutomationBuilder(config). The name was never used for anything anyway, but I've made it so that you can set it if you want with a new name(n: string) method on the builder.

I've also set appAction({ fields: {} }) to be the default trigger, as most uses of createAutomationBuilder were doing this manually.

Lastly, I removed a lot of duplication in the AutomationBuilder.ts file by making the creation of the step and filter functions the result of another function call, shortening them to one line each and making sure they're consistent. This will also make it a bit easier to add new ones in future.

Copy link

qa-wolf bot commented Feb 5, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

@github-actions github-actions bot added firestorm Data/Infra/Revenue Team size/l labels Feb 5, 2025
Base automatically changed from automation-tests-3 to master February 5, 2025 17:26
@samwho samwho marked this pull request as ready for review February 5, 2025 17:44
@samwho samwho requested a review from a team as a code owner February 5, 2025 17:44
@samwho samwho requested review from adrinr and PClmnt and removed request for a team February 5, 2025 17:44
Copy link
Collaborator

@PClmnt PClmnt left a comment

Choose a reason for hiding this comment

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

Really nice refactor! LGTM

@samwho samwho merged commit d72b40c into master Feb 6, 2025
20 checks passed
@samwho samwho deleted the automation-tests-4 branch February 6, 2025 16:04
@github-actions github-actions bot locked and limited conversation to collaborators Feb 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
firestorm Data/Infra/Revenue Team size/l
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants