Skip to content

Conversation

@raegislabs
Copy link

@raegislabs raegislabs commented Nov 7, 2025

Dependencies

Summary

Adds first‑class Project Milestones management to linctl with complete CLI coverage:

  • milestone create/list/get/update/delete
  • Date validation (YYYY‑MM‑DD)
  • Progress/status reporting in list/get
  • Plaintext and JSON output modes

Motivation

Project managers need to plan and track delivery against milestones from the terminal. Prior PRs enabled project creation, updates, and richer display, but there was no way to manage project‑scoped milestones via CLI.

Changes

New Features

  • linctl milestone create --project <id> --name <name> [--target-date YYYY-MM-DD] [--description <text>]
  • linctl milestone list <project-id> [--include-archived]
  • linctl milestone get <milestone-id>
  • linctl milestone update <milestone-id> [--name <name>] [--target-date <date>] [--description <text>]
  • linctl milestone delete <milestone-id>

Implementation Details

  • pkg/api/queries.go
    • Add ProjectMilestone and ProjectMilestones types
    • Add GraphQL operations: ListProjectMilestones, GetProjectMilestone, CreateProjectMilestone, UpdateProjectMilestone, DeleteProjectMilestone
  • cmd/milestone.go
    • Add Cobra command group and subcommands
    • Validation for required flags and target date format
    • Rich plaintext/JSON/table rendering
  • cmd/milestone_test.go
    • Mock client via interface injection
    • Stdout capture tests for create/update/delete flows

Usage Examples

# Create
linctl milestone create --project 3c7b1d1a-1234-5678-9abc-dededededede --name "Sprint 1" --target-date 2025-12-31

# List
linctl milestone list 3c7b1d1a-1234-5678-9abc-dededededede

# Get
linctl milestone get ms-123

# Update
linctl milestone update ms-123 --name "Sprint 1 (Updated)" --target-date 2026-01-15

# Delete (archive)
linctl milestone delete ms-123

Validation

  • Target date must match YYYY‑MM‑DD (explicit error if invalid)
  • Create requires --project and --name
  • Update requires at least one of: --name, --description, --target-date

Testing

Unit Tests

  • Milestone create/update/delete flows with mock client and stdout capture
  • Dependency injection pattern to avoid network/API calls

Smoke/Build

  • go test ./... passes
  • make fmt applied

Breaking Changes

None – all changes are additive.

Architecture Notes

  • Adheres to existing dependency injection style (milestoneAPI interface)
  • Follows Cobra command patterns and output conventions (plaintext/JSON)
  • Uses cmd.Flags().Changed() for partial updates (send only changed fields)

Checklist

  • Tests added and passing
  • Code follows existing patterns
  • Help text comprehensive and matches behavior
  • Manual sanity checks performed
  • No breaking changes
  • Smoke tests passing
  • References RAE-362 (Project Management Epic 1)

Contributor Checklist (Contributing.md)

  • Go 1.22+ environment
  • make deps as needed
  • make fmt applied
  • make test passes (read‑only smoke tests)
  • No release actions in this PR (handled on tag per Release Checklist)

raegislabs and others added 6 commits November 6, 2025 13:04
Add --project flag to issue create and update commands to enable
project assignment/removal from the CLI without switching to Linear UI.

Features:
- Add --project flag accepting project UUID or 'unassigned'
- UUID format validation before API calls
- Improved error messages for invalid projects
- Project display in all output formats (table, plaintext, JSON)

Technical changes:
- cmd/issue.go: Flag registration, input building, error handling
- pkg/api/queries.go: GraphQL mutations include project field
- cmd/*_test.go: Unit tests for flag parsing and validation

All acceptance criteria tested and passing.

Story: 1.1 - Issue-Project Assignment
Status: review → in-progress (addressing review feedback)
Story completed for personal use and testing. Will consider contributing
upstream PR after thorough testing period.
- Add CreateProject() and ArchiveProject() API methods
- Implement project create command with validation
- Implement project archive command with name output
- Add comprehensive tests for API and CLI
- Enhanced GetTeam to support key lookup with ID fallback
- All acceptance criteria met (AC #1-dorkitude#7)

Closes Story 1.2

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit implements comprehensive project update functionality and enhances
display of project information in list and detail views.

## What's New

**Project Update Command:**
- Added `linctl project update PROJECT-UUID` command
- Multi-field update support: name, description, state, priority
- Partial update pattern using cmd.Flags().Changed()
- Comprehensive validation for state and priority values
- Clear error messages when no fields provided or invalid values

**Enhanced Display:**
- project list: Added State and Priority columns
- project get: Shows state, priority, initiatives, labels, description
- All output formats supported: table, JSON, plaintext

**API Client:**
- Added UpdateProject() method with GraphQL mutation
- Enhanced GetProject query to include initiatives, labels
- Enhanced GetProjects query to include priority field
- Fixed initiatives field structure (connection type, not singular)

## Technical Details

**Validation:**
- State: planned, started, paused, completed, canceled
- Priority: 0-4 (None, Urgent, High, Normal, Low)

**Architecture:**
- Dependency injection pattern maintained (projectAPI interface)
- Flag change detection for partial updates
- Mock updated for testing

## Test Results

✅ 10/11 acceptance criteria passing
❌ AC 3.2 (shortSummary update) - Linear API limitation

**Tested:**
- Single/multi-field updates
- Input validation (state, priority)
- Error handling
- Enhanced display in all formats
- Unit tests pass

## Known Limitations

Linear's ProjectUpdateInput does NOT support shortSummary field.
This is an API limitation, not an implementation issue.

## Files Modified

- pkg/api/queries.go: UpdateProject method, enhanced queries, Initiatives type
- cmd/project.go: projectUpdateCmd, enhanced display, updated interface
- cmd/project_cmd_test.go: Mock UpdateProject method
- docs-bmad/*: Story completion and status tracking

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

Co-Authored-By: Claude <noreply@anthropic.com>
@raegislabs raegislabs changed the title feat: add project milestones management (CRUD) feat: Project Milestones – CLI CRUD Nov 7, 2025
memyselfandm pushed a commit to memyselfandm/linctl that referenced this pull request Dec 7, 2025
@enkoder
Copy link

enkoder commented Jan 6, 2026

would love to see this hit main

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