Code freeze

On this page 7

A code freeze is a defined period in the software lifecycle during which developers stop merging changes into a release branch or main line, except for explicitly approved fixes. Its purpose is to give testers, release managers and operations staff a stable, unchanging build to verify before it ships to users.

The freeze is a risk-control measure: every change carries a chance of introducing a defect, so limiting change near a release reduces the number of unknowns. It is closely related to, but stricter than, a feature freeze, and it usually precedes the publication of a release candidate or the final general availability build.

How a code freeze works in a release process

A code freeze works by changing the rules for accepting commits at a planned date. Before the freeze, any change that passes review and automated tests may merge. After the freeze begins, a change may merge only if it fixes a release-blocking defect and has been approved by a designated owner, often called a release manager or a change advisory group.

Teams typically enforce the freeze with branch protection rules, required approvals or a dedicated release branch cut from the main line. Cutting a branch lets ordinary development continue on the main line while the frozen branch receives only cherry-picked fixes. Without a separate branch, the whole team must pause merging, which is simpler but more disruptive.

The following table shows the typical phases around a freeze and what each phase allows.

PhaseWhat may changeMain activity
Open developmentFeatures, refactoring, fixesBuilding new functionality
Feature freezeFixes and polishing of existing featuresCompleting and stabilizing scope
Code freezeOnly approved critical fixesRegression testing and verification
Release candidateOnly fixes for blocking defectsFinal acceptance testing
Release and thawNormal rules resumeDeployment and next cycle
Release phases around a code freeze

Types and strictness levels of code freezes

Code freezes vary in scope and strictness, and the right level depends on the cost of a failed release. A soft freeze discourages risky changes but still allows low-risk fixes with ordinary review, whereas a hard freeze blocks everything except documented emergency fixes.

VariantRuleTypical use
Soft freezeLow-risk fixes merge with normal reviewFrequent web releases
Hard freezeOnly approved release blockers mergePackaged software and firmware
String freezeNo changes to user-visible textProjects that need translation time
API freezeNo changes to public interfacesLibraries and platform releases
Change freezeNo production deployments at allPeak retail seasons and holidays
Freeze variants and typical use

The change freeze deserves a separate note. It applies to production infrastructure and deployments rather than to source code, and organizations often impose one during high-traffic periods such as the end of the financial year or major shopping events, when an outage would be especially costly.

A code freeze is one of several controls that shape the release cycle, and it is often confused with its neighbors. The key distinction is what is restricted: scope, code, deployment or exposure to users.

PracticeWhat it restrictsTypical timing
Code freezeAll code changes except approved fixesDays to weeks before release
Feature freezeNew features, not fixesWeeks before release
Release candidateMarks a build considered shippableAfter freeze, before final release
Feature flagExposure of finished code to usersContinuous, independent of releases
HotfixNot a restriction but an urgent changeAfter release, often during a freeze
Comparison with related practices

Feature flags and trunk-based development reduce the need for long freezes, because unfinished work can be merged in a disabled state. Teams practicing continuous delivery often replace a formal freeze with a short stabilization window or rely entirely on automated tests and progressive rollout.

Planning and running an effective freeze

An effective code freeze starts with a published date and clear exception criteria. Developers need to know in advance when merging stops, what counts as a release blocker and who approves exceptions. Ambiguity leads to a last-minute rush of large changes, which is exactly the risk the freeze is meant to avoid.

  • Announce the freeze date at the start of the release cycle and repeat it as the date approaches.
  • Define a release-blocker severity in writing, for example data loss, security flaws or crashes in core workflows.
  • Require every exception to reference a tracked defect and pass the full regression suite.
  • Keep the freeze as short as verification allows, typically a few days for web services and one to several weeks for packaged software.
  • Record exceptions so the team can review them in the retrospective.

Duration depends on release frequency and testing effort. A product shipped weekly with strong automation may freeze for hours, while an operating system or embedded firmware release with manual certification may freeze for a month or longer.

Risks and common mistakes with code freezes

Freezes reduce release risk but create their own costs. The most common is the pre-freeze rush, in which developers merge large, insufficiently tested changes just before the deadline, so the freeze period begins with more instability rather than less.

Long freezes also produce merge debt: work continues on other branches, and when the freeze lifts, many changes merge at once and conflict. Excessive exceptions quietly turn a hard freeze into no freeze at all, which gives a false sense of safety.

ProblemLikely causeRemedy
Instability at freeze startLast-minute merging of large changesSet an earlier feature freeze
Painful merges after releaseLong freeze with parallel workCut a release branch and keep main open
Too many exceptionsVague blocker criteriaDefine severity levels in writing
Idle developersWhole team blocked from mergingShift effort to tests and next-cycle work
Problems, causes and remedies

Understanding it simply

Think of a theater company a few days before opening night. The script is final, and the actors stop rewriting scenes so they can rehearse what they already have. Only a serious problem, such as a broken prop, gets fixed.

A code freeze is the same idea for software. The team stops making changes so it can check the finished product carefully. Fewer changes mean fewer new surprises right before people start using it.

Applied in practice

An online retailer plans a major checkout update to launch three weeks before its busiest shopping weekend. The engineering lead announces a code freeze ten days before launch on a dedicated release branch, while ordinary development continues on the main line.

During the freeze, testers run the full regression suite and a load test at three times normal traffic. They find two defects: a rounding error in tax calculation and a slow database query. Both are classified as release blockers, fixed, approved and cherry-picked into the branch. A request to add a new promotional banner is rejected and scheduled for the next cycle.

The update launches on time, and the company then imposes a production change freeze across the peak weekend. The result is zero checkout incidents during the period with the highest revenue of the year.