Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for publishing pacts with branches #749

Closed
bethesque opened this issue Sep 29, 2021 · 6 comments
Closed

Add support for publishing pacts with branches #749

bethesque opened this issue Sep 29, 2021 · 6 comments

Comments

@bethesque
Copy link
Member

bethesque commented Sep 29, 2021

Feature description

Support publishing pacts with branches and a build_url. This may not be necessary if the js "wrapper" bit of the publishing is being removed, but thought I'd raise it anyway for discussion.

Use case

See https://github.com/pact-foundation/docs.pact.io/blob/feat/deployments-and-releases/website/blog/2021-07-04-why-we-are-getting-rid-of-tags.md

Details

  • To the user facing Pact API, add:
    • String branch
    • String buildUrl
    • Boolean autoDetectVersionProperties
  • Pass the new properties through to the pact-ruby-standalone publish command as:
    • branch as the --branch property
    • buildUrl as--build-url
    • autoDetectVersionProperties as --auto-detect-version-properties only if autoDetectVersionProperties is true
  • To verify that this is working:
    • publish a pact with a branch to a Pact Broker version 2.86.0+
    • Open the index page
    • Click on the integration
    • You should see the pact that you have just published with a branch slug next to the consumer version number
    • The build URL is currently only used in the webhook - as long as you can see it being passed through to the CLI, this should be sufficient.
@TimothyJones
Copy link
Contributor

I like this. Also, maybe we should implement getBranchFromGit: true | false, which will just defer to git

@bethesque
Copy link
Member Author

You mean like this?

method_option :auto_detect_version_properties, hidden: true, type: :boolean, default: false, desc: "Automatically detect the repository branch from known CI environment variables or git CLI."

It's hidden at the moment, but I can make it public.

@bethesque
Copy link
Member Author

I've updated the original comment with the auto detect bit, and the build URL which I forgot about.

@bethesque
Copy link
Member Author

Appreciate all the movement on the branch issues. Have someone asking about this one.

@mefellows
Copy link
Member

Update on this issue. We haven't added support to the JS code for publishing yet, with a general recommendation toward using the CLI. This work can still be picked up.

@mefellows
Copy link
Member

Closing, the CLI is the target and we've had no complaints / feedback on this for almost 2 years.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants