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

automod: add removing of labels from accounts and records #950

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

haileyok
Copy link
Contributor

i haven't tested this yet - and took me a little to understand what we were doing here so might still be a little off - but this should let us remove existing labels from accounts/records

@haileyok
Copy link
Contributor Author

haileyok commented Feb 20, 2025

one thing that might be weird here is if one rule adds a label and then another negates the label, need to think that through as i think it could get wonky with the current logic here in the pr....

early and still not fully caffeinated, but i think i got some decent logic here. imagine a scenario like:

  • Rule 1 executes and decides to AddLabel("sexual")
  • Rule 2 executes and decides to RemoveLabel("sexual")

Here, we'd keep the sexual label in the new labels to add (assuming it wasn't already added on the account/record).

  • Rule 1 executes and decides to RemoveLabel("sexual")
  • There is no sexual label on the account/record

Here we'd remove the sexual label from the rmdLabels, since there's no point in negating it.

  • Rule 1 executes and decides to RemoveLabel("sexual")
  • There is already a negated sexual label on the account/record

Here we'd remove the sexual label from the rmdLabels, since again in negating it.

@haileyok haileyok requested a review from bnewbold February 21, 2025 16:19
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.

1 participant