Skip to content

feat(jtk): add dashboard management commands#165

Merged
piekstra merged 1 commit intomainfrom
feat/147-dashboard-management
Feb 18, 2026
Merged

feat(jtk): add dashboard management commands#165
piekstra merged 1 commit intomainfrom
feat/147-dashboard-management

Conversation

@piekstra
Copy link
Contributor

Summary

  • Add dashboards command group with list, get, create, delete subcommands
  • Add nested dashboards gadgets subcommand group with list and remove
  • list supports --search for filtering by name and --max for pagination
  • get displays dashboard details along with its gadgets in a table
  • All commands support JSON output via -o json

Test plan

  • Unit tests for all API methods (api/dashboards_test.go)
  • Unit tests for all command handlers (internal/cmd/dashboards/dashboards_test.go)
  • go test ./... passes
  • golangci-lint run passes
  • Manual testing with a live Jira instance

Closes #147

@piekstra piekstra force-pushed the feat/147-dashboard-management branch from e42b570 to 41c9648 Compare February 18, 2026 18:35
Add commands for managing Jira dashboards and their gadgets:
- dashboards list (with --search and --max flags)
- dashboards get <id> (shows details + gadgets)
- dashboards create --name <name> [--description <desc>]
- dashboards delete <id>
- dashboards gadgets list <dashboard-id>
- dashboards gadgets remove <dashboard-id> <gadget-id>

Closes #147
@piekstra piekstra force-pushed the feat/147-dashboard-management branch from 41c9648 to c755721 Compare February 18, 2026 18:39
@piekstra piekstra merged commit 00eb935 into main Feb 18, 2026
7 checks passed
@piekstra piekstra deleted the feat/147-dashboard-management branch February 18, 2026 18:41
rianjs added a commit that referenced this pull request Feb 19, 2026
…DS.md

