[SPARK-56449][INFRA] Skip pre-flight checks for code questions in AGENTS.md#55303
[SPARK-56449][INFRA] Skip pre-flight checks for code questions in AGENTS.md#55303szehon-ho wants to merge 3 commits intoapache:masterfrom
Conversation
|
Hi @cloud-fan , i noticed this is a bit of a regression for open a new tab and asking another question about the code (it does git fetch every time and potentially rebase), which is one of my main use case (though maybe its not the main use case for you or other experienced Spark devs :)) . wdyt? |
AGENTS.md
Outdated
| ## Pre-flight Checks | ||
|
|
||
| Before the first code read, edit, or test in a session, ensure a clean working environment. DO NOT skip these checks: | ||
| These checks apply to all tasks **except** answering questions about the code or its behavior. For those, skip these checks and work directly on whatever branch is currently checked out. |
There was a problem hiding this comment.
ah, I think there is ambiguity here: do users want to ask questions about the code of latest master branch, or the current (may be dirty) local branch? Both are possible, but I think do not disturb the current branch is a better default. So +1 to your proposal.
Shall we just make a single change? Before the first code edit or running test in a session, ..
AGENTS.md
Outdated
| 2. If the latest commit on `<upstream>/master` is more than a day old (check with `git log -1 --format="%ci" <upstream>/master`), run `git fetch <upstream> master`. | ||
| 3. If there are uncommitted changes (check with `git status`), ask the user to stash them before proceeding. | ||
| 4. Switch to the appropriate branch: | ||
| - **Existing PR**: resolve the PR branch name via `gh api repos/databricks-eng/runtime/pulls/<number> --jq '.head.ref'`, then look for a local branch matching that name. If found, switch to it and inform the user. If not found, ask whether to fetch it or if there is a local branch under a different name. |
There was a problem hiding this comment.
I see that gh api repos/databricks-eng/runtime/pulls/<number> wasn't added in this PR, but maybe we should fix it here.
|
no need to test, thanks, merging to master! |
|
Thanks all! |
What changes were proposed in this pull request?
Updated AGENTS.md to skip the pre-flight checks when the user is only asking questions about the code or its behavior.
Why are the changes needed?
For every new AI agent session (cursor, claude code), a new questions like "what does function X do?" previously triggered
git remote -v, a staleness check, a potentialgit fetch,git status, and a branch switch.It's somewhat of a regression from the previous, more lightweight experience before AGENTS.md. It happens whenever open a tabs to start a different question session about the code.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Manual verification — this is a documentation-only change to AI agent instructions.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Cursor (Claude Opus 4)