Webhooks not triggered when git_ref_pattern is empty space

Bug #2073978 reported by Ines Almeida
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

Context:
Launchpad added a feature where when a `git_ref_pattern` is added to a webhook, then that webhook only triggers when the pattern matches the git refs/branches associated with what event triggered the webhook.

Bug description:
When a user sets the `git_ref_pattern` to an empty white space, the webhook will not trigger because the pattern doesn't match. This is quite confusing for a user, because they won't even see a message warning them.

To reproduce:
 - Create a new webhook for a git repository that has a `git_ref_pattern=" "` with scope "Git push"
 - Push a change to a branch in that repository
 - The webhook is not triggered

Possible solutions:
 1) Add validation to the input - we shouldn't allow a white-space as a git-ref-pattern
 2) Or, allow white-spaces, but sanitize the pattern on input by removing white spaces around on submit

Tags: trivial
tags: added: trivial
Changed in launchpad:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Jürgen Gmach (jugmac00) wrote :

I am all for 1) - do not allow invalid data to enter our systems.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.