|
| 1 | +# Known Issues and Notes |
| 2 | + |
| 3 | +## Version Discrepancies |
| 4 | + |
| 5 | +### glab (GitLab CLI) |
| 6 | +**Issue**: Cached latest version may be outdated |
| 7 | +**Details**: |
| 8 | +- User reported latest version is 1.74.0 (from https://gitlab.com/gitlab-org/cli/-/releases) |
| 9 | +- Cache may have older version (1.22 mentioned) |
| 10 | +- **Action needed**: Update cache entry for glab when running `make update` |
| 11 | + |
| 12 | +**Resolution:** |
| 13 | +```bash |
| 14 | +# Manual update in latest_versions.json |
| 15 | +# Or run update to fetch latest from GitHub releases |
| 16 | +make update |
| 17 | + |
| 18 | +# Verify |
| 19 | +make audit-glab |
| 20 | +``` |
| 21 | + |
| 22 | +## System-Specific Notes |
| 23 | + |
| 24 | +### Operating System |
| 25 | +- **Platform**: Linux |
| 26 | +- **System**: WSL2 (Windows Subsystem for Linux) |
| 27 | +- **Kernel**: 6.6.87.2-microsoft-standard-WSL2 |
| 28 | +- **Current Date**: 2025-10-23 |
| 29 | + |
| 30 | +### Python Environment |
| 31 | +- **Version**: Python 3.10+ required (Python 3.14.0rc2 currently available) |
| 32 | +- **Package Management**: uv preferred over pipx/pip |
| 33 | +- **Virtual Environments**: Optional, not required for core audit |
| 34 | + |
| 35 | +### Git Configuration |
| 36 | +- **Current Branch**: main |
| 37 | +- **Default Branch**: main (for PRs) |
| 38 | +- **Commit Style**: Conventional Commits (type(scope): description) |
| 39 | + |
| 40 | +## WSL2-Specific Considerations |
| 41 | + |
| 42 | +### File System |
| 43 | +- **Line Endings**: LF enforced (EditorConfig) |
| 44 | +- **Git Config**: May need `git config --global core.autocrlf input` |
| 45 | +- **Permissions**: chmod may behave differently than native Linux |
| 46 | + |
| 47 | +### Network |
| 48 | +- **WSL2 uses NAT**: May affect network detection |
| 49 | +- **DNS**: Sometimes needs manual configuration |
| 50 | +- **Proxy**: Check if corporate proxy affects GitHub/PyPI access |
| 51 | + |
| 52 | +### Tool Availability |
| 53 | +- **Some tools may need manual install**: Not all package managers work identically in WSL2 |
| 54 | +- **Docker**: May need Docker Desktop with WSL2 integration |
| 55 | +- **Snap**: May not work in WSL2, prefer apt/brew alternatives |
| 56 | + |
| 57 | +## Cache Management Notes |
| 58 | + |
| 59 | +### Lock Ordering |
| 60 | +**Critical**: Always acquire locks in this order to prevent deadlock: |
| 61 | +1. MANUAL_LOCK (manual cache updates) |
| 62 | +2. HINTS_LOCK (lookup hints updates) |
| 63 | + |
| 64 | +**Never acquire in reverse order!** |
| 65 | + |
| 66 | +### Atomic Writes |
| 67 | +All cache updates use atomic file operations: |
| 68 | +1. Write to temporary file |
| 69 | +2. Rename to final location |
| 70 | +3. Prevents corruption from interrupted writes |
| 71 | + |
| 72 | +### Lookup Hints |
| 73 | +`latest_versions.json` contains `__hints__` key with working upstream methods: |
| 74 | +- Speeds up subsequent runs |
| 75 | +- Safe to edit or remove (will rebuild) |
| 76 | +- Format: `"tool_name": "gh"` or `"tool_name": "pypi"`, etc. |
| 77 | + |
| 78 | +## Common Troubleshooting |
| 79 | + |
| 80 | +### Version Detection Fails |
| 81 | +**Symptoms**: Tool shows as NOT INSTALLED but is in PATH |
| 82 | +**Causes**: |
| 83 | +- Non-standard version flag |
| 84 | +- Tool doesn't support --version or -v |
| 85 | +- Version output parsing fails |
| 86 | + |
| 87 | +**Solution**: |
| 88 | +```bash |
| 89 | +# Debug single tool |
| 90 | +CLI_AUDIT_DEBUG=1 python3 cli_audit.py --only <tool> |
| 91 | + |
| 92 | +# Check manually |
| 93 | +which <tool> |
| 94 | +<tool> --version |
| 95 | +<tool> -v |
| 96 | +<tool> version |
| 97 | +``` |
| 98 | + |
| 99 | +### Network Timeouts |
| 100 | +**Symptoms**: Empty upstream versions, slow updates |
| 101 | +**Causes**: |
| 102 | +- Slow network connection |
| 103 | +- GitHub rate limiting |
| 104 | +- Upstream service temporarily down |
| 105 | + |
| 106 | +**Solutions**: |
| 107 | +```bash |
| 108 | +# Increase timeout |
| 109 | +CLI_AUDIT_TIMEOUT_SECONDS=10 make update |
| 110 | + |
| 111 | +# Use offline mode |
| 112 | +make audit-offline |
| 113 | + |
| 114 | +# Check rate limit |
| 115 | +curl -I https://api.github.com/rate_limit |
| 116 | + |
| 117 | +# Use GitHub token to increase rate limit |
| 118 | +export GITHUB_TOKEN=ghp_... |
| 119 | +make update |
| 120 | +``` |
| 121 | + |
| 122 | +### Cache Corruption |
| 123 | +**Symptoms**: Invalid JSON errors, wrong versions |
| 124 | +**Solution**: |
| 125 | +```bash |
| 126 | +# Nuclear option: delete and regenerate |
| 127 | +rm latest_versions.json tools_snapshot.json |
| 128 | +make update |
| 129 | +make audit |
| 130 | +``` |
| 131 | + |
| 132 | +### Parallel Execution Issues |
| 133 | +**Symptoms**: Deadlocks, race conditions, inconsistent results |
| 134 | +**Solutions**: |
| 135 | +```bash |
| 136 | +# Reduce workers |
| 137 | +CLI_AUDIT_MAX_WORKERS=4 make update |
| 138 | + |
| 139 | +# Sequential execution for debugging |
| 140 | +CLI_AUDIT_MAX_WORKERS=1 make update |
| 141 | + |
| 142 | +# Check lock ordering in code changes |
| 143 | +``` |
| 144 | + |
| 145 | +## Performance Notes |
| 146 | + |
| 147 | +### Benchmark Targets |
| 148 | +- **make update**: 3-10s for 50+ tools (parallel, MAX_WORKERS=16) |
| 149 | +- **make audit**: <100ms (snapshot render) |
| 150 | +- **make audit-offline**: <200ms (with hints) |
| 151 | +- **Single tool**: <50ms |
| 152 | + |
| 153 | +### Optimization Tips |
| 154 | +- Use snapshot-based workflow (separate collect/render) |
| 155 | +- Enable FAST_MODE for development: `CLI_AUDIT_FAST=1` |
| 156 | +- Disable unnecessary features: `CLI_AUDIT_TIMINGS=0`, `CLI_AUDIT_PROGRESS=0` |
| 157 | +- Increase MAX_WORKERS if more CPU cores: `CLI_AUDIT_MAX_WORKERS=32` |
| 158 | + |
| 159 | +## Development Environment |
| 160 | + |
| 161 | +### Recommended Tools for Development |
| 162 | +- **pyflakes**: Linting (make lint) |
| 163 | +- **mypy**: Type checking (optional, make lint-types) |
| 164 | +- **black**: Formatting (optional, make format) |
| 165 | +- **isort**: Import sorting (optional, make format) |
| 166 | +- **shellcheck**: Shell script linting |
| 167 | +- **jq**: JSON manipulation and validation |
| 168 | + |
| 169 | +### Optional Setup |
| 170 | +```bash |
| 171 | +# Install development dependencies |
| 172 | +pip install -e ".[dev]" |
| 173 | + |
| 174 | +# Or with uv |
| 175 | +uv pip install -e ".[dev]" |
| 176 | + |
| 177 | +# Enable direnv (optional) |
| 178 | +direnv allow |
| 179 | +``` |
| 180 | + |
| 181 | +### Editor Configuration |
| 182 | +- **EditorConfig**: .editorconfig present (4 spaces, LF, UTF-8, trim trailing) |
| 183 | +- **VSCode**: Respect EditorConfig, install Python extension |
| 184 | +- **Vim/Neovim**: Use editorconfig plugin |
| 185 | +- **IntelliJ/PyCharm**: EditorConfig support built-in |
| 186 | + |
| 187 | +## Future Work (Phase 2 Complete, Phase 3 Planned) |
| 188 | + |
| 189 | +### Phase 2 Status (Complete) |
| 190 | +- [x] Context-aware installation management |
| 191 | +- [x] Breaking change detection |
| 192 | +- [x] Installation reconciliation |
| 193 | +- [x] Bulk operations |
| 194 | +- [x] Configuration file support |
| 195 | +- [x] Upgrade workflows |
| 196 | + |
| 197 | +### Phase 3 (Planned) |
| 198 | +- [ ] Advanced dependency resolution |
| 199 | +- [ ] Rollback mechanisms |
| 200 | +- [ ] Integration tests |
| 201 | +- [ ] CI/CD pipeline |
| 202 | +- [ ] Performance benchmarks |
| 203 | +- [ ] Additional package managers |
| 204 | + |
| 205 | +See [docs/PRD.md](docs/PRD.md) for comprehensive Phase 2 specifications. |
| 206 | + |
| 207 | +## Contributing Notes |
| 208 | + |
| 209 | +### PR Size Guidelines |
| 210 | +- **Ideal**: ~≤300 net LOC changed |
| 211 | +- **Rationale**: Easier to review, faster to merge, lower risk |
| 212 | +- **Large changes**: Break into multiple PRs when possible |
| 213 | + |
| 214 | +### Review Process |
| 215 | +1. Self-review checklist (see task_completion_checklist.md) |
| 216 | +2. CI checks pass (when added) |
| 217 | +3. Documentation updated in same PR |
| 218 | +4. No secrets or credentials committed |
| 219 | +5. Conventional commit messages |
| 220 | +6. Linked to issue/ticket if applicable |
| 221 | + |
| 222 | +### Communication |
| 223 | +- **Issues**: GitHub Issues for bugs, features, discussions |
| 224 | +- **PRs**: Clear description, link to issue, changelog section |
| 225 | +- **Commits**: Self-documenting with Conventional Commits format |
0 commit comments