Page MenuHomePhabricator

Pass repository PHID to custom hooks in PHABRICATOR_REPOSITORY instead of callsign
ClosedPublic

Authored by epriestley on Feb 18 2016, 1:06 AM.
Tags
None
Referenced Files
F14056766: D15294.diff
Sat, Nov 16, 10:19 PM
F14041641: D15294.id.diff
Mon, Nov 11, 8:12 PM
F13990040: D15294.id36897.diff
Tue, Oct 22, 12:36 AM
F13983491: D15294.diff
Sun, Oct 20, 6:47 AM
Unknown Object (File)
Oct 10 2024, 2:20 AM
Unknown Object (File)
Sep 25 2024, 7:51 AM
Unknown Object (File)
Sep 24 2024, 7:58 AM
Unknown Object (File)
Sep 22 2024, 3:37 PM
Subscribers

Details

Summary

Ref T4245. We pass this exclusively for use by additional third-party hooks.

This is technically a backward compatibility break, but I suspect it doesn't affect anyone:

  • Probably almost no one is using this (there are few reasons to, even for the tiny number of installs with custom commit hooks).
  • If they are, there's a good chance the PHID will work anyway, since nearly all scripts and Conduit methods will accept it in place of a callsign now, and if it's in logging or debugging code the PHID is a reasonable substitute
  • Even if it doesn't just keep working, the break should be very obvious in most reasonable cases.

I'll call this out explicitly in the changelog, though -- almost everything else will just continue working, but this is a strict compatibility break.

Test Plan
  • Ugh.
  • Picked a hosted Git repo out of Diffusion.
  • Went to the path on disk.
  • Went into hooks/.
  • Went into pre-receive-phabricator.d/.
  • Wrote this hook and gave it chmod +x:
stuff.sh
#!/bin/sh

echo $PHABRICATOR_REPOSITORY >> /tmp/stuff.log
  • Pushed to the repository.
  • Saw a PHID show up in the log:
$ cat /tmp/stuff.log
PHID-REPO-bqkcdp47euwnwlasrsrh

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Pass repository PHID to custom hooks in PHABRICATOR_REPOSITORY instead of callsign.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
avivey added a reviewer: avivey.
avivey added a subscriber: avivey.

lgtm.

This revision is now accepted and ready to land.Feb 18 2016, 1:08 AM

Plausible reason #4 is:

  • Many things you might want to do with custom commit hooks can be done more flexibly with custom Herald fields or actions now, anyway.
This revision was automatically updated to reflect the committed changes.