Skip to content

Conversation

@raegislabs
Copy link

@raegislabs raegislabs commented Nov 6, 2025

Dependencies

Depends on #15 and PR #2 – completes the project management feature set.

Summary

Adds project update command with multi‑field support and enhances project display to show comprehensive information (state, priority, initiatives, labels).

Completes the project management trilogy started in PR #15 and PR #2.

Motivation

Users need to update project fields as work progresses and see complete project information in list/detail views. Currently, users can create and archive projects but cannot update fields like state, priority, or description from the CLI.

Changes

New Features

  • linctl project update command
    • Multi‑field update support in single command
    • Updateable fields: name, description, state, priority
    • Partial update pattern (only send changed fields)
    • Comprehensive validation
  • Enhanced project list
    • Added State column
    • Added Priority column
  • Enhanced project get
    • Shows state, priority, initiatives, labels, description
    • All output formats display complete information

Implementation Details

  • pkg/api/queries.go:
    • Add UpdateProject() method with GraphQL mutation
    • Enhance GetProject query (add initiatives, labels, description)
    • Enhance GetProjects query (add priority field)
  • cmd/project.go:
    • Add projectUpdateCmd with validation
    • Enhance table output formatters
    • Enhance plaintext/JSON output
    • Use cmd.Flags().Changed() for partial update detection
  • cmd/project_cmd_test.go: Update mock to support UpdateProject

Usage Examples

# Update single field
linctl project update <uuid> --state started
linctl project update <uuid> --priority 1
linctl project update <uuid> --name "New Project Name"

# Update multiple fields at once
linctl project update <uuid> --state completed --priority 0

# Update description
linctl project update <uuid> --description "Full project description here"

# View enhanced display
linctl project list
# Output table includes State and Priority columns

linctl project get <uuid>
# Shows: state, priority, initiatives, labels, description, team, dates

Validation

  • State validation: planned, started, paused, completed, canceled
  • Priority validation: 0–4 (0=None, 1=Urgent, 2=High, 3=Normal, 4=Low)
  • Required: At least one field must be provided for update
  • Clear error messages for invalid state/priority or missing fields

Testing

Unit Tests

  • UpdateProject API method
  • Enhanced GetProject/GetProjects queries
  • Mock updated for testing

Manual Testing

  • ✅ Single field updates (name, state, priority, description)
  • ✅ Multi‑field updates (state + priority)
  • ✅ Validation errors (no fields, invalid state, invalid priority)
  • ✅ Enhanced display in project list and project get
  • ✅ All output formats (table, JSON, plaintext)

Smoke/Build

  • make test (smoke tests) passing
  • make fmt applied

Breaking Changes

None – additive (new command, new columns, new fields in output).

Architecture Notes

  • Maintains dependency injection pattern (projectAPI interface)
  • Follows existing Cobra command patterns
  • Uses cmd.Flags().Changed() to detect explicit flag usage (vs defaults)
  • Partial update pattern only sends changed fields to API

Checklist

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)

Complete the project management feature set with multi-field updates
and comprehensive project information display.

Features:
- `linctl project update` with multi-field support
  - Update name, description, state, priority in single command
  - Flag change detection for partial updates
  - Comprehensive validation (state values, priority range)
- Enhanced `project list`: Added State and Priority columns
- Enhanced `project get`: Shows state, priority, initiatives, labels
- All output formats supported (table, JSON, plaintext)

Validation:
- State: planned, started, paused, completed, canceled
- Priority: 0-4 (None, Urgent, High, Normal, Low)
- At least one field required for update

Technical changes:
- pkg/api/queries.go: Add UpdateProject(), enhance GetProject/GetProjects
- cmd/project.go: Add projectUpdateCmd, enhance display formatters
- Use cmd.Flags().Changed() for partial update detection
- Enhanced mock for testing

Examples:
  linctl project update <uuid> --state started
  linctl project update <uuid> --state completed --priority 1
  linctl project update <uuid> --description "Updated description"
  linctl project list  # Now shows State and Priority

Note: shortSummary field update not supported by Linear GraphQL API.
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.

1 participant