Skip to content

Commit 9500566

Browse files
committed
Fix workflow yaml syntax, improve README.md
1 parent 23337a1 commit 9500566

File tree

2 files changed

+80
-103
lines changed

2 files changed

+80
-103
lines changed

.github/workflows/fix-remote-pr.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,16 @@ jobs:
172172
PR_NUMBER="${{ github.event.inputs.pr_number }}"
173173
FAILED_NAMES="${{ steps.analyze.outputs.failed-names }}"
174174
175-
gh pr comment $PR_NUMBER --repo "$REPO" --body "🔧 **Attempting to fix failing checks**
175+
MESSAGE="🔧 **Attempting to fix failing checks**
176176
177177
I've detected failures in: $FAILED_NAMES
178178

179179
Analyzing the issues and will attempt to fix them automatically.
180180

181181
---
182182
🤖 *AI Engineering Maintenance Bot - Maintaining Vector Institute Repositories built by AI Engineering*"
183+
184+
gh pr comment $PR_NUMBER --repo "$REPO" --body "$MESSAGE"
183185
env:
184186
GH_TOKEN: ${{ secrets.ORG_ACCESS_TOKEN }}
185187

README.md

Lines changed: 77 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# aieng-bot-maintain
22

3-
Centralized maintenance bot for ALL Vector Institute repositories. Automatically manages Dependabot PRs across the entire organization from a single location.
3+
Centralized maintenance bot that automatically manages Dependabot PRs across all Vector Institute repositories from a single location.
44

55
## Features
66

7-
- **Organization-wide monitoring**: Scans all VectorInstitute repos every 10 minutes
8-
- **Auto-merge**: Merges Dependabot PRs when all checks pass
9-
- **Auto-fix**: Fixes test failures, linting issues, security vulnerabilities, and build errors using Gemini 3 AI
10-
- **Centralized operation**: No need to install workflows in each repository
11-
- **Smart detection**: Categorizes failures and applies appropriate fix strategies
12-
- **Transparent**: Comments on PRs with status updates
7+
**Organization-wide monitoring** - Scans all VectorInstitute repos every 10 minutes
8+
**Auto-merge** - Merges Dependabot PRs when all checks pass
9+
**Auto-fix** - Fixes test failures, linting issues, security vulnerabilities, and build errors using Gemini 3 AI
10+
**Centralized operation** - No installation needed in individual repositories
11+
**Smart detection** - Categorizes failures and applies appropriate fix strategies
12+
**Transparent** - Comments on PRs with status updates
1313

1414
## Architecture
1515

@@ -39,147 +39,122 @@ Centralized maintenance bot for ALL Vector Institute repositories. Automatically
3939

4040
## Quick Start
4141

42-
### One-Time Setup (in THIS repository)
42+
### Setup (in this repository)
4343

