# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Removed the Ampcode PR review workflow to disable automated code review on pull requests. This streamlines the CI process and removes all related automation steps.
<!-- End of auto-generated description by cubic. -->
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Added support for triggering automated PR reviews by commenting `/review` on a pull request, allowing manual review requests in addition to automatic triggers.
- **New Features**
- Detects `/review` comments on PRs and runs the Ampcode review workflow.
- Posts review results and reactions to indicate review status.
<!-- End of auto-generated description by cubic. -->
# READ CAREFULLY THEN REMOVE
Remove bullet points that are not relevant.
PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI.
- Pull requests that do not follow these guidelines will be closed without review or comment.
- If you use AI to write your PR description your pr will be close without review or comment.
- If you are unsure about anything, feel free to ask for clarification.
## Description
Please provide a clear description of your changes.
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](https://github.com/Mail-0/Zero/blob/staging/.github/CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Improved the PR review workflow by adding line-specific comments and reaction indicators to make feedback clearer and easier to track.
- **New Features**
- Added support for posting review comments on exact lines in changed files.
- Added 👀 and ✅ reactions to show when review starts and completes.
<!-- End of auto-generated description by cubic. -->
# Add automated PR review with ampcode integration
## Summary
This PR introduces a new GitHub Action workflow that automatically reviews pull requests using the Ampcode AI service. When a non-draft PR is opened or updated, the workflow:
- Spins up a containerized Ubuntu environment with Node.js
- Installs the Ampcode CLI (`@sourcegraph/amp`)
- Analyzes changed files in the PR using AI-powered code review
- Posts structured review comments directly on the PR
- Implements scalable matrix strategy for handling multiple concurrent PRs
- Includes proper cleanup and error handling
The workflow is designed to provide immediate, AI-powered feedback on code quality, potential bugs, security issues, and best practices while being scalable to handle multiple PRs simultaneously.
## Review & Testing Checklist for Human
- [ ] **Configure AMPCODE_API_KEY secret** - The workflow requires this secret to be set up in GitHub repository settings before it can function
- [ ] **Test end-to-end with a real PR** - Create a test PR to verify the workflow triggers correctly, ampcode CLI works, and comments are posted as expected
- [ ] **Verify ampcode CLI authentication** - Ensure the API key works with the `@sourcegraph/amp` package and ampcode service
- [ ] **Check GitHub API integration** - Confirm that the JSON formatting for PR comments is correct and doesn't cause API errors
- [ ] **Validate workflow triggers and scaling** - Test that the concurrency controls work properly and multiple PRs can be processed simultaneously
---
### Diagram
```mermaid
%%{ init : { "theme" : "default" }}%%
graph TD
subgraph "GitHub Actions Workflows"
WorkflowNew[".github/workflows/<br/>ampcode-pr-review.yml"]:::major-edit
WorkflowCI[".github/workflows/<br/>ci.yml"]:::context
WorkflowSync[".github/workflows/<br/>sync-production.yml"]:::context
end
subgraph "External Services"
Ampcode["Ampcode AI Service<br/>(ampcode.com)"]:::context
GitHubAPI["GitHub API<br/>(PR Comments)"]:::context
end
subgraph "Secrets & Config"
AmpcodeKey["AMPCODE_API_KEY<br/>(Repository Secret)"]:::context
GitHubToken["GITHUB_TOKEN<br/>(Built-in)"]:::context
end
WorkflowNew -->|"Installs & authenticates"| Ampcode
WorkflowNew -->|"Posts review comments"| GitHubAPI
WorkflowNew -->|"Requires"| AmpcodeKey
WorkflowNew -->|"Uses"| GitHubToken
subgraph Legend
L1[Major Edit]:::major-edit
L2[Minor Edit]:::minor-edit
L3[Context/No Edit]:::context
end
classDef major-edit fill:#90EE90
classDef minor-edit fill:#87CEEB
classDef context fill:#FFFFFF
```
### Notes
- **Security consideration**: The workflow uses the AMPCODE_API_KEY secret and GitHub token for API access. Ensure the ampcode service is trusted before enabling.
- **Performance**: The workflow has a 15-minute timeout and processes up to 50 changed files to prevent resource exhaustion.
- **File filtering**: Only reviews common code file types (ts, tsx, js, jsx, py, etc.) to focus on relevant content.
- **Scalability**: Uses matrix strategy with max 3 parallel jobs and concurrency controls to handle multiple PRs efficiently.
**Link to Devin run**: https://app.devin.ai/sessions/d48a696c401a4b2a9c54dcf487601fd0
**Requested by**: Adam (@MrgSub)
<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Added a GitHub Action that automatically reviews PRs using Ampcode, posting structured feedback on code quality, bugs, and best practices.
- **New Features**
- Runs on PR open or update for main and staging branches.
- Installs Ampcode CLI, analyzes up to 50 changed files, and posts review comments.
- Handles multiple PRs with concurrency controls and error handling.
- Requires AMPCODE_API_KEY secret for authentication.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Added GitHub workflows to automatically close stale issues and pull requests with unresolved merge conflicts older than 3 days.
- **Automation**
- Closes open pull requests with merge conflicts after 3 days.
- Closes issues immediately when marked as stale.
<!-- End of auto-generated description by cubic. -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **Chores**
* Introduced automated workflows to close old pull requests with unresolved merge conflicts and to close stale issues, helping keep the repository clean and up to date.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Ran oxc (https://oxc.rs/docs/guide/usage/linter.html#vscode-extension) and fixed all the issues that came up, set it up to run as a PR check and added steps to the README.md asking users to use it.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Introduced JavaScript linting using oxlint in development guidelines and CI workflow for improved code quality.
* Added oxlint configuration and dependencies to the project.
* **Bug Fixes**
* Improved error logging in various components and utilities for better debugging.
* Enhanced React list rendering by updating keys to use unique values instead of array indices, reducing rendering issues.
* Replaced browser alerts with toast notifications for a smoother user experience.
* **Refactor**
* Simplified component logic and state management by removing unused code, imports, props, and components across multiple files.
* Updated function and component signatures for clarity and maintainability.
* Improved efficiency of certain operations by switching from arrays to sets for membership checks.
* **Chores**
* Cleaned up and reorganized import statements throughout the codebase.
* Removed deprecated files, components, and middleware to streamline the codebase.
* **Documentation**
* Updated contribution guidelines to include linting requirements for code submissions.
* **Style**
* Minor formatting and readability improvements in JSX and code structure.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
### TL;DR
Improved the production deployment workflow with better error handling and clearer instructions.
### What changed?
- Renamed `auto-merge-prod.yml` to `deploy-to-prod-command.yml` to better reflect its purpose
- Updated workflow name from "Deploy Production" to "Deploy to Production Command"
- Changed job name to "Merge Staging to Production" for clarity
- Added proper error handling when rebase fails by posting a comment to the PR instead of failing silently
- Added explicit condition for the push step to only run when rebase succeeds
- Updated the sync-production workflow to include clear instructions in the PR body instead of creating a draft PR
- Added guidance in the PR body explaining how to deploy using the `/deploy` command
### How to test?
1. Create a PR from staging to main
2. Comment `/deploy` on the PR to trigger the deployment workflow
3. Verify that the workflow correctly merges staging into main when possible
4. Test the error case by creating a conflict between staging and main, then verify the workflow posts a helpful error comment
### Why make this change?
This change improves the developer experience by providing clearer feedback during the deployment process. The improved error handling helps developers understand when manual intervention is needed, and the updated PR template provides explicit instructions on how to complete the deployment. Renaming the workflow files and jobs also makes their purpose more obvious to team members.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
- **Chores**
- Updated deployment workflow to require a specific comment format and label for production deploys.
- Enhanced error handling during rebase with clearer instructions for manual intervention.
- Automated pull requests for syncing staging to production now include deployment instructions, a production-deploy label, and are no longer created as drafts.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Added a GitHub workflow to automatically deploy to production when staging PRs are approved by MrgSub.
Created a new GitHub workflow file `.github/workflows/auto-merge-prod.yml` that:
- Triggers when a pull request is approved
- Checks if the PR is from staging to main and was approved by MrgSub
- Automatically rebases main on staging
- Pushes the changes to main if the rebase is successful
1. Create a PR from staging to main
2. Have the GitHub user MrgSub approve the PR
3. Verify that the workflow runs and successfully rebases main on staging
To streamline the deployment process to production by automating the merge from staging to main when approved by the designated reviewer. This reduces manual steps and potential human error during the deployment process.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
- **Chores**
- Introduced a new automated workflow to deploy changes to production when specific pull requests are approved. This streamlines the release process and ensures only approved updates are merged and deployed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
## Description
Send Lingo.dev PRs to staging
---
## Type of Change
Please delete options that are not relevant.
- [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
- [ ] ✨ New feature (non-breaking change which adds functionality)
- [ ] 💥 Breaking change (fix or feature with breaking changes)
- [ ] 📝 Documentation update
- [ ] 🎨 UI/UX improvement
- [ ] 🔒 Security enhancement
- [ ] ⚡ Performance improvement
## Areas Affected
Please check all that apply:
- [ ] Email Integration (Gmail, IMAP, etc.)
- [ ] User Interface/Experience
- [ ] Authentication/Authorization
- [ ] Data Storage/Management
- [ ] API Endpoints
- [ ] Documentation
- [ ] Testing Infrastructure
- [ ] Development Workflow
- [ ] Deployment/Infrastructure
## Testing Done
Describe the tests you've done:
- [ ] Unit tests added/updated
- [ ] Integration tests added/updated
- [ ] Manual testing performed
- [ ] Cross-browser testing (if UI changes)
- [ ] Mobile responsiveness verified (if UI changes)
## Security Considerations
For changes involving data or authentication:
- [ ] No sensitive data is exposed
- [ ] Authentication checks are in place
- [ ] Input validation is implemented
- [ ] Rate limiting is considered (if applicable)
## Checklist
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document
- [ ] My code follows the project's style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in complex areas
- [ ] I have updated the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature works
- [ ] All tests pass locally
- [ ] Any dependent changes are merged and published
## Additional Notes
Add any other context about the pull request here.
## Screenshots/Recordings
Add screenshots or recordings here if applicable.
---
_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._