Skip to content

Add explicit contexts and OAuth-backed Jira Assets - #74

Merged
Hinne1 merged 8 commits into
mainfrom
claude/assets-oauth
Aug 27, 2026
Merged

Add explicit contexts and OAuth-backed Jira Assets#74
Hinne1 merged 8 commits into
mainfrom
claude/assets-oauth

Conversation

@Hinne1

@Hinne1 Hinne1 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add invocation-scoped --context <alias-or-hostname> / ATLASSIAN_CONTEXT routing without mutating current_host
  • move Jira Assets reads from API-token Basic auth to the selected site's OAuth token through Atlassian's cloud gateway
  • add jira assets object <id> with attribute-preserving JSON output and expose token scopes in auth status --json
  • request the two CMDB read scopes and document explicit per-host reauthentication
  • update all copy-paste API examples to carry an explicit context

Supports the Assets-field migration tracked in NX-16111.

Verification

  • goimports -w .
  • golangci-lint run (0 issues)
  • go test -v across all package groups
  • final go test ./...
  • live sandbox OAuth AQL and object reads, including returned object attributes
  • concurrent explicit prod Jira and sandbox Assets calls; persisted context remained sandbox
  • Council review round 2: approve

Release

After merge, tag v1.13.0; the tag-triggered GoReleaser workflow publishes binaries and updates the Homebrew tap.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request transitions the Jira Assets (CMDB) client from Basic authentication to OAuth 2.0, adding the necessary scopes and updating setup instructions. It also introduces a global --context flag and ATLASSIAN_CONTEXT environment variable to allow process-local host overrides without mutating the shared configuration file. Additionally, a new assets object subcommand is added to retrieve and display a specific Assets object and its attributes. Feedback on the new subcommand suggests explicitly checking for nil attribute values to prevent printing the literal string "" in the CLI output.

Comment thread internal/cmd/assets/object.go Outdated
@hinne-enthus-bot

Copy link
Copy Markdown

/gemini review

@hinne-enthus-bot

Copy link
Copy Markdown

🔏 Readiness attested — the pr-readiness-check gate completed for PR #74 at 76dd99e4f69ca7862bc65236f78f22145681e2dd (2026-08-27T13:32:27Z). If the branch head has moved, this evidence covers the earlier state only.

Readiness summary

PR Readiness Check (#74, 76dd99e)
Branch/base PASS — claude/assets-oauth -> main; mergeable and synchronized
Local verification PASS — goimports, golangci-lint (0 issues), focused verbose tests, and go test ./...
Remote CI DEFERRED UNTIL READY — current-head CodeQL passed; Go lint/test/build/coverage are draft-gated
Coverage DEFERRED UNTIL READY — coverage workflow is draft-gated
Automated reviewers LIMITATION — prior Gemini finding fixed and thread resolved; current-head bot-triggered review produced no Gemini response
Review threads PASS — zero unresolved threads
Council findings DISPOSITIONED — all useful correctness/security findings fixed; remaining standalone reentrancy/interface observations are advisory
PR description PASS — scope, testing, Jira migration dependency, and release order documented
SQL/UI evidence SKIP — CLI/API and documentation change; no SQL or browser UI
Result: READY

@Hinne1
Hinne1 marked this pull request as ready for review August 27, 2026 13:33
@github-actions

Copy link
Copy Markdown

Merging this branch changes the coverage (1 decrease, 5 increase)

Impacted Packages Coverage Δ 🤖
github.com/enthus-appdev/atl-cli/internal/api 41.10% (+2.64%) 👍
github.com/enthus-appdev/atl-cli/internal/auth 32.63% (+0.53%) 👍
github.com/enthus-appdev/atl-cli/internal/cmd 59.55% (+1.58%) 👍
github.com/enthus-appdev/atl-cli/internal/cmd/assets 13.86% (+13.86%) 🎉
github.com/enthus-appdev/atl-cli/internal/cmd/auth 14.35% (-0.14%) 👎
github.com/enthus-appdev/atl-cli/internal/cmd/config 0.00% (ø)
github.com/enthus-appdev/atl-cli/internal/cmd/doctor 0.00% (ø)
github.com/enthus-appdev/atl-cli/internal/config 67.50% (+1.27%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/enthus-appdev/atl-cli/internal/api/assets.go 56.25% (+56.25%) 64 (-4) 36 (+36) 28 (-40) 🌟
github.com/enthus-appdev/atl-cli/internal/api/client.go 48.35% (+2.42%) 182 (+10) 88 (+9) 94 (+1) 👍
github.com/enthus-appdev/atl-cli/internal/auth/oauth.go 1.27% (+1.27%) 79 1 (+1) 78 (-1) 👍
github.com/enthus-appdev/atl-cli/internal/cmd/assets/aql.go 0.00% (ø) 29 0 29
github.com/enthus-appdev/atl-cli/internal/cmd/assets/assets.go 0.00% (ø) 15 (-17) 0 15 (-17)
github.com/enthus-appdev/atl-cli/internal/cmd/assets/count.go 0.00% (ø) 21 0 21
github.com/enthus-appdev/atl-cli/internal/cmd/assets/object.go 38.89% (+38.89%) 36 (+36) 14 (+14) 22 (+22) 🌟
github.com/enthus-appdev/atl-cli/internal/cmd/auth/setup.go 0.00% (ø) 137 (+2) 0 137 (+2)
github.com/enthus-appdev/atl-cli/internal/cmd/auth/status.go 18.97% (-0.68%) 58 (+2) 11 47 (+2) 👎
github.com/enthus-appdev/atl-cli/internal/cmd/config/current_context.go 0.00% (ø) 22 (+1) 0 22 (+1)
github.com/enthus-appdev/atl-cli/internal/cmd/doctor/doctor.go 0.00% (ø) 93 (+1) 0 93 (+1)
github.com/enthus-appdev/atl-cli/internal/cmd/root.go 59.55% (+1.58%) 89 (+20) 53 (+13) 36 (+7) 👍
github.com/enthus-appdev/atl-cli/internal/config/config.go 67.50% (+1.27%) 80 (+3) 54 (+3) 26 👍

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/enthus-appdev/atl-cli/internal/api/assets_test.go
  • github.com/enthus-appdev/atl-cli/internal/api/client_test.go
  • github.com/enthus-appdev/atl-cli/internal/auth/oauth_test.go
  • github.com/enthus-appdev/atl-cli/internal/cmd/assets/object_test.go
  • github.com/enthus-appdev/atl-cli/internal/cmd/auth/status_test.go
  • github.com/enthus-appdev/atl-cli/internal/cmd/root_test.go
  • github.com/enthus-appdev/atl-cli/internal/config/config_test.go

@Hinne1
Hinne1 merged commit 77abc00 into main Aug 27, 2026
15 checks passed
@Hinne1
Hinne1 deleted the claude/assets-oauth branch August 27, 2026 13:40
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