Page MenuHomePhabricator

herald "Commit Hook: Commit Content" triggers on "git push --tags"
Closed, ResolvedPublic

Description

Steps to reproduce:

  • create a global herald rule, triggering on "Commit Hook: Commit Content", that refuses any push
  • git tag some-tag (or "git tag -a some-tag", doesn't matter)
  • git push --tags

I would expect the above to work, because no content is actually being pushed, but the push is actually refused.

Version information:
phabricator 04db64ca42b7fbea68ef903fd696c2c9b0240988 (Sat, Apr 30)
arcanist 6d175516f54818d02b5fa7d4bc2b290123c3d27f (Sat, Apr 30)
phutil 7178d9dcadfddcdac5474c1a8801d55213df65e5 (Sat, Apr 30)

Event Timeline

I can't reproduce this. Here's what I did. I created this Herald rule:

Screen Shot 2016-05-03 at 8.35.17 AM.png (991×1 px, 156 KB)

I made a commit and pushed it. The rule blocked the commit:

epriestley@orbital ~/dev/scratch/lock1 $ echo a > a && git add a && git commit -m a && git push
[master 7ebc58a] a
 1 file changed, 1 insertion(+)
 create mode 100644 a
# Push received by "local001.phacility.net", forwarding to cluster host.
# Waiting up to 120 second(s) for a cluster write lock...
# Acquired write lock immediately.
# Waiting up to 120 second(s) for a cluster read lock on "local001.phacility.net"...
# Acquired read lock immediately.
# Device "local001.phacility.net" is already a cluster leader and does not need to be synchronized.
# Ready to receive on cluster host "local001.phacility.net".
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 254 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: +---------------------------------------------------------------+
remote: |      * * * PUSH REJECTED BY EVIL DRAGON BUREAUCRATS * * *     |
remote: +---------------------------------------------------------------+
remote:             \
remote:              \                    ^    /^
remote:               \                  / \  // \
remote:                \   |\___/|      /   \//  .\
remote:                 \  /V  V  \__  /    //  | \ \           *----*
remote:                   /     /  \/_/    //   |  \  \          \   |
remote:                   @___@`    \/_   //    |   \   \         \/\ \
remote:                  0/0/|       \/_ //     |    \    \         \  \
remote:              0/0/0/0/|        \///      |     \     \       |  |
remote:           0/0/0/0/0/_|_ /   (  //       |      \     _\     |  /
remote:        0/0/0/0/0/0/`/,_ _ _/  ) ; -.    |    _ _\.-~       /   /
remote:                    ,-}        _      *-.|.-~-.           .~    ~
remote:   \     \__/        `/\      /                 ~-. _ .-~      /
remote:    \____(Oo)           *.   }            {                   /
remote:    (    (--)          .----~-.\        \-`                 .~
remote:    //__\\  \ DENIED!  ///.----..<        \             _ -~
remote:   //    \\               ///-._ _ _ _ _ _ _{^ - - - - ~
remote: 
remote: 
remote: This push was rejected by Herald push rule H72.
remote:     Change: commit/
remote:       Rule: Test T10913
remote:     Reason: Forbidden (T10913)
remote: Transcript: http://local.phacility.com/herald/transcript/19648/
remote: 
# Released cluster write lock.
To ssh://local@localvault.phacility.com/diffusion/26/locktopia.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://local@localvault.phacility.com/diffusion/26/locktopia.git'

I reset to origin/master, removing my local commit:

epriestley@orbital ~/dev/scratch/lock1 $ git reset --hard origin/master
HEAD is now at 707ecc3 D

I made a new tag:

epriestley@orbital ~/dev/scratch/lock1 $ git tag test-tag-T10913

I pushed the tag:

epriestley@orbital ~/dev/scratch/lock1 $ git push --tags
# Push received by "local001.phacility.net", forwarding to cluster host.
# Waiting up to 120 second(s) for a cluster write lock...
# Acquired write lock immediately.
# Waiting up to 120 second(s) for a cluster read lock on "local001.phacility.net"...
# Acquired read lock immediately.
# Device "local001.phacility.net" is already a cluster leader and does not need to be synchronized.
# Ready to receive on cluster host "local001.phacility.net".
Total 0 (delta 0), reused 0 (delta 0)
# Released cluster write lock.
To ssh://local@localvault.phacility.com/diffusion/26/locktopia.git
 * [new tag]         test-tag-T10913 -> test-tag-T10913

Everything worked fine. The push was not blocked by the rule.

epriestley claimed this task.

Per F1256292, presuming resolved until more details surface about what's up.

Grmbl. I cannot indeed reproduce it neither with your example, I'll investigate more what's wrong with my (other) setup, that still doesn't work. I'll reopen if/when I find out what's happening. Sorry for the noise.