Viet Anh Tran
02/16/2023, 2:14 AMenvironment in Pactflow. So at our company, we have a quite a few different environments like dev, staging and production and within each of these, we have sub-env like a few dev farms used by devs, production us production eu. When adding can-i-deploy and record-deployment we are wondering whether which of these is a better approach:
• Create seperate environment that replicates all the envs that we have and ensure that we run can-i-deploy and record-deployment for each of them
• Only check can-i-deploy to production and record-deployment for production with the reason being production is the final destination in our deployment process so as long it is safe to deploy the changes to production that it algood.
What are your thoughts on these two. I am leaning more towards the second options since it is simpler and can give us same amount of safety. Thank you 👍Timothy Jones
02/16/2023, 3:38 AMcan-i-deploy, record-deployment etc)Timothy Jones
02/16/2023, 3:39 AMViet Anh Tran
02/16/2023, 3:47 AMyour pipeline would know which environment it is deploying toyes it does know which environment it is deploying to. So on branch, we deploy only to development and on master we deploy to development, staging and production
Is it really simpler to have custom config for production only?so it is simpler in the sense that we would only need to check can-i-deploy once for production cause as long as it works for production, it should give us enough confidence. Otherwise we would need to do can-i-deploy and record-deployment for every single environment when we mainly care about production
Timothy Jones
02/16/2023, 4:53 AMif( env == "production")Viet Anh Tran
02/16/2023, 5:05 AMViet Anh Tran
02/16/2023, 5:06 AMpact publish => can-i-deploy to production => if yes, deploy to development env (we dont record deployment here)Timothy Jones
02/16/2023, 5:06 AMViet Anh Tran
02/16/2023, 5:07 AMpact publish => can-i-deploy to production => if yes, deploy to all envs => once production deployment is done => record deployment for productionTimothy Jones
02/16/2023, 5:07 AMTimothy Jones
02/16/2023, 5:08 AMif( condition ) then fail but ideally no / few other branches.Timothy Jones
02/16/2023, 5:09 AMdeploy to all envs be deploy to production in your example?Viet Anh Tran
02/16/2023, 5:09 AMdeploy to all envs covers our production deployment as well since any merge to master, we would want to keep all envs (dev, staging, and production) up to dateTimothy Jones
02/16/2023, 5:11 AMViet Anh Tran
02/16/2023, 5:11 AMTimothy Jones
02/16/2023, 5:11 AMTimothy Jones
02/16/2023, 5:12 AMTimothy Jones
02/16/2023, 5:12 AMTimothy Jones
02/16/2023, 5:13 AMViet Anh Tran
02/16/2023, 5:15 AMUsually, dev and staging are newer than productionyeap I get your point. For us though, we got a thing called branch preview so any commit on branch is deployed and any deployed from master to development does not overwrite any of the branch preview - devs can still continue to check their changes on branch preview without getting affected by merge to master
Timothy Jones
02/16/2023, 5:17 AMViet Anh Tran
02/16/2023, 5:17 AMTimothy Jones
02/16/2023, 5:18 AMTimothy Jones
02/16/2023, 5:19 AMcan-i-deploy in that caseTimothy Jones
02/16/2023, 5:19 AMTimothy Jones
02/16/2023, 5:19 AMTimothy Jones
02/16/2023, 5:20 AMdev(main) or staging(main)Timothy Jones
02/16/2023, 5:20 AMcan-i-deploy give them a warning, but not stop deployment, maybeViet Anh Tran
02/16/2023, 5:20 AMcan-i-deploy to branch to check if it is safe to deploy to production - mainly as a sanity check before we merge the branch to master because we don’t want a scenario that pipeline only breaks because can-i-deploy fails in productionViet Anh Tran
02/16/2023, 5:21 AMYou might want to haveyeap fully agree 👍 I was typing the above reply so didnt see yoursgive them a warning, but not stop deployment, maybecan-i-deploy
Viet Anh Tran
02/16/2023, 5:21 AMTimothy Jones
02/16/2023, 5:22 AMdev(main) and staging(main) are actually production. But if this is what everyone expects, then I guess it’s fineTimothy Jones
02/16/2023, 5:22 AMViet Anh Tran
02/16/2023, 5:23 AMdev(main) and staging(main) are productionish but no real production traffic is hitting itTimothy Jones
02/16/2023, 5:23 AMTimothy Jones
02/16/2023, 5:23 AMViet Anh Tran
02/16/2023, 5:24 AMeg, front ends, where you know the API isn’t available yet, but you want to get someone to look at ityeah good point thinking2
Timothy Jones
02/16/2023, 5:25 AMcan-i-deploy on main
• can-i-deploy on PRs to main
• no checks on branch deploysTimothy Jones
02/16/2023, 5:25 AMTimothy Jones
02/16/2023, 5:25 AMcan-i-deploy in mainViet Anh Tran
02/16/2023, 5:26 AMmerge queueyou mean only once merge at once and next merge can be done only when deployment of previous is finished?
Timothy Jones
02/16/2023, 5:28 AMTimothy Jones
02/16/2023, 5:28 AMViet Anh Tran
02/16/2023, 5:29 AMTimothy Jones
02/16/2023, 5:29 AMViet Anh Tran
02/16/2023, 5:29 AMTimothy Jones
02/16/2023, 5:29 AMTimothy Jones
02/16/2023, 5:30 AMTimothy Jones
02/16/2023, 5:31 AMTimothy Jones
02/16/2023, 5:31 AMViet Anh Tran
02/16/2023, 5:32 AMViet Anh Tran
02/16/2023, 5:33 AMViet Anh Tran
02/16/2023, 5:33 AMTimothy Jones
02/16/2023, 5:42 AMBeth (pactflow.io/Pact Broker/pact-ruby)
Viet Anh Tran
02/17/2023, 12:34 AM