Home / Companies / Mergify / Blog / July 2026

July 2026 Summaries

10 posts from Mergify

Filter
Month: Year:
Post Summaries Back to Blog
Fast per-test isolation in SQLAlchemy requires each test to run against its own Postgres database, cloned from a template to maintain speed, but a key Postgres rule turned this setup into a 20-minute CI outage. The method involves creating a single template database upfront, from which individual test databases are cloned, allowing for real commit testing and preventing leftover data between tests. This approach bypasses the need for repeated schema setups, saving time. However, a critical issue arose when tests that manipulated connection lifetimes left connections open on the template, causing cloning attempts to fail intermittently and silently. The solution was to ensure the clone path evicts any existing connections from the template, aligning with the teardown process, thereby maintaining test isolation and CI stability. This method, while beneficial for its speed and accuracy in mimicking production environments, requires careful management of database connections and is a responsibility of the developer when using unopinionated tools like SQLAlchemy.
Jul 31, 2026 1,787 words in the original blog post.
The blog post by Alexandre Gaubert discusses the evolution of a no-code config builder for Mergify, highlighting past issues and recent enhancements. Initially, the builder stripped comments and anchors from YAML files during commits, leading to a workaround that excluded anchor-using configurations. The problem was addressed by patching the original document rather than re-dumping it, preserving formatting elements like comments and anchors. During this improvement process, a parser bug was discovered that was silently inverting security conditions, which was fixed by anchoring regex patterns to ensure accurate condition parsing. Recent updates include a raw-YAML editing tab that ensures any unrepresentable rules are flagged as read-only, preventing unintended modifications. The post underscores the importance of patching original documents in place to avoid data loss and emphasizes proactive audits to uncover hidden bugs, illustrating the unintended discovery of a production bug during the enhancement process.
Jul 29, 2026 1,935 words in the original blog post.
Julien Danjou's analysis of merge queues reveals intriguing insights from the 2026 State of Merge Queues report, where 153,000 merges across 160 engineering teams were studied over 90 days. Notably, AI-assisted pull requests (PRs) were found to break the main branch about half as often as those authored by humans, with a rate of 1.9% compared to 4.4%, challenging common perceptions about AI's reliability in code development. The study also highlights that the rate at which the main branch breaks scales significantly with team size, increasing 16-fold as teams grow, with larger teams facing more frequent integration challenges. Furthermore, private codebases were observed to break the main branch 4.5 times more often than open-source projects, likely due to the interdependent nature of private monorepos compared to the isolated contributions typical in open-source work. Despite the efficiency of batching PRs in reducing CI costs and maintaining safety, the practice remains underutilized, with 94% of private merges processed individually. The report suggests that engineering teams should focus on managing large human-authored changes in big teams rather than imposing stricter reviews on AI-assisted code, as the data does not support additional review friction for AI-generated contributions.
Jul 28, 2026 1,240 words in the original blog post.
The migration to TypeScript 7's native Go compiler significantly reduced typechecking time from 13 seconds to 3.5 seconds for a React application with over 244,000 lines of TypeScript, primarily by leveraging parallel processing with a higher core usage. The change required minimal code alterations, as the compiler was almost a drop-in replacement, but maintaining typescript-eslint functionality posed a challenge since TypeScript 7.0 does not include an importable compiler API. This was resolved by installing both the classic and native compilers under different package names, allowing the editor to use the classic API while the native binary handled CI and local typechecks. The migration revealed stricter typechecking by the native compiler, identifying a few errors previously unnoticed, but they were easily addressed. The decision to adopt TypeScript 7 was delayed until it was well-vetted, and while the transition improved typechecking speed, it is recommended to wait for TypeScript 7.1 for those who rely heavily on typescript-eslint in CI environments due to its restored compiler API.
Jul 28, 2026 1,295 words in the original blog post.
In a detailed examination of Mergify's frontend and engine parser, it was discovered that the frontend was incorrectly guessing which operators were valid for various attributes, with 70 out of 75 attributes offering wrong menus. This misalignment led to both over-offering and under-offering of operators, resulting in either validation errors or silent failures where users simply assumed certain functionalities were not available. Instead of patching the heuristic, Mergify chose to have the engine's parser publish its own grammar through the configuration schema, making the frontend import this generated schema directly. This change eliminated the frontend's need to maintain its own version of the parser's logic, ensuring consistency between the engine and the frontend, and allowing the documentation to update automatically. This approach not only removed the potential for future discrepancies but also streamlined the maintenance process, with the schema serving as the single source of truth for operator validity, improving the user experience by accurately reflecting the engine's capabilities.
Jul 17, 2026 1,889 words in the original blog post.
The blog post by Thomas Berdy details the discovery of an outdated authentication library, "imia," that had been running on the Mergify dashboard for four years without any alerts, due to the limitations of dependency bots that only highlight new versions and known vulnerabilities. The library's lack of updates went unnoticed as it didn't trigger any alerts from their tools, which only flag new releases or vulnerabilities. This oversight was discovered during a code review, sparking a migration from "imia" to a more actively maintained solution using "Starlette's" built-in authentication middleware. This transition was executed carefully to maintain session continuity and avoid logging out users. The incident prompted the team to develop a new auditing tool to monitor the maintenance health of dependencies, highlighting the need for proactive dependency management and better awareness of library status to prevent reliance on obsolete software. The post concludes with a caution to regularly check and evaluate dependencies to ensure they remain current and supported.
Jul 15, 2026 1,203 words in the original blog post.
In the evolving landscape of software development, Mitchell Hashimoto highlights a critical challenge posed by AI agents generating code at much higher rates than humans, which overwhelms traditional merge queues designed for human-paced work. This increased churn necessitates a rethinking of the merge queue system, emphasizing throughput over serial processing to maintain coherence in the main branch. New systems, like those implemented in Mergify, use parallel processing and batching to efficiently handle multiple pull requests by testing them speculatively, thereby reducing waiting times and preventing bottlenecks. These advanced queues operate with scope-aware systems that allow independent parts of a monorepo to be tested simultaneously, addressing the limitations of single-lane queues. Furthermore, the future of code management may shift towards a system that focuses on changes rather than commits, enhancing the efficiency of agent-driven development while maintaining the integrity of the main branch.
Jul 13, 2026 1,211 words in the original blog post.
In the blog post, Julian Maurin discusses the implementation of a dynamic batch size for a merge queue system that processes pull requests (PRs) in a continuous integration (CI) environment. The initial system, which tested each PR individually, struggled during sudden influxes of requests, leading to inefficiencies. By introducing a flexible batch size that adjusts between a minimum and maximum based on the current load, the system can better handle unpredictable spikes in demand without manual intervention. This adjustment allows for pairing PRs under high load to expedite processing while maintaining the ability to test individually during quieter periods, thus optimizing the balance between reliability, cost, and velocity. The change was first tested on June 16, leading to a significant increase in efficiency without compromising on the quality or reliability of the CI process.
Jul 06, 2026 1,440 words in the original blog post.
Rémy Duthu's blog post delves into the intricacies of building a custom metric rollup system on Postgres, emphasizing the limitations of using materialized views for handling high-frequency data updates. The author explains that while materialized views are useful for static data or infrequent updates, they fall short in scenarios where data is frequently written and then deleted, such as in their CI job metrics system. Instead of relying on materialized views, the team developed a two-writer, two-counter mechanism that effectively manages data retention and update efficiency by incrementally updating metrics with a combination of synchronous and asynchronous processes. This system utilizes a synchronous writer for immediate updates and an asynchronous writer for periodic recalculations, effectively balancing data freshness with computational efficiency. Duthu highlights the importance of using two counters instead of a boolean flag to avoid race conditions during asynchronous recalculations, ensuring that metrics remain accurate despite concurrent data writes. The blog concludes by recommending the use of materialized views only in scenarios where data changes infrequently, while advocating for their custom approach in high-write environments to maintain performance and accuracy.
Jul 03, 2026 2,278 words in the original blog post.
The experiment of integrating a full Jinja2 templating engine into Mergify's configuration files revealed that users rarely utilized its potential, primarily sticking to static strings with the occasional use of a single variable, the pull request author. Though the engine provided users with significant flexibility, the security risks associated with rendering strings from user repositories necessitated constant vigilance. Scanning 4,629 config files from 1,262 organizations showed minimal engagement with the engine's capabilities, prompting a shift towards a safer, declarative version that supports necessary features without the extensive risk. This transition involves careful deprecation of templated values, maintaining functionality while removing the engine's complexity. The findings demonstrate that while the initial open-ended approach provided valuable insights into user needs, the demand for dynamic configurations was lower than expected, thus validating a streamlined approach focused on essential, secure features.
Jul 01, 2026 1,729 words in the original blog post.