Safe push

From JetBrains/intellij-community · View interactive version

Safe push is an AI agent skill from the GitHub repository JetBrains/intellij-community. Push IntelliJ repository changes through Safe Push.

How to use this skill

Skill file

Safe Push Guide for AI Agents

Overview

Safe Push is a system that ensures code changes pass all required tests before being merged to protected branches (like master). It's powered by Patronus.

Safe Push CLI

The safePush.cmd script in the repository root provides command-line access to Safe Push without needing the IDE.

Basic Usage

# Push current HEAD to master (most common)
./safePush.cmd HEAD:master

# Push specific commit to master
./safePush.cmd <commit-hash>:master

# Dry run (test without pushing)
./safePush.cmd -dry-run HEAD:master

Options

-autosquash    Automatically squash fixup! commits (default true)
-dry-run       Run tests without push
-emergency     Skip tests and push directly (USE ONLY IN EMERGENCIES)
-verbose       Verbose output
-help          Print help

What Happens During Safe Push

  1. Your changes are pushed to a temporary branch
  2. Patronus triggers required CI checks (tests, compilation)
  3. Tests may retry up to 4 times for flaky failures
  4. If all checks pass, changes are merged to the target branch
  5. You receive Slack/Space/Email notification of results

Typical Duration

Monitoring Progress

After starting a Safe Push you'll receive a Patronus URL like:

https://patronus.labs.jb.gg/robot/<uuid>

Always print this URL back to the user. Its page has the cancel button.

Use the [[patronus]] skill to check the status, list the failing checks, inspect an attempt, babysit the Safe Push until it finishes, or cancel it. After the Safe Push starts, you can offer to track or babysit it. The user can say no.

The restore-branch action stays in the browser.

Emergency Push

Use ./safePush.cmd -emergency ONLY for:

DO NOT use Emergency Push for:

Troubleshooting

Safe Push stuck or slow

Tests failing that seem unrelated

Need to debug a failed Safe Push

  1. Go to your Safe Push on Patronus
  2. Click "commits" to see changes
  3. Click "Restore Branch" to recover your changes locally

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.