Bring the dashboards (#165), links (#164), and text packages — added to
main after the branch diverged — into alignment with the project coding
standards applied by earlier commits in this branch:

- Replace c.get/post/delete helpers with context-aware c.Get/Post/Delete
- Convert testify assertions to shared/testutil helpers
- Add _ = to unhandled json.NewEncoder errors (gosec G104)
- Rename unused cmd/r parameters to _ (revive unused-parameter)
- Add package doc comments (revive package-comments)
- Wire context.Context through changeIssueType
rianjs added a commit that referenced this pull request Feb 23, 2026
* refactor: replace testify with stdlib test helpers

Replace all testify/assert and testify/require usage across 69 test
files with shared/testutil assertion helpers. This aligns with
STANDARDS.md Section 14: no testify, no gomega, no ginkgo.

- Add shared/testutil/assert.go with Equal, NoError, Contains, True,
  False, Nil, NotNil, Len, Empty, and Require* variants
- Convert all test files in shared/, tools/cfl/, and tools/jtk/
- Remove testify dependency from all three go.mod files
- Add STANDARDS.md to repo root
- Update docs to reference shared/testutil

Refs #159

* refactor: add context.Context to jtk API methods

Remove hardcoded context.Background() convenience wrappers from the jtk
API client and add context.Context as the first parameter to all 58+
exported API methods, matching the pattern already used by the cfl tool.
Update all command callers to pass cmd.Context() and all tests to pass
context.Background().

* refactor: use noun-phrase error wrapping per STANDARDS.md

Replace "failed to X:" error context with gerund noun phrases ("Xing:")
across all 56 source files and 16 test files. Convert sentinel errors
in jtk/api/client.go from fmt.Errorf to errors.New.

* refactor: enable revive, gosec, errorlint, exhaustive linters

Add revive, gosec, errorlint, and exhaustive to golangci-lint configs
for all three modules (shared, cfl, jtk) per STANDARDS.md Section 1.

Fix all violations:
- errorlint: use errors.Is() instead of == for error comparisons
- exhaustive: add missing cases to switch statements
- gosec: handle errors from w.Write/json.Encode in test handlers,
  use restrictive file permissions (0600/0750), add nolint for
  intentional os.Open/exec.Command usage
- revive: rename unused parameters to _, add package doc comments,
  fix exported type/const documentation, add nolint for intentional
  api package name

Refs #159

* test: add tests for 7 untested jtk command packages

Add comprehensive test coverage for all previously untested jtk
command packages:

- root: command structure, flags, defaults, View(), SetAPIClient()
- boards: list (table/JSON/empty), get (table/JSON/invalid ID)
- completion: bash/zsh/fish/powershell shell completion output
- me: table/JSON/plain output, email handling, auth failure
- users: search (table/JSON/empty, active/inactive filtering)
- sprints: list/current/issues/add with table/JSON/empty/error cases
- attachments: list/add/get/delete with file I/O and API mocking

58 new tests total, all using httptest and shared/testutil assertions.

Refs #159

* refactor: add tidy/check targets to Makefiles and CI

Add `make check` (tidy, lint, test, build) as the CI gate target per
STANDARDS.md. Add `make tidy` with dirty-check to all three Makefiles.
Root `make build` now outputs to bin/. CI jobs verify modules are tidy
before building.

* fix: correct sentinel errors and wire context through HTTP calls

- Fix jtk client.go returning ErrNotFound instead of ErrURLRequired for
  empty URL; add errors.Is assertions to client tests
- Wire context.Context through jtk AddAttachment and DownloadAttachment
  (previously discarded ctx and used http.NewRequest)
- Add context.Context parameter to GetCloudID and AutomationBaseURL;
  remove context.Background() from internal GetCloudID call
- Wire context through cfl verifyConnection using
  http.NewRequestWithContext

* refactor: add signal handling and propagate context through commands

Add signal.NotifyContext with SIGINT/SIGTERM to both main.go entry
points so Ctrl+C cancels in-flight operations cleanly. Use
ExecuteContext(ctx) to propagate the signal-aware context through
the Cobra command chain. Update all cfl run* functions and their
tests to accept and pass context.Context as the first parameter.

* refactor: use sentinel errors, wrap bare returns, fix verb-phrase wrapping

Add six new sentinel errors to jtk api/errors.go for validation:
ErrAttachmentIDRequired, ErrFilePathRequired, ErrAttachmentRequired,
ErrAttachmentContentMissing, ErrCommentIDRequired, ErrTaskIDRequired.

Replace all fmt.Errorf("X is required") with sentinel errors across
both tools. Wrap ~60 bare `return err` statements with noun-phrase
context (e.g., "fetching issue: %w"). Fix verb-phrase wrapping like
"request failed: %w" to noun-phrase style "uploading attachment: %w".

* refactor: replace interface{} with any, fix deprecated strings.Title, pre-allocate slices

- Replace interface{} with any across all Go files in both tools
- Replace deprecated strings.Title with cases.Title from golang.org/x/text
- Pre-allocate row slices in list/search commands where collection size is known
- Use nil slice instead of empty literal in configcmd/clear.go
- Fix gofmt formatting issues from prior phases

* refactor: route diagnostic and interactive output to stderr

Move confirmation prompts, status messages, and verbose logging from
stdout to stderr so stdout remains clean for pipeable structured data.

* refactor: align with STANDARDS.md — error wrapping, test hygiene, race fix

- Wrap 21 bare error returns with context (19 in jtk/api, 2 in cfl/api)
- Fix 3 "failed to" prefixes to verb-phrase error wrapping
- Remove log.Printf from parser.go (warnings stored in struct)
- Document intentional error discard in shared/errors
- Add t.Helper() to 5 cfl test helpers
- Add t.Parallel() to ~900 test functions across all 3 modules
- Fix data race: remove global color.NoColor mutation in view.New()
- Fix cfl/go.mod: golang.org/x/text indirect→direct

* refactor: align remaining code with STANDARDS.md

- Replace interface{} with any across shared packages (client, view,
  testutil, adf)
- Add ctx.Err() checks to pagination loops in SearchAll and
  ListAutomationRules for cancellation responsiveness
- Add t.Parallel() to test functions without shared mutable state
- Fix race condition in automation_test.go pagination counter using
  sync/atomic
- Add package doc comment to jtk api package
- Wrap bare error return in APIError.UnmarshalJSON

* refactor: align new dashboards, links, and text packages with STANDARDS.md

Bring the dashboards (#165), links (#164), and text packages — added to
main after the branch diverged — into alignment with the project coding
standards applied by earlier commits in this branch:

- Replace c.get/post/delete helpers with context-aware c.Get/Post/Delete
- Convert testify assertions to shared/testutil helpers
- Add _ = to unhandled json.NewEncoder errors (gosec G104)
- Rename unused cmd/r parameters to _ (revive unused-parameter)
- Add package doc comments (revive package-comments)
- Wire context.Context through changeIssueType
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.

jtk: dashboard management (list, gadgets, filters)

1 participant