Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This document provides foundational context, architectural principles, and opera
- IP Addresses: RFC 5737 documentation blocks (`192.0.2.0/24`, `198.51.100.0/24`, `203.0.113.0/24`) or loopback (`127.0.0.1` / `localhost`). Never publish concrete private RFC 1918 IP addresses in documentation.
- Registry Endpoints: `ghcr.io/<org>/<image>:<tag>` or `<registry-host>:<port>/<image>:<tag>`.
- Storage Mount Paths: `<storage-mount-path>`, `<fast-storage>`, standard Kubernetes PersistentVolumeClaims.
- **Mandatory Mock/Dummy Test Value Hostname Standardization**: Use the exact same hostname/domain name with no subdomain (`example.com`) for all mock/dummy test values across all tests, fixtures, mocks, and examples. Never introduce subdomains (such as `api.example.com`, `vault.example.com`, `test.example.com`, or `k8s.example.com`) for mock test endpoints or dummy data.
- **Configuration Template Hygiene (`config.example.yaml`) vs. User Runtime Config (`config.yaml`)**:
- Committed configuration templates (`config.example.yaml`) and documentation must strictly use generic documentation or localhost endpoints (`http://localhost:11434`, `http://localhost:6333`, `http://localhost:8080`), never private LAN hostnames, homelab endpoints, or internal IP addresses.
- **Strict Protection of User Runtime Config (`config.yaml`)**: The local `config.yaml` is uncommitted, gitignored, and belongs exclusively to the user's active runtime environment. AI agents and automated workflows **MUST NEVER** overwrite, sanitize, or reset the user's designated `ollama_urls`, inference hostnames, or custom ports in `config.yaml` to localhost. Sanitization rules apply solely to repository templates, committed code, tests, documentation, and task tracking files.
Expand Down
10 changes: 5 additions & 5 deletions config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,36 @@ workspace:
# ── Grafana ───────────────────────────────────────────────────────────────────
grafana:
# Grafana instance base URL.
# Example: https://grafana.example.com
# Example: https://example.com:3000
url: null
# Token: devops config set grafana.token <value>

# ── Prometheus ────────────────────────────────────────────────────────────────
prometheus:
# Prometheus base URL.
# Example: https://prometheus.example.com
# Example: https://example.com:9090
# Note: set DEVOPS_CLI_AI_ALLOW_PRIVATE_NETWORK=true for cluster-internal URLs.
url: null

# ── ArgoCD ────────────────────────────────────────────────────────────────────
argocd:
# ArgoCD server base URL.
# Example: https://argocd.example.com
# Example: https://example.com:8080
# Note: set DEVOPS_CLI_AI_ALLOW_PRIVATE_NETWORK=true for cluster-internal URLs.
url: null
# Token: devops config set argocd.token <value>

# ── Qdrant Vector Store ───────────────────────────────────────────────────────
qdrant:
# Qdrant server base URL for Retrieval-Augmented Generation (RAG).
# Example: http://localhost:6333 or https://qdrant.example.com
# Example: http://localhost:6333 or https://example.com:6333
url: http://localhost:6333
collection_prefix: devops

# ── Jaeger Tracing ────────────────────────────────────────────────────────────
jaeger:
# Jaeger Query UI base URL for viewing OpenTelemetry traces.
# Example: http://localhost:16686 or https://jaeger.example.com
# Example: http://localhost:16686 or https://example.com:16686
url: http://localhost:16686

