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
Unknown Object (File)
Sat, Mar 23, 1:30 AM
Unknown Object (File)
Sun, Mar 10, 3:47 AM
Unknown Object (File)
Sat, Mar 2, 5:13 PM
Unknown Object (File)
Feb 26 2024, 10:01 AM
Unknown Object (File)
Feb 13 2024, 11:03 AM
Unknown Object (File)
Feb 13 2024, 8:57 AM
Unknown Object (File)
Feb 6 2024, 6:48 PM
Unknown Object (File)
Feb 5 2024, 7:32 AM
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.