Uploaded image for project: 'SR for Bitbucket - Development'
  1. SR for Bitbucket - Development
  2. SRBITB-380

Repo slug doesn't always get replaced with numerical ID when saving hook config

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • High
    • Resolution: Fixed
    • 5.4.10
    • 5.4.29
    • 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.

      Attachments

        Activity

          People

            rgiddings Robert Giddings
            jchoules Joanna Choules
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: