elastic / elastic/ai-github-actions

[autonomy-atomicity] move-github-dotgithub exits after moving only one file

Open Beginner friendly
#1,614 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
11
Forks
16
Avg merge
22h 9m
Merged PRs (30d)
31

Description

## Autonomy / Atomicity Findings

### 1. File migration helper aborts after its first move
**Category:** Ordering dependency
**File(s):** `scripts/move-github-dotgithub.sh:32-40`
**Problem:** The script runs with `set -euo pipefail`, then increments `count` with `((count++))` while `count` starts at 0. In Bash, the post-increment expression returns the old value, so the first evaluation returns status 1 and terminates the script immediately. A reproduction with two files moved the first file to `.github/`, exited with status 1, and left the second file in `github/`. This can split an agent's generated workflow changes between the two trees and prevents the optional `--push` path from completing atomically.
**Suggested fix:** Use an increment expression whose status is successful, such as `count=$((count + 1))` or `((++count))`, and add a regression test covering multiple files and the `--push` count gate.

## Suggested Actions
- [ ] Replace the post-increment at `scripts/move-github-dotgithub.sh:39` with a status-safe increment.
- [ ] Add a test or shell-level validation proving all source files move before the script exits.

---
[What is this?](https://ela.st/github-ai-tools) | [From workflow: Trigger Autonomy Atomicity Analyzer](https://github.com/elastic/ai-github-actions/actions/runs/29760050275)

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

Contributor guide

Open the contributing guide

Research direction

Start with scripts/move-github-dotgithub.sh:32-40 and reproduce the failure using multiple files in the source directory. Replace the status-sensitive increment and add a shell-level regression check showing that all files move before exit, including the optional --push count gate.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.