Hey all, looking for some guidance on getting rid ...
# pact-broker
m
Hey all, looking for some guidance on getting rid of stale deployments in the pipeline. Saw some relevant info around how to approach branching, environments and deployments, but I'm stuck with old versions showing on pactflow ui. We follow this approach currently: - pre-merge * run pact publish, use the PR branch and version variables (git sha for version) * once deployed to a testing env, call record-deployment to change the environment (testing) - post-merge * run pact publish, use the master branch and version (git sha changed after squash and merge) * once deployed to prod, call record-deployment to change the environment (prod) this ends with 2 active contracts showing on the pactflow ui, one for master, one for a now-redundant branch which is deleted post squash-and-merge. Is there something I'm missing to auto trigger a contract undeployment (though version and branch will be different on master) or is it a manual step to be taken, if so, what's the best approach? Thanks!
y
Hey Milda,
this ends with 2 active contracts showing on the pactflow ui,
What do you mean by active contracts? I assume reading your description you have 2 environments, test and prod. you have different commit shas for both versions, but the contents are the same. record-deployment undeploys any versions in that environment but does not delete the contract from PactFlow ui/matrix
also pre merge, are you deploying all pr’s to a test env, or pre merge are you deploying to a test env, if that succeeds you merge and then publish/deploy to prod?
m
I see, that's a great distinction! Is there a way to hide those from the pactflow ui? Basically, looking at the overview of a particular integration, there is a lot of information that is outdated
and yes - all PRs get deployed to the test envs (multiple PRs can be on the same env name but spun up in different containers), then if that succeeds and the PR is merged, the contract gets published again from the master branch and goes through the rest of the pipeline to go to prod
including calling record-deployments on the envs
y
i think the matrix view with filters might suit rather than the overview page ( which i think is ordered by latest contracts )
m
I see, thank you for that
will keep to the matrix for now- would be great to be able to filter the overview page, too, at some point πŸ™‚
y
also ephemeral prs deployed to a test env - very nice. i would recommend dropping an issue in our pactflow roadmap if you have the time https://github.com/pactflow/roadmap/issues
βœ… 1
πŸ‘Œ 1
m
I absolutely will, thanks very much for your help!
m
Thanks for the feedback @Milda - there are a few pathways here
βœ… 1
b
What version is left in test once the prod deployment is done?
ie. is the problem that Pactflow is not reflecting reality (ie. what is deployed where) or is the problem that displaying the reality is confusing/not helpful?
@Milda
m
hey Beth, so the confusing thing is that the overview continues showing PRs that have been merged. Because there are 2 contracts published in the development cycle, one for PR branch and one for master branch, the master branch will always update to the most recent one, which is correct and what we want, but the PR branches are left hanging in the dashboard and are cluttering the view. Ideally we would only want to see PR branches that have not yet been merged to master (but have published a contract), and the master branch, and NOT show the PR branches that have already been merged to master (as they will never be used again - that branch is deleted).
πŸ‘πŸΌ 1
hope that makes sense!
b
Yes - totally. You want the branches for merged PRs to be deleted in Pactflow. This is on our road map for when we create integrations with GitHub/BitBucket etc.
πŸ‘ 2
cc: @Matt (pactflow.io / pact-js / pact-go)
πŸ‘ 1
m
great to hear it's on the roadmap! is there a ticket for it somewhere I could keep an eye on?
m
It’s under this item, albeit that is not super obvious: https://github.com/pactflow/roadmap/issues/45
βœ… 1