vercel-labs / blue-green Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://blue-green.vercel.app/
Home Page: https://blue-green.vercel.app/
Hi Vercel Team,
Thank you for providing this template! We've gone through the official detailed guide and got an unexpected behavior. Hopefully you'll be able to bring a little more clarity to it.
Here are the steps we've performed:
After configuring the template:
Finally, we've made changes to edge config:
{
"blue-green-configuration": {
"deploymentDomainBlue": "bg-deployment-kpta06k8s-xxx.vercel.app",
"deploymentDomainGreen": "bg-deployment-dvlhqub4s-xxx.vercel.app",
"trafficGreenPercent": 50
}
}
Now, according to the guide, that should be it - green deployment is still staged, but we've already started splitting the traffic.
Expected result:
Observed result:
And the most curios thing is
What we've also learned
PS:
We will appreciate you can clarify this behavior and let us know how to make this schema work like it is described in the guide, or let us know if there is smth that is slipping away from us.
Thanks in advance!
Alex
Hi Vercel Team,
While adopting blue-green template for production use we've faced the difference in the behavior for blue and green deployments in regards to geolocation detection.
Adding a simple logic application level middleware logic for getting geolocation fetching from request object:
function runDownstreamApplicationMiddlewareLogic(req: NextRequest, res: NextResponse) {
const country = req.geo?.country || '';
console.log(`GEO_COUNTRY:${country}`);
const response = NextResponse.next();
response.cookies.set("geo_country", country);
return response;
}
Expected result:
Observed result:
Please find the branch showing the full sample: https://github.com/ashishagin/bluegreen/pull/1/files
Do you have any recommendations on how to forward location to the override deployment, so that we keep using the OOB interface for reading NextRequest geo object (without a need to patch every such entry with custom logic)?
We've tried setting headers.set("x-vercel-ip-country", req.geo?.country || '');
before fetching override deployment - it did not help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.