Page MenuHomePhabricator

"Any changed file contents" rule should act on *new* text
Closed, ResolvedPublic

Assigned To
Authored By
aristedes
Feb 10 2015, 11:04 PM
Referenced Files
F291717: pasted_file
Feb 10 2015, 11:33 PM
F291675: pasted_file
Feb 10 2015, 11:16 PM

Description

This rule in herald acts on the text *removed* from the source as well as text added. This makes the rule unhelpful for a common use-case which is to detect certain text and create an audit. For example, creating an audit when the string "TODO" is detected.

Right now, an audit is created when that string is removed from the source, as well as when it is added.

Event Timeline

aristedes raised the priority of this task from to Needs Triage.
aristedes updated the task description. (Show Details)
aristedes added a project: Herald.
aristedes added a subscriber: aristedes.

Is this what you're after?

pasted_file (351×642 px, 39 KB)

Not quite because I want this to fire for changed files as well as newly added files.

That's what my assumption would be.

pasted_file (58×262 px, 14 KB)

epriestley claimed this task.
epriestley added a subscriber: epriestley.

@chad is correct about how this works. "Any added file content" is new content across both existing and new files.

There is no way to write rules for only content in new files, mostly because I can't come up with any reason anyone would ever want to do that.

Sorry, I'm confused. I read this to mean:

Any changed file content -> should fire on the new contents of any file which was changed (actually means: fire on any text removed or added)

Any added file content -> should fire on new files which were added

Any removed file content -> should fire on the content of files which were removed.

I guess the question is whether it means "(added file) content" or "added (file content)". I read the former, but are you saying it is the latter?

Great, thanks guys. Can I recommend a small change in the text then:

Any changed file content -> Text removed or added in a commit
Any added file content -> Text added in a commit
Any removed file content -> Text removed in a commit

Basically, get rid of the misleading "file" and be explicit that we are talking about "text" since that's all you can search on.