Codex and GitLab: From Code to Production in Three Steps

Codex writes code in the terminal quickly, but that's only half the work. GitLab adds context: requirements from issues via MCP, collaboration in merge requests, CI/CD pipelines, and human approval. The article outlines three scenarios: local bug fixes, implementation with requirements, and assistance in code reviews.

AI-processed from GitLab Blog; edited by Hamidun News
Codex and GitLab: From Code to Production in Three Steps
Source: GitLab Blog. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceGitLab Blog ↗
Editor-in-Chief
Key metric #1Reading requirements from issues via MCP
Key metric #2Implementation that accounts for all details
Key metric #3Creating an MR that closes the issue upon merge
Codex and GitLab: From Code to Production in Three Steps
Featured Video / Demo
Click to load the embedded player (privacy-enhanced youtube-nocookie mode) or read the full breakdown below.Watch on YouTube ↗

Codex is an AI agent for coding in the terminal. It writes code, runs tests, commits to a branch — and does it all quickly. But writing code is just the first step. After that comes the task, pull request, CI/CD, code review, and the human decision about merging. GitLab helps connect Codex's speed with the context needed for production.

Codex Locally: From Bug to Code

The first scenario works in the terminal. In the Tanuki IoT Platform project, there's a WebSocket bug: filtering metrics by type doesn't work. You describe the task to Codex, it analyzes the Rust code, finds the missing `metric` parameter, adds filtering, and writes tests. After verification, Codex creates a branch, commits, and pushes. GitLab CI checks Rust style and runs tests. Ready to merge. Here the agent works with the repository and a local AGENTS.md file that describes what a good implementation should look like.

GitLab MCP: Requirements Context

The second scenario adds depth. Codex can now pull information from GitLab issues via MCP (Model Context Protocol). Issue #32 describes the requirements: tests, documentation, and updates are needed. Instead of copying everything into the prompt, Codex simply asks to "help implement issue 32" and loads requirements directly from GitLab. Now the fix considers not only the technical solution but also business requirements. Codex creates a pull request with an automatic "Closes #32":

  • Reading requirements from issues via MCP
  • Implementation that accounts for all details
  • Creating an MR that closes the issue upon merge
  • Linking code to requirements
  • Agent participation in the delivery workflow

This is no longer local coding, but participation in the delivery process.

External Agent in Merge Request

The third scenario is the most interesting. Code review identifies issues: missing documentation and tests for error cases. You mention Codex in an MR comment (@ai-codex-agent), and the agent now works within the context of the pull request. It sees the diff, feedback, CI results, and approvals. Codex adds documentation, writes missing tests, makes a commit, and runs checks. It writes a reply back in the MR. The merge request becomes the central surface: code is here, review is here, the agent helps here, and the human approves here.

What This Means

Coding became fast, but speed without context is just a pipeline of patches. When the agent sees requirements (from issues) and collaboration (from MRs), it produces meaningful work. This is connecting code speed with production context: the agent works fast, the human makes decisions.

Story

Key Questions Answered

What are the key details on Codex Locally: From Bug to Code?

The first scenario works in the terminal. In the Tanuki IoT Platform project, there's a WebSocket bug: filtering metrics by type doesn't work. You describe the task to Codex, it analyzes the Rust code, finds the missing `metric` parameter, adds filtering, and writes tests. After verification, Codex creates a branch, commits, and pushes. GitLab CI checks Rust style and runs tests. Ready to merge. Here the agent works with the repository and a local AGENTS.md file that describes what a good implementation should look like.

What are the key details on GitLab MCP: Requirements Context?

The second scenario adds depth. Codex can now pull information from GitLab issues via MCP (Model Context Protocol). Issue #32 describes the requirements: tests, documentation, and updates are needed. Instead of copying everything into the prompt, Codex simply asks to "help implement issue 32" and loads requirements directly from GitLab. Now the fix considers not only the technical solution but also business requirements. Codex creates a pull request with an automatic "Closes #32": Reading requirements from issues via MCP Implementation that accounts for all details Creating

What are the key details on External Agent in Merge Request?

The third scenario is the most interesting. Code review identifies issues: missing documentation and tests for error cases. You mention Codex in an MR comment (@ai-codex-agent), and the agent now works within the context of the pull request. It sees the diff, feedback, CI results, and approvals. Codex adds documentation, writes missing tests, makes a commit, and runs checks. It writes a reply back in the MR. The merge request becomes the central surface: code is here, review is here, the agent helps here, and the human approves here.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Hands-On AI Engineering · Hamidun Academy

Build & Ship Production AI Agents Without Boilerplate Code

Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.

Start 72h Free Trial →Vibe-Coding Intensive
What do you think?
Loading comments…