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
F18777735: D7883.diff
Sat, Oct 11, 4:54 AM
F18763350: D7883.id.diff
Mon, Oct 6, 11:54 PM
F18762333: D7883.id.diff
Mon, Oct 6, 6:32 PM
F18757215: D7883.id17843.diff
Sun, Oct 5, 4:11 PM
F18756040: D7883.diff
Sun, Oct 5, 8:53 AM
F18627043: D7883.id17843.diff
Sep 16 2025, 3:03 AM
F18597818: D7883.diff
Sep 13 2025, 3:44 AM
F18557090: D7883.id.diff
Sep 8 2025, 7:50 PM
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!