After rolling back to the broker `2.99.0.0` , I'm ...
# pact-broker
é
After rolling back to the broker
2.99.0.0
, I'm able to publish a contract for new pacticipant, so there is probably a bug that have been introduce in later version (cf. https://pact-foundation.slack.com/archives/C9VPNUJR2/p1654006134133589)
b
Ok, I’ve worked out why you had the issue, and why rolling back helped. I recently added the “check for duplicate pacticipants” feature into the new publish contracts endpoint. That meant that the pacticipant that was in your database with a null name was now causing an issue, where as before, it had no side effects.
é
I see some weird entries, if you look for the item after
"name": "web-pro-product-page"
, I have no
name
nor
displayName
but
repositoryUrl
and
mainBranch
.
Under the
_links
object I have items like:
Copy code
{
        "href": "<http://pact.broker.foo/pacticipants/>",
        "title": "Pacticipant",
        "name": null
      },
The one with the
repositoryUrl
probably come from this curl request I use:
Copy code
# Fish Shell function
function pact-set-repo-metadata --description 'Set repo URL and Main branch to a repo' --argument consumer_name

    set PACT_REPO_URL https://(git remote get-url origin | sed -e  's/git@//' -e 's/:/\//' -e 's/.git//')
    set PACT_REPO_MAIN_BRANCH (git rev-parse --abbrev-ref origin/HEAD | cut -c8-)
    curl \
        --verbose \
        --location \
        --request PATCH \
        --header "Content-Type:application/json" \
        --data '{"repositoryUrl": "'$PACT_REPO_URL'", "mainBranch": "'$PACT_REPO_MAIN_BRANCH'"}' \
        $PACT_BROKER_BASE_URL/pacticipants/$consumer_name
end
b
Yes, there was a bug where an update done in a particular way was causing a duplicate pacticipant with a null name to be created. I’ve fixed that, but the bad data is still there. I’ve written some migrations to clean up the bad data, but I’d like to test it on the saas platform before I put it out in oss.
👀 1