Homec4science

Pass repository PHID to custom hooks in PHABRICATOR_REPOSITORY instead of…

Authored by epriestley <git@epriestley.com> on Feb 18 2016, 01:58.

Description

Pass repository PHID to custom hooks in PHABRICATOR_REPOSITORY instead of callsign

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

Reviewers: chad, avivey

Reviewed By: avivey

Subscribers: avivey

Maniphest Tasks: T4245

Differential Revision: https://secure.phabricator.com/D15294

Details

Committed
epriestley <git@epriestley.com>Feb 18 2016, 02:10
Pushed
aubortJan 31 2017, 17:16
Parents
rPH973b8ace8616: Remove dependence on callsigns from `bin/commit-hook`
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH925a0d3d5918: Pass repository PHID to custom hooks in PHABRICATOR_REPOSITORY instead of… (authored by epriestley <git@epriestley.com>).Feb 18 2016, 02:10