Skip to content

Conversation

@natifridman
Copy link
Contributor

When an issue already has an open PR, Amber now:

  • Detects the existing PR via gh pr list search
  • Checks out the existing branch instead of creating a new one
  • Pushes additional commits to the existing PR
  • Adds comments to both PR and issue about the update

This prevents duplicate PRs like #450, #442, #441, #438.

🤖 Generated with Claude Code

When an issue already has an open PR, Amber now:
- Detects the existing PR via gh pr list search
- Checks out the existing branch instead of creating a new one
- Pushes additional commits to the existing PR
- Adds comments to both PR and issue about the update

This prevents duplicate PRs like ambient-code#450, ambient-code#442, ambient-code#441, ambient-code#438.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

This comment has been minimized.

Security fixes:
- Add branch name validation to prevent shell injection attacks
- Validate issue number format before use in commands
- Use strict regex matching for PR lookup (Closes #N pattern)

Reliability improvements:
- Handle race conditions when PR is closed during execution
- Add fallback logging for comment failures (non-critical)
- Consolidate branch checkout logic with proper error handling
- Add try-catch for label operations

Code quality:
- Add workflow documentation header with triggers and behavior
- Improve error message consistency
- Remove redundant branch existence checks

Addresses review comments from PR ambient-code#453.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
# Check if there's already an open PR for this issue using stricter matching
# Search for PRs that reference this issue and filter by body containing exact "Closes #N" pattern
EXISTING_PR=$(gh pr list --state open --json number,headRefName,body --jq \
".[] | select(.body | test(\"Closes #${ISSUE_NUMBER}($|[^0-9])\")) | {number, headRefName}" \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be enough to break this bot loop

jeremyeder added a commit that referenced this pull request Dec 9, 2025
## Summary
Fixes the intermittent frontend health check failures in smoke tests by
addressing a race condition between pod readiness and NodePort service
routing.

## Problem
PR #453 and potentially other PRs were failing with:
```
✗ Frontend not responding
```

Even though:
- Pods showed as `Running` and `Ready`
- All readiness probes passed
- The frontend was actually working

This was a timing issue: the smoke test ran immediately after pods
became Ready, but NodePort service endpoint propagation can lag slightly
behind pod readiness state.

## Solution
1. **Added explicit pod readiness wait** using `kubectl wait
--for=condition=ready`
2. **Implemented retry logic** for health checks (5 attempts with 2s
delays)
3. **Fixed deployment timeout handling** in GitHub Actions to properly
fail the job

## Testing
The fix has been tested on branch `fix-frontend-smoke-test-timing` and
successfully addresses the timing issue.

## Related Issues
- Fixes failures from:
https://github.com/ambient-code/platform/actions/runs/20064017469/job/57547783304
- Will allow PR #453 and other PRs to pass smoke tests reliably

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
@jeremyeder jeremyeder merged commit 3fb014e into ambient-code:main Dec 9, 2025
6 of 7 checks passed
@natifridman natifridman deleted the amber-new-issue branch December 9, 2025 13:34
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