Skip to content

fix: default-org output#981

Merged
mbevc1 merged 2 commits into
mainfrom
20260629_fix_default-org
Jun 29, 2026
Merged

fix: default-org output#981
mbevc1 merged 2 commits into
mainfrom
20260629_fix_default-org

Conversation

@mbevc1

@mbevc1 mbevc1 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Remove to many spaces and be specific which default Org it is.

@mbevc1 mbevc1 added the enhancement New feature or request label Jun 29, 2026
@claude

claude Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Claude finished @mbevc1's task in 1m 20s —— View job


Review: fix: default-org output

  • Read changed files
  • Run static analysis (go build ./..., go vet ./cmd/kosli/ — both pass)
  • Verify tests align with code change
  • Post review

The earlier review flagged that changing the label to Default user organization: would break the three test assertions still expecting Default organization:. The follow-up commit (fix: default-org output - update tests) resolves this — all three assertions are now updated:

  • getDefaultOrg_test.go:21"Default user organization:"
  • getDefaultOrg_test.go:32Default user organization:\s+\(none set\)
  • getDefaultOrg_test.go:62Default user organization:\s+test-org

So code and tests are back in sync. ✅

Findings

1. \t → literal space (getDefaultOrg.go:92). Switching "...:\t" to "...: " means tabFormattedPrint's tabwriter no longer expands a column, so the output is now a single space rather than tab-aligned. This is fine here — it's a single one-line row with no header, so there's nothing to align against. The two \s+ regex assertions still match a single space, and the require.Contains check on line 21 matches the substring. No issue.

2. Label wording. Default user organization: reads clearly and matches the command's own description (Get the default organization for the current user.). Good, addresses the "be specific which default Org it is" goal in the PR description.

3. Stray blank line (getDefaultOrg.go:93-94). The diff adds a blank line between tabFormattedPrint(...) and return nil. Purely cosmetic — harmless, though gofmt won't complain either way.

Static analysis

Check Result
go build ./... ✅ pass
go vet ./cmd/kosli/ ✅ pass

I couldn't execute go test (command requires approval in this environment / suite tests need the local Kosli server), but the assertions match the new output string by inspection, so they should pass in CI.

Summary

Small, well-scoped fix. The label change is sensible, the spacing cleanup is correct, and — importantly — the test assertions were updated in the same PR so nothing breaks. Looks good to merge. Only nit is the optional stray blank line at getDefaultOrg.go:93.
· 20260629_fix_default-org

Comment thread cmd/kosli/getDefaultOrg.go
@mbevc1 mbevc1 enabled auto-merge (squash) June 29, 2026 16:23
@mbevc1 mbevc1 merged commit d5f53d0 into main Jun 29, 2026
20 checks passed
@mbevc1 mbevc1 deleted the 20260629_fix_default-org branch June 29, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants