Skip to content

Batch all file changes into a single atomic Git commit#25

Merged
ChrisJBurns merged 3 commits intomainfrom
fix/deduplicate-commit-files
Mar 12, 2026
Merged

Batch all file changes into a single atomic Git commit#25
ChrisJBurns merged 3 commits intomainfrom
fix/deduplicate-commit-files

Conversation

@aponcedeleonch
Copy link
Copy Markdown
Member

@aponcedeleonch aponcedeleonch commented Mar 12, 2026

Summary

  • Replace per-file CreateFile/UpdateFile calls with a single atomic commit using the GitHub Git Data API (trees + commits)
  • Produces cleaner git history (one commit instead of N) and eliminates 409 conflicts entirely
  • Add test case verifying deduplication preserves files with same name but different paths

Test plan

  • go build ./... compiles successfully
  • go test ./... all tests pass
  • go vet ./... no issues

🤖 Generated with Claude Code

aponcedeleonch and others added 2 commits March 12, 2026 16:59
When a file appears multiple times in version_files config (e.g.,
Chart.yaml with both version and appVersion paths), the commit loop
would attempt to commit the same file twice. Since all YAML path
changes are applied on disk before any commit, the second commit
hits a stale SHA due to GitHub API eventual consistency, causing
a 409 conflict.

Deduplicate req.Files before iterating so each file is committed
exactly once with all its changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace per-file CreateFile/UpdateFile calls with a single atomic commit
using the GitHub Git Data API (trees + commits). This produces cleaner
git history and eliminates 409 conflicts entirely.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aponcedeleonch aponcedeleonch changed the title Fix 409 conflicts by deduplicating files before commit loop Batch all file changes into a single atomic Git commit Mar 12, 2026
@ChrisJBurns ChrisJBurns merged commit 80e8d81 into main Mar 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants