October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Microservices Part 5: Preview a Branch and Roll Back

Preview all three Bean There services on a Light Cloud branch, configure their URLs and browser origins, check data targets, and distinguish production rollback from a source-control revert.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

In the Bean There shop example, a Git branch deploys preview environments for the catalog API, orders API, and web app on Light Cloud. To preview a feature across all three, point the branch services at one another and check their environment variables—but first confirm where their data goes. This example’s preview still uses the production database, so it is not safe for test orders. If a production deployment goes wrong, Light Cloud can serve an earlier deployment’s code; that does not revert the commit or undo database changes.

What a branch preview deploys

This workflow assumes the Bean There apps from Parts 1–4 are already deployed from a fork. The tutorial adds a stock_status field in catalog-api, then pushes a feature branch. In the described Light Cloud setup, creating the branch creates an environment for each of the three apps, including services whose folders did not change. Later pushes redeploy only apps with changed folders.

As an Amazon Associate I earn from qualifying purchases.

That gives you preview URLs for the catalog API, orders API, and web app. A URL alone does not mean the preview is isolated: each app’s environment-variable values determine which services, origins, and data stores it uses.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Connect the branch apps for a full feature preview

For an API-only check, the branch’s default variables may be enough to test an endpoint with curl. To test the full browser flow, configure the branch environments to route requests among the branch versions rather than production.

  1. In the Light Cloud dashboard, open the branch environment for the web app and set its catalog and orders API URL variables to the respective branch API URLs. The tutorial describes these as the web app’s VITE_* URLs.
  2. Open the branch environment for the orders API and set its catalog API URL to the branch catalog API URL.
  3. In both branch API environments, set WEB_ORIGIN to the branch web app’s preview URL so browser requests from that origin are allowed.
  4. Save the variables in the branch environments, then reload the preview and test the intended flow.

Keep these changes in the branch environments. Changing production variables is unnecessary for this preview and could redirect production traffic.

Check data targets before testing writes

The tutorial’s example branch catalog API initially points to the production database; its orders API calls the production catalog API, and the web preview calls production APIs until its URLs are changed. Even after routing the apps to branch URLs, the described setup still shares the production database. The tutorial explicitly warns not to place orders in the preview.

Before exercising any write action, verify the database and other external-service targets used by every branch service. Branch-specific service URLs do not by themselves establish that persistent data or connected services are isolated.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Check Branch-preview configuration What the example warns about
Web app service URLs Set the branch web app’s catalog and orders API URLs to branch API URLs. Defaults can still point to production APIs.
API-to-API URL Set branch orders API to call branch catalog API. The initial orders API calls production catalog.
Allowed browser origin Set each branch API’s WEB_ORIGIN to the branch web URL. An API allowing only the production web origin can reject preview requests.
Database target Verify the target before any writes. The tutorial’s branch catalog API uses the production database; the preview is not data-isolated.

Use pull-request previews for review

After you open a pull request, the tutorial says Light Cloud posts a preview link for each app and adds a deployment readiness check per app. Reviewers can open the links without access to the Light Cloud console. This makes it possible to review the web app and APIs through their preview URLs, provided their routing and data targets are appropriate for the tests being performed.

After the branch is merged and deleted, the changed services redeploy and the three branch environments disappear, according to the demonstrated workflow.

Roll back a bad production deployment

Rollback addresses the deployed application version, not the entire state of a system. In the tutorial, the author introduces a faulty price conversion on main, then opens the catalog API’s Production > Deployments tab in Light Cloud and rolls back to the previous good deployment.

  1. In Light Cloud, open the affected app’s production environment and go to Deployments.
  2. Choose the earlier known-good deployment and select the rollback action.
  3. Review the confirmation details before confirming. The tutorial says rollback serves the selected earlier code without rebuilding, leaves current environment variables unchanged, and does not undo database changes made since that deployment.

For the tutorial’s catalog API test, Julia reports that rollback took 13 seconds, compared with about 70 seconds for a normal deploy in that example. These are author-reported timings, not a performance guarantee or independent benchmark.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Repair the commit after rollback

Rolling back the deployment does not remove the faulty commit from main. The tutorial follows the rollback by reverting the bad commit and pushing that revert. The distinction matters: rollback changes which deployed code is being served, while the follow-up revert repairs the branch’s source history so a later deployment does not simply reintroduce the fault.

Best Value
Linux Server Joke Computer Scientist software developer Hardcover Journal, Black
  • You are a software developer, coder or system administrator or just a hobby programmer? Then wear it with the Linux Server Joke Computer Scientist software developer design.
  • You are looking for a programmer gift for a friend or colleague who is a system administrator? With the Linux Server Joke Computer Scientist software developer motif you have found the perfect gift idea e.g. as a coder shirt for hackers.
  • Hardcover journal with 240 line-ruled pages (120 sheets)
  • Built-in elastic closure and ribbon bookmark
  • Includes an expandable inner storage pocket and a pen holder

Troubleshoot a branch preview

The preview shop shows production data, not my change

Check the branch web app’s VITE_* API URL variables. If they still contain production URLs, the web preview continues to request production APIs. Set them in the branch web environment to the branch API URLs, and confirm the branch APIs are also routed to one another. Separately verify the database target: changing service URLs does not make the example’s production database branch-specific.

The preview shop shows a CORS error

Check WEB_ORIGIN in each branch API environment. The tutorial attributes this failure to APIs allowing only the origin configured there; add the branch web app’s preview URL to the branch API configuration. Make the adjustment in the branch environment rather than production.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.