#3978 Make it possible to create hooks that don't have DB entries
Merged by pingou. Opened by bkabrda.
bkabrda/pagure non-model-hooks  into  master

Download 3978.patch

This makes it possible to add hooks that don't have an associated DB model and form and get executed based on a dynamic criteria evaluated in the is_enabled_for method. It's also not possible to turn these off through project settings.

Fixes #3972

This doesn't seem to be used anywhere with without_backref = True, is this only here for future needs?

Should we already port the default plugin to this structure?

Yes, that's for future use. I also consider this to be useful even if the argument is never used, because people working on stuff using this function will (just by seeing the argument) realize that this function will not return hooks without backref by default.

Should we already port the default plugin to this structure?

Yeah, I can do that.

rebased onto ca93d34a907aa83de8a22711c7993c4115eb597c

@pingou done and ready for re-review.

Should we check while at it that it appears in test's plugins?

Should we check while at it that it appears in test's plugins?

Probably a good idea. Will do :)

2 new commits added

  • Make the default hook be active all the time on all projects
  • Make it possible to create hooks that don't have DB entries. Fixes #3972

note assertEqual?

Is the default plugin returned twice then? Shouldn't it be (if I read the code correctly)

2 new commits added

  • Make the default hook be active all the time on all projects
  • Make it possible to create hooks that don't have DB entries. Fixes #3972

Is the default plugin returned twice then? Shouldn't it be (if I read the code correctly)

Nope, it's returned just once. I adjusted the test to check that (using assertEqual).

rebased onto 370e678ae41da49693ad5cfe10c23aba371e87c1

Looks good to me, let's fix Jenkins and get this in :)

2 new commits added

  • Make the default hook be active all the time on all projects
  • Make it possible to create hooks that don't have DB entries. Fixes #3972

Pretty please pagure-ci rebuild

Pull-Request has been merged by pingou

Metadata