Page MenuHomePhabricator

Allow Herald pre-commit rules to act on repository projects
ClosedPublic

Authored by epriestley on Jan 3 2014, 5:35 PM.
Tags
None
Referenced Files
F15518580: D7883.id.diff
Sat, Apr 19, 2:47 PM
F15518579: D7883.id17834.diff
Sat, Apr 19, 2:46 PM
F15518578: D7883.id17843.diff
Sat, Apr 19, 2:46 PM
F15510801: D7883.id.diff
Wed, Apr 16, 8:50 PM
F15505705: D7883.id17834.diff
Tue, Apr 15, 5:10 AM
F15473351: D7883.id17843.diff
Sat, Apr 5, 9:04 PM
F15467579: D7883.id17843.diff
Thu, Apr 3, 4:28 PM
F15449431: D7883.diff
Fri, Mar 28, 10:12 AM
Subscribers

Details

Summary

Fixes T4264. Adds:

  • New "Repository's projects" field to Herald pre-commit rules, so you can write global rules which act based on projects.
  • Allows pre-ref/pre-content rules to bind to projects, and fire for all repositories in that project, so users with limited power can write rules which apply to many repositories.
  • The pre-ref and pre-content classes were starting to share a fair amount of code, so I made them both extend an abstract base class.
Test Plan

Wrote new pre-ref and pre-content rules bound to projects, then pushed commits into repositories in those projects and not in those projects. The "repository projects" field populated, and the rules fired for repositories in the relevant projects.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Nice. I dig the precommit base class and subsequent code consolidation.

src/applications/herald/storage/HeraldRule.php
20

ah, there it is!