Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 510014 - Pre-commit hook for DTD validation in repositories.xml
Summary: Pre-commit hook for DTD validation in repositories.xml
Status: CONFIRMED
Alias: None
Product: Gentoo Infrastructure
Classification: Unclassified
Component: Gentoo Overlays (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Overlays Project
URL:
Whiteboard:
Keywords:
: 513252 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-05-10 23:46 UTC by Pavlos Ratis (RETIRED)
Modified: 2024-04-21 09:11 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pre-commit hook (pre-commit,881 bytes, application/x-shellscript)
2014-05-10 23:46 UTC, Pavlos Ratis (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pavlos Ratis (RETIRED) Gentoo Infrastructure gentoo-dev 2014-05-10 23:46:21 UTC
Created attachment 376674 [details]
pre-commit hook

Hello,

Due to some human errors(mistyping, typos, etc) that happen in repositories.xml and because the file is getting bigger and bigger, I wrote this pre-commit hook that checks repositories.xml based on repositories.dtd[1].

I'd like your feedback and your suggestions for improvements. 

[1] http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/xml/htdocs/dtd/repositories.dtd?revision=1.1&content-type=text%2Fplain

Thanks,
Pavlos
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-01-31 21:32:58 UTC
*** Bug 513252 has been marked as a duplicate of this bug. ***
Comment 2 Sebastian Pipping gentoo-dev 2015-03-30 14:18:33 UTC
I wonder: Wouldn't we need a pre-receive hook or so rather than a (client side) pre-commit hook?
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-05-05 11:59:15 UTC
For the record: for some time already I have enabled XML Schema checks via semaphore CI [1] on the github mirror of the repository [2]. Since the mirror is automatically updated, this covers both pull requests filed against the repository and the commits made to git.g.o.

[1]:https://semaphoreci.com/mgorny/api-gentoo-org/branches/master/
[2]:https://github.com/gentoo/api-gentoo-org/
Comment 4 Florian Schmaus gentoo-dev 2024-04-21 09:11:19 UTC
FWIW, the pre-commit hook could (and probably should) use the `check` Makefile target that is provided in the repository.

In my experience pre-commit hooks have the potential to confuse new contributors. That said, I am more then willing to active a pre-commit hook and see how it works out (as I am usually in favor of pre-commit hooks under the right circumstances).

(In reply to Michał Górny from comment #3)
> [...] Since the
> mirror is automatically updated, this covers both pull requests filed
> against the repository and the commits made to git.g.o.

Right, but is the causing entity, i.e., the author and committer of the offending commit(s), notified that the github CI failed?

Ideally we would have a pre-receive hook that directly notifies the causing entity. Could we maybe get a pre-receive hook for api.git that runs "make check"?