44-
1. **Add organization secrets** to this repository:
45-
- `GEMINI_API_KEY`: Get from [Google AI Studio](https://makersuite.google.com/app/apikey)
46-
- `ORG_ACCESS_TOKEN`: GitHub PAT with org-wide access (see below)
44+
**1. Create Gemini API Key**
45+
- Get from [Google AI Studio](https://makersuite.google.com/app/apikey)
46+
- Add as repository secret: `GEMINI_API_KEY`
4747

48-
2. **Create GitHub Personal Access Token**:
49-
- Go to Settings → Developer settings → Personal access tokens → Fine-grained tokens
50-
- Create token with:
51-
- Resource owner: VectorInstitute
52-
- Repository access: All repositories
53-
- Permissions: `contents: write`, `pull_requests: write`, `issues: write`
54-
- Add as secret: `ORG_ACCESS_TOKEN`
48+
**2. Create GitHub Personal Access Token**
49+
- Go to Settings → Developer settings → Personal access tokens → Fine-grained tokens
50+
- Configure: Resource owner: `VectorInstitute`, Repository access: `All repositories`
51+
- Permissions: `contents: write`, `pull_requests: write`, `issues: write`
52+
- Add as repository secret: `ORG_ACCESS_TOKEN`
5553

56-
3. **Enable workflows** in this repository:
57-
- Actions → Enable workflows
58-
- Workflows will start running automatically
54+
**3. Enable GitHub Actions**
55+
- Go to Actions tab → Enable workflows
5956

60-
4. **That's it!** The bot now monitors all VectorInstitute repos
57+
The bot now monitors all VectorInstitute repositories automatically.
6158

6259
## How It Works
6360

64-
### 1. Monitoring (Every 10 minutes)
65-
`monitor-org-dependabot.yml` runs automatically:
66-
- Scans all VectorInstitute repositories
67-
- Finds open Dependabot PRs
61+
**1. Monitor** (every 10 minutes)
62+
- Scans all VectorInstitute repositories for open Dependabot PRs
6863
- Checks status of each PR
69-
- Routes to merge or fix workflows
64+
- Routes to merge or fix workflow
7065

71-
### 2. Auto-Merge (for passing PRs)
72-
When all checks pass:
73-
- Approves the PR
74-
- Enables auto-merge
66+
**2. Auto-Merge** (when all checks pass)
67+
- Approves PR and enables auto-merge
7568
- Comments with status
76-
- PR merges automatically when ready
69+
- PR merges automatically
7770

78-
### 3. Auto-Fix (for failing PRs)
79-
When checks fail:
80-
- Triggers `fix-remote-pr.yml` workflow
81-
- Clones the target repo + PR branch
82-
- Analyzes failure type (test/lint/security/build)
71+
**3. Auto-Fix** (when checks fail)
72+
- Clones target repository and PR branch
73+
- Analyzes failure type: test, lint, security, or build
8374
- Loads appropriate AI prompt template
8475
- Invokes Gemini 3 Pro to generate fixes
85-
- Pushes fixes to PR branch
86-
- Comments with results
76+
- Pushes fixes and comments on PR
8777

8878
## Configuration
8979

90-
### Required Secrets
91-
- `GEMINI_API_KEY`: Gemini API access (required)
92-
- `ORG_ACCESS_TOKEN`: GitHub PAT with org-wide permissions (required)
80+
**Required Secrets**
81+
- `GEMINI_API_KEY` - Gemini API access
82+
- `ORG_ACCESS_TOKEN` - GitHub PAT with org-wide permissions
9383

94-
### Workflows
95-
- `.github/workflows/monitor-org-dependabot.yml` - Scans org for Dependabot PRs
96-
- `.github/workflows/fix-remote-pr.yml` - Fixes failing PRs
84+
**Workflows**
85+
- `monitor-org-dependabot.yml` - Scans org for Dependabot PRs every 10 minutes
86+
- `fix-remote-pr.yml` - Fixes failing PRs using AI
9787

98-
### AI Prompt Templates
99-
Customize these for your organization's needs:
100-
- `.github/prompts/fix-test-failures.md`
101-
- `.github/prompts/fix-lint-failures.md`
102-
- `.github/prompts/fix-security-audit.md`
103-
- `.github/prompts/fix-build-failures.md`
88+
**AI Prompt Templates** (customize for your needs)
89+
- `fix-test-failures.md` - Test failure resolution strategies
90+
- `fix-lint-failures.md` - Linting/formatting fixes
91+
- `fix-security-audit.md` - Security vulnerability handling
92+
- `fix-build-failures.md` - Build/compilation error fixes
10493

105-
## What It Can Fix
94+
## Capabilities
10695

107-
✅ Linting and formatting issues
108-
✅ Security vulnerabilities (dependency updates)
109-
✅ Simple test failures from API changes
110-
✅ Build configuration issues
96+
**Can fix:**
97+
- Linting and formatting issues
98+
- Security vulnerabilities (dependency updates)
99+
- Simple test failures from API changes
100+
- Build configuration issues
111101

112-
❌ Complex logic errors
113-
❌ Breaking changes requiring refactoring
114-
❌ Issues requiring architectural decisions
102+
**Cannot fix:**
103+
- Complex logic errors
104+
- Breaking changes requiring refactoring
105+
- Issues requiring architectural decisions
115106

116107
## Manual Testing
117108

118-
You can manually trigger workflows for specific PRs:
119-
109+
**Trigger via CLI:**
120110
```bash
121-
# Test the monitor workflow
122-
gh workflow run monitor-org-dependabot.yml --repo VectorInstitute/aieng-bot-maintain
111+
# Monitor all repositories
112+
gh workflow run monitor-org-dependabot.yml
123113

124-
# Fix a specific PR
114+
# Fix a specific PR (test with aieng-template-mvp#17)
125115
gh workflow run fix-remote-pr.yml \
126-
--repo VectorInstitute/aieng-bot-maintain \
127116
--field target_repo="VectorInstitute/aieng-template-mvp" \
128117
--field pr_number="17"
129118
```
130119

131-
Or use the GitHub UI:
132-
- Actions → Select workflow → Run workflow → Enter parameters
120+
**Trigger via GitHub UI:**
121+
Actions → Select workflow → Run workflow → Enter parameters
133122

134-
## Documentation
123+
## Monitoring
135124

136-
- [Setup Guide](SETUP.md): Detailed configuration and permissions
137-
- [Deployment Guide](DEPLOYMENT.md): Rollout strategy and monitoring
138-
- [Testing Guide](TESTING.md): Test cases and validation
139-
- [Bot Identity](/.github/bot-assets/BOT_IDENTITY.md): Avatar and branding specs
125+
**View bot activity:**
126+
- Actions tab - All workflow runs and success/failure rates
127+
- PR comments - Detailed status updates on each PR
128+
- Run summary - PR count and actions taken per run
140129

141-
## Test Target
130+
**Debug commands:**
131+
```bash
132+
# View recent workflow runs
133+
gh run list --workflow=monitor-org-dependabot.yml --limit 5
142134

143-
Test with [aieng-template-mvp#17](https://github.com/VectorInstitute/aieng-template-mvp/pull/17):
144-
- Has frontend test failures
145-
- Real Dependabot dependency updates
146-
- Perfect candidate for auto-fix testing
135+
# View logs for specific run
136+
gh run view RUN_ID --log
137+
```
147138

148-
## Monitoring
139+
## Documentation
149140

150-
View bot activity:
151-
- **Actions tab**: See all workflow runs
152-
- **Workflow runs**: Check success/failure rates
153-
- **PR comments**: Bot leaves detailed status updates
154-
- **Run summary**: Each workflow run shows PR count and actions taken
141+
- [Setup Guide](SETUP.md) - Detailed configuration and permissions
142+
- [Deployment Guide](DEPLOYMENT.md) - Rollout strategy and monitoring
143+
- [Testing Guide](TESTING.md) - Test cases and validation
144+
- [Bot Identity](/.github/bot-assets/BOT_IDENTITY.md) - Avatar and branding
155145

156146
## Troubleshooting
157147

158148
| Issue | Solution |
159149
|-------|----------|
160-
| Workflow doesn't run | Check Actions enabled, verify secrets set |
150+
| Workflow doesn't run | Check Actions enabled and secrets are set |
161151
| Can't find PRs | Verify `ORG_ACCESS_TOKEN` has correct permissions |
162152
| Can't merge PRs | Ensure token has `contents: write` permission |
163153
| Can't push fixes | Check token has write access to target repos |
164-
| Gemini errors | Verify `GEMINI_API_KEY` is set and has quota |
165-
| Rate limits | Reduce monitoring frequency in cron schedule |
166-
167-
**Debug workflow**:
168-
```bash
169-
# View recent runs
170-
gh run list --workflow=monitor-org-dependabot.yml --limit 5
171-
172-
# View specific run logs
173-
gh run view RUN_ID --log
174-
```
175-
176-
## Contributing
177-
178-
Contributions welcome. Please test thoroughly before submitting PRs.
179-
180-
## License
154+
| Gemini errors | Verify `GEMINI_API_KEY` is valid and has quota |
155+
| Rate limits | Reduce monitoring frequency in workflow cron schedule |
181156

182-
[Add appropriate license]
157+
See [SETUP.md](SETUP.md) for detailed troubleshooting.
183158

184159
---
185160

0 commit comments

Comments
 (0)