Details
-
Bug
-
Status: Done
-
High
-
Resolution: Fixed
-
5.4.10
-
None
-
None
-
Sprint 40
-
0.7
Description
When adding a new repo-specific hook, the JSON config that gets posted to the REST endpoint identifies the applicable repo by its slug. We then use the RepositoryService to determine the numerical ID of the repo, and overwrite the slug with the (stringified) ID in the JSON before persisting it.
However, if no repo with the given slug is found in the given project, then the overwriting step is skipped, and so the slug is left in the config as a slug rather than as an ID. When we come to fetch the hook configs again, however, we assume that any repos will always be identified by ID, so we perform an unconditional cast to Integer which of course fails when attempted on a non-numerical slug.