# ── Telemetry ─────────────────────────────────────────────────────────────────
Expand Down
3 changes: 2 additions & 1 deletion docs/agent/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
| [#121](https://github.com/dan-petty/devops-cli/issues/121) | TBD | Centralized logging perimeter hardening and Fluent Bit namespace scoping | `Ready` | Backlog |
| [#165](https://github.com/dan-petty/devops-cli/issues/165) | [#166](https://github.com/dan-petty/devops-cli/pull/166) | Require draft pull requests for in-progress work | `In Review` | [`task-165-require-draft-prs-for-in-progress-work.md`](tasks/task-165-require-draft-prs-for-in-progress-work.md) |
| [#170](https://github.com/dan-petty/devops-cli/issues/170) | [#171](https://github.com/dan-petty/devops-cli/pull/171) | Automated PR monitoring for CI checks, Copilot reviews & review threads | `Done` | [`task-170-pr-monitor-copilot-checks.md`](tasks/task-170-pr-monitor-copilot-checks.md) |
| [#172](https://github.com/dan-petty/devops-cli/issues/172) | [#174](https://github.com/dan-petty/devops-cli/pull/174) | Configurable K8s context setting and conditional Minikube autostart | `In Review` | [`task-172-k8s-context-minikube-autostart.md`](tasks/task-172-k8s-context-minikube-autostart.md) |
| [#172](https://github.com/dan-petty/devops-cli/issues/172) | [#174](https://github.com/dan-petty/devops-cli/pull/174) | Configurable K8s context setting and conditional Minikube autostart | `Done` | [`task-172-k8s-context-minikube-autostart.md`](tasks/task-172-k8s-context-minikube-autostart.md) |
| [#175](https://github.com/dan-petty/devops-cli/issues/175) | [#173](https://github.com/dan-petty/devops-cli/pull/173) | Project field options synchronization, complete pagination & generic owner resolution | `In Review` | [`task-175-project-field-sync-pagination.md`](tasks/task-175-project-field-sync-pagination.md) |

---

Expand Down
46 changes: 46 additions & 0 deletions docs/agent/tasks/task-175-project-field-sync-pagination.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Task 175: Project Field Options Synchronization, Complete Pagination & Generic Owner Resolution

**Issue**: [#175](https://github.com/dan-petty/devops-cli/issues/175)
**PR**: [#173](https://github.com/dan-petty/devops-cli/pull/173)
**Status**: In Review
**Milestone**: `v0.2.17`
**Priority**: `priority/p1-high`
**Scope**: `scope/github`

---

## 1. Description & Architectural Objectives

Fix GitHub Projects v2 custom field synchronization to ensure single-select field options (specifically `In Review`, `Backlog`, `Ready`) defined in `.github/project-template.json` are automatically provisioned on existing project fields. Ensure full pagination across all GitHub API queries (`projectsV2/items`, `repos/issues`, `repos/pulls`), and generically resolve personal user vs organization project owners without hardcoded usernames.

### Key Objectives
1. **Single-Select Option Synchronization (`provision_remote_project_fields`)**:
- Inspect existing single-select fields from `field-list`.
- Detect missing options defined in `project-template.json` (such as `In Review` on default GitHub status fields).
- Update remote field options using GraphQL mutation `updateProjectV2Field` without overwriting existing options.
2. **Complete Pagination Across API Queries**:
- Add `--paginate` to `_fetch_project_item_urls` and support both `users/` and `orgs/` endpoints.
- Add `--paginate` and `per_page=100` to `_fetch_repository_issues` and `_fetch_repository_prs`.
3. **Generic Owner Resolution**:
- Implement `_resolve_project_owner_arg(owner)` using dynamic authenticated user detection (`gh api user --jq .login`).
- Eliminate hardcoded personal account usernames.
- Provide fallback retry in `_edit_project_item_field` for personal projects.
4. **Draft PR Warning in PR Monitor**:
- Display a warning rather than a generic error when PR is still a draft in `_handle_monitor_exit`.
5. **Comprehensive Testing**:
- Unit tests covering option synchronization, pagination, and dynamic owner resolution in `tests/test_github_projects.py`.

---

## 2. Implementation Checklist

- [x] Ground issue [#175](https://github.com/dan-petty/devops-cli/issues/175) in GitHub Projects tracking
- [x] Author dedicated task tracking file `docs/agent/tasks/task-175-project-field-sync-pagination.md`
- [x] Update `docs/agent/task.md` index
- [x] Implement dynamic owner resolution without hardcoded usernames in `src/devops_cli/github/projects.py`
- [x] Implement complete pagination for project items, repository issues, and pull requests
- [x] Implement single-select field options synchronization in `provision_remote_project_fields`
- [x] Update draft PR exit handler in `src/devops_cli/commands/pr.py`
- [x] Author comprehensive unit tests in `tests/test_github_projects.py`
- [x] Validate test suite and code coverage via `pytest`
- [x] Run `devops ci` quality gate
3 changes: 3 additions & 0 deletions src/devops_cli/commands/pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ def _handle_monitor_exit(result: Any, pr_number: int) -> None:
raise typer.Exit(1)

if result.exit_code == 2:
if getattr(result.status, "is_draft", False):
print_warning(result.message)
raise typer.Exit(2)
Comment thread
dan-petty marked this conversation as resolved.
Resolved
print_error(
ERRORS.pr.unresolved_threads.format(
number=pr_number,
Expand Down
Loading
Loading