Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 563814

Summary: gentoo news pre-receive hook is obtuse
Product: Gentoo Infrastructure Reporter: SpanKY <vapier>
Component: GitAssignee: Gentoo Infrastructure <infra-bugs>
Status: CONFIRMED ---    
Severity: normal CC: ulm
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Current hook
updated hook

Description SpanKY gentoo-dev 2015-10-22 16:08:49 UTC
the gentoo news pre-receive hook is not clear at all as to why it's rejecting things.  for example, i was missing ".en" in the filename, but the hook just said "path syntax invalid".   this script needs to be super explicit whenever it rejects a commit.

also, where is the hook code hosted ?  the error message should also include a reference to that for people.

$ git push PR --signed
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 980 bytes | 0 bytes/s, done.
Total 4 (delta 1), reused 0 (delta 0)
remote: ./hooks/pre-receive.gentoo-news: errors in commits
remote: Path syntax invalid: 2015-10-22-gcc-5-new-cxx11-abi/2015-10-22-gcc-5-new-cxx11-abi.txt
remote:
To git+ssh://git@git.gentoo.org/data/gentoo-news.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git+ssh://git@git.gentoo.org/data/gentoo-news.git'
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-10-25 10:59:59 UTC
Created attachment 415434 [details]
Current hook

I doubt it's hosted anywhere. Attaching the current version copied from git.g.o.
Comment 2 SpanKY gentoo-dev 2015-10-27 01:44:41 UTC
Created attachment 415566 [details]
updated hook

cleaned up a bunch of various issues that pylint caught and clarified the errors
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-10-30 22:54:51 UTC
Looks good to me but I'd rather have robbat2 and/or ulm confirm it. Though personally I thought you'd kill the regexp and instead do hard-parsing with even more detailed error messages.
Comment 4 Ulrich Müller gentoo-dev 2015-11-01 14:49:41 UTC
The clarified error message LGTM.

About the changes related to python syntax, I fear my python skills are not adequate for commenting on them.