pact-foundation / pact_broker

Enables your consumer driven contracts workflow
http://pactflow.io
MIT License
701 stars 171 forks source link

Truncate tags in UI when they're super long #397

Open bethesque opened 3 years ago

bethesque commented 3 years ago
Screen Shot 2021-02-26 at 4 45 55 pm
stephenwang1011 commented 3 years ago

I think I have the same issue image And my tag should be branch name 'dev' or 'master', but I got : build_41ofunga01amk6uvqsfp2h9hs$_run_closure14$_closure28$_closure29$_closure31@f13450a

bethesque commented 3 years ago

The broker isn't making up that text! I'd have a look at the code that is setting your tag in the provider configuration.

stephenwang1011 commented 3 years ago
pact {
    broker {
        pactBrokerUrl = System.getenv("PACT_BROKER_URL")
        pactBrokerUsername = System.getenv("PACT_BROKER_USERNAME")
        pactBrokerPassword = System.getenv("PACT_BROKER_PASSWORD")
    }

    reports {
        defaultReports()
        markdown
    }

    serviceProviders {
        NeuronPublic {
            providerVersion = { System.getenv("CIRCLE_SHA1") }
            providerTag = { System.getenv("CIRCLE_BRANCH") }
            protocol = 'http'
            host = 'xx-api-qa.xx-xx.com'
            port = 80
            path = '/'
            requestFilter = { req ->
                req.addHeader('testmode', 'true')
                req.addHeader('X-Authorization', 'Bearer ' + System.getenv("PACT_REQUEST_TOKEN"))
            }

            fromPactBroker {
                selectors = latestTags('dev')
                stateChangeUrl = url('http://xx-api-qa.xx-xx.com/api/pact/providerState')
                stateChangeUsesBody = true
                stateChangeRequestFilter = { req ->
                    req.addHeader('testmode', 'true')
                    req.addHeader('X-Authorization', 'Bearer ' + System.getenv("PACT_REQUEST_TOKEN"))
                }

            }
        }
    }
}

And my current provider branch is 'dev', so I think the tag should be 'dev', it worked fine before

stephenwang1011 commented 3 years ago

JDK11 image

stephenwang1011 commented 3 years ago

$ ./gradlew -d pactverify -Ppact.verifier.publishResults=true **-Dpact.provider.tag=Test2**

I used 'pact.provider.tag' instead . My issue was fixed! Thanks