Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] Commit Validation

How would you go about that? Make it possible to hook java code into the JGit hook infrastructure? How? How would results bubble up to CommitJob?

Cheers,
Markus

> -----Ursprüngliche Nachricht-----
> Von: Andrey Loskutov [mailto:loskutov@xxxxxx]
> Gesendet: Montag, 9. März 2015 10:18
> An: Duft Markus
> Cc: EGit developer discussion (egit-dev@xxxxxxxxxxx)
> Betreff: Aw: AW: AW: AW: [egit-dev] Commit Validation
>
> Unfortunately (due the time constraints) I haven't followed the most recent j/egit hooks implementation patches, but I'm
> wondering if you can contribute/add another one "hook" (implemented in Egit/Java) via API/extension point?
>
> The reason why I'm thinking in the "hook" direction is that IMHO you want more or less the same as the "standart" hooks
> want, but you want to have it in the IDE only. If the j/egit hooks API would allow such extensions, probably everyone will
> be happy. From the user point of view it is also beneficial to have "nice" explanation why commit wasn't allowed
> (independently of the underlined implementation), and from egit point of view it would be weird if we would present this
> in two different ways (one for "hooks", another one for "validators"). It would be nice to have "consistent" way of showing
> reasons why commit was rejected (by either hook or validator).
>
> Kind regards,
> Andrey Loskutov
>
> http://google.com/+AndreyLoskutov
>
>
> > Gesendet: Montag, 09. März 2015 um 09:31 Uhr
> > Von: "Duft Markus" <Markus.Duft@xxxxxxxxxxxxxxxx>
> > An: "Andrey Loskutov" <loskutov@xxxxxx>
> > Cc: "EGit developer discussion (egit-dev@xxxxxxxxxxx)" <egit-dev@xxxxxxxxxxx>
> > Betreff: AW: AW: AW: [egit-dev] Commit Validation
> >
> > Hey,
> >
> > No, I'm unfortunately not able to use scripts. It is perfectly OK if this is a IDE only thing (intentional - EGit is an IDE thing
> only also; I don't want to have it in JGit, but EGit). We have a very heterogenous environment with many Linux, Window,
> AIX, HP-UX, Solaris (not all of them use EGit right now, but who knows ;)) boxes, so scripting is not good idea just because
> of portability. Also we already have a lot of code to validate commits as we do it on Gerrit side already in Java. Yet having
> the feedback only after pushing to Gerrit is "too late", as the developer already 1) published, so he feels bad because he
> did something wrong (minor issue ;)), 2) the commit is already in the repo and will be there for all time (our repo is already
> large enough - no need to keep all the commits people make with just some minor problems in the message :|. I know that
> delta compresses the hell out of such things, but still: a few bytes a few hundred thousand times... it's something)
> >
> > We want to catch these things early. It's not a problem if it's not waterproof, especially wrt CLI, because that's not used at
> all here - we have a clear setup per developer, and that is based on Eclipse & EGit. I know that there are /some/ people
> here that use the CLI undercover (hehe), but they are mostly not the problem.
> >
> > We're (especially on the infrastructure side) not yet at J8. We're just glad that we were able to  get rid of java 5 & 6
> recently ;)
> >
> > Cheers,
> > Markus
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Andrey Loskutov [mailto:loskutov@xxxxxx]
> > > Gesendet: Montag, 9. März 2015 09:22
> > > An: Duft Markus
> > > Cc: EGit developer discussion (egit-dev@xxxxxxxxxxx)
> > > Betreff: Aw: AW: AW: [egit-dev] Commit Validation
> > >
> > > Hooks are CLI based programs, so they are usually scripts.
> > >
> > > If you mean "Java hooks" you most likely mean "Java hooks *in IDE*", and this clearly limits the use of this to the IDE
> only.
> > > All CLI users aren't going to see anything. A simple "git commit -a; git push" will break any of your validation rules in
> IDE...
> > > For my organisation this would be a clear "showstopper".
> > >
> > > The question is: can you use scripts for your validation? The task would be to interpret the script errors in the IDE in a
> "nice"
> > > way.
> > > Why do you need Java for this validation? BTW if you are using Java 8 you can try to use "javascript -> Java" bridge and
> write
> > > your shell scripts in javascript with full Java API power [1].
> > >
> > > Regarding hooks: see for example current pending reviews:
> > > https://git.eclipse.org/r/43044
> > > https://git.eclipse.org/r/35791
> > >
> > > Also please check bugzilla for "hooks" in jgit/egit projects.
> > >
> > > [1] http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/
> > >
> > > Kind regards,
> > > Andrey Loskutov
> > >
> > > http://google.com/+AndreyLoskutov
> > >
> > >
> > > > Gesendet: Montag, 09. März 2015 um 08:19 Uhr
> > > > Von: "Duft Markus" <Markus.Duft@xxxxxxxxxxxxxxxx>
> > > > An: "Andrey Loskutov" <loskutov@xxxxxx>
> > > > Cc: "EGit developer discussion (egit-dev@xxxxxxxxxxx)" <egit-dev@xxxxxxxxxxx>
> > > > Betreff: AW: AW: [egit-dev] Commit Validation
> > > >
> > > > Are pre-commit hooks java code-able, or is it scripts? I definitely need something I can code with java... If it is, i'd
> > > definitely look into them - can you give me a starting point?
> > > >
> > > > Cheers,
> > > > Markus
> > > >
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: Andrey Loskutov [mailto:loskutov@xxxxxx]
> > > > > Gesendet: Montag, 9. März 2015 08:10
> > > > > An: Duft Markus
> > > > > Cc: EGit developer discussion (egit-dev@xxxxxxxxxxx)
> > > > > Betreff: Re: AW: [egit-dev] Commit Validation
> > > > >
> > > > > Have you considered to use (and extend) pre-commit hooks, which are now available? This would be *my*
> preferred
> > > > > solution.
> > > > > They are often used exactly for that purpose you want to have your validators, but also work on the command line
> or
> > > with
> > > > > any other UI.
> > > > > What we "just" need is the "nice" representation of the commit warnings/errors in the UI.
> > > > >
> > > > > Kind regards,
> > > > > Andrey Loskutov
> > > > >
> > > > > http://google.com/+AndreyLoskutov
> > > > >
> > > > >
> > > > > > Gesendet: Montag, 09. März 2015 um 07:34 Uhr
> > > > > > Von: "Duft Markus" <Markus.Duft@xxxxxxxxxxxxxxxx>
> > > > > > An: "Andrey Loskutov" <loskutov@xxxxxx>, "EGit developer discussion (egit-dev@xxxxxxxxxxx)" <egit-
> > > dev@xxxxxxxxxxx>
> > > > > > Betreff: AW: [egit-dev] Commit Validation
> > > > > >
> > > > > > Hey,
> > > > > >
> > > > > > Wow, fast ;) I'd put it between commit & push, ofc. Pre-commit would be too early, as there is no commit object
> yet -
> > > > > Matthias and Christian where the opinion (IIRC) that it would be way better to have a commit object to validate,
> instead
> > > of
> > > > > having to search for all things to validate.
> > > > > >
> > > > > > About the soft reset (why does it make you nervous?) - we could also make this an option in the validation result
> > > dialog.
> > > > > >
> > > > > > 1) The result dialog only pops up if there is a warning or error
> > > > > > 2) Available options are "OK" and "Abort" (Soft reset). I'd put an EGit setting whether "OK" is allowed in case there
> are
> > > > > errors.
> > > > > > 3) In case of commit & push we could name the add a button to just prevent pushing and name them differently:
> > > "Abort
> > > > > commit", "Keep commit, abort push", "OK" or so. Ideas?
> > > > > >
> > > > > > The actual reason for this whole thing is (for us) to be able to catch guideline violations early. Everybody here must
> > > add
> > > > > either a request ID or a bug number to the commit message for example, there are some directories where only
> certain
> > > > > files are allowed, etc.
> > > > > >
> > > > > > Thanks for the feedback.
> > > > > >
> > > > > > Cheers,
> > > > > > Markus
> > > > > >
> > > > > > > -----Ursprüngliche Nachricht-----
> > > > > > > Von: Andrey Loskutov [mailto:loskutov@xxxxxx]
> > > > > > > Gesendet: Montag, 9. März 2015 07:22
> > > > > > > An: Duft Markus; EGit developer discussion (egit-dev@xxxxxxxxxxx)
> > > > > > > Betreff: Re: [egit-dev] Commit Validation
> > > > > > >
> > > > > > > What is about commit & push? The validation (and any amend) will be too late.
> > > > > > > I'm wondering if this validation schould be added after/before the "pre-commit" hooks.
> > > > > > > Also the planned commit/soft reset scenario in case of failed checks makes me nerveus.
> > > > > > >
> > > > > > > Am 9. März 2015 07:11:53 MEZ, schrieb Duft Markus <Markus.Duft@xxxxxxxxxxxxxxxx>:
> > > > > > > >Hey,
> > > > > > > >
> > > > > > > >As discussed with some of you the last 2 years of EclipseCon Europe, I
> > > > > > > >now FINALLY have time to start working on a "commit validation"
> > > > > > > >feature. It should be rather simple: After a commit has been done (1),
> > > > > > > >the commit object is passed to a set of registered validators. They may
> > > > > > > >object or not, returning an IStatus. A dialog is presented to the user,
> > > > > > > >showing him a list of validation warnings/errors. In case there are
> > > > > > > >errors, the commit soft-reset, and the commit message get's prefilled
> > > > > > > >with the commits message again.
> > > > > > > >
> > > > > > > >
> > > > > > > >(1)    /After/ the commit because it is way easier to have a look at a
> > > > > > > >commit object and its contents than having to check the whole
> > > > > > > >worktree... we already discussed this @ EclipseCon :)
> > > > > > > >
> > > > > > > >Does that sound like a good idea?
> > > > > > > >
> > > > > > > >I'd need a suggestion on how to register validators in EGit - should I
> > > > > > > >create an extension point, or is there a better EntryPoint (register on
> > > > > > > >repository?).
> > > > > > > >
> > > > > > > >Thanks for any feedback.
> > > > > > > >
> > > > > > > >Cheers,
> > > > > > > >Markus
> > > > > > > >
> > > > > > > >--
> > > > > > > >Mit freundlichen Grüßen / Best regards
> > > > > > > >
> > > > > > > >Markus Duft | Software Architect
> > > > > > > >SSI SCHÄFER | Salomon Automation GmbH | Friesachstraße 15 | 8114
> > > > > > > >Friesach bei Graz | Austria
> > > > > > > >Phone +43 3127 200-575 | Fax +43 3127 200-22
> > > > > > > >markus.duft@xxxxxxxxxxxxxxxx<mailto:markus.duft@xxxxxxxxxxxxxxxx>
> > > > > > > >Website<http://www.salomon.at/> |
> > > > > > > >Blog<http://www.ssi-schaefer.de/blog/> |
> > > > > > > >YouTube<http://www.youtube.com/user/lagerlogistik1> |
> > > > > > > >Facebook<https://www.facebook.com/SSI.SCHAEFER.DE>
> > > > > > > >
> > > > > > > >Salomon Automation GmbH | Friesachstrasse 15 | 8114 Friesach bei Graz |
> > > > > > > >Austria
> > > > > > > >Registered Office: Friesach bei Graz | Commercial Register: 49324 K |
> > > > > > > >VAT no. ATU28654300
> > > > > > > >Commercial Court: Landesgericht für Zivilrechtssachen Graz
> > > > > > > >
> > > > > > > >
> > > > > > > >------------------------------------------------------------------------
> > > > > > > >
> > > > > > > >_______________________________________________
> > > > > > > >egit-dev mailing list
> > > > > > > >egit-dev@xxxxxxxxxxx
> > > > > > > >To change your delivery options, retrieve your password, or unsubscribe
> > > > > > > >from this list, visit
> > > > > > > >https://dev.eclipse.org/mailman/listinfo/egit-dev
> > > > > > >
> > > > > > > --
> > > > > > > Kind regards,
> > > > > > > Andrey Loskutov
> > > > > > >
> > > > > > > http://google.com/+AndreyLoskutov
> > > > > > Salomon Automation GmbH | Friesachstrasse 15 | 8114 Friesach bei Graz | Austria
> > > > > > Registered Office: Friesach bei Graz | Commercial Register: 49324 K | VAT no. ATU28654300
> > > > > > Commercial Court: Landesgericht für Zivilrechtssachen Graz
> > > > > >
> > > > Salomon Automation GmbH | Friesachstrasse 15 | 8114 Friesach bei Graz | Austria
> > > > Registered Office: Friesach bei Graz | Commercial Register: 49324 K | VAT no. ATU28654300
> > > > Commercial Court: Landesgericht für Zivilrechtssachen Graz
> > > >
> > Salomon Automation GmbH | Friesachstrasse 15 | 8114 Friesach bei Graz | Austria
> > Registered Office: Friesach bei Graz | Commercial Register: 49324 K | VAT no. ATU28654300
> > Commercial Court: Landesgericht für Zivilrechtssachen Graz
> >
Salomon Automation GmbH | Friesachstrasse 15 | 8114 Friesach bei Graz | Austria
Registered Office: Friesach bei Graz | Commercial Register: 49324 K | VAT no. ATU28654300
Commercial Court: Landesgericht für Zivilrechtssachen Graz

Back to the top