Skip to content

feat: allow resolving users by ID - #483

Merged
nieomylnieja merged 6 commits into
mainfrom
get-user-by-id
Jun 16, 2026
Merged

feat: allow resolving users by ID#483
nieomylnieja merged 6 commits into
mainfrom
get-user-by-id

Conversation

@nieomylnieja

@nieomylnieja nieomylnieja commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Allow resolving user details by their IDs.

Summary

Added sloctl get user USER_ID... to resolve one or more users through the Nobl9 Go SDK users endpoint and print matching user details.

Updated the Nobl9 Go SDK dependency to the version that provides the users lookup API.

Added Bats e2e coverage for resolving the current configured user through the CLI.

Related Changes

nobl9/nobl9-go#943

Testing

Added Bats e2e coverage for sloctl get user using the current configured user ID.

Live Bats e2e tests were not run because they talk to the Nobl9 platform API and require explicit permission per AGENTS.md.

Release Notes

Added sloctl get user command to resolve user details for one or more user IDs. No user IDs results in returning all users.

Comment thread internal/get.go
nieomylnieja added a commit to nobl9/nobl9-go that referenced this pull request Jun 12, 2026
## Motivation

The underlying API already allows fetching multiple users. To make
fetching multiple users easier and faster for SDK callers, this PR adds
a dedicated method for that API capability.

## Summary

- Added `GetUsers(ctx, GetUsersRequest)` to the users v2 endpoint and
generated interface, returning `[]User`.
- Added `IDs []string` request filtering while keeping `GetUser` on the
existing phrase lookup path.
- Extended e2e coverage for fetching the current user through the
ID-list lookup.

## Related Changes

nobl9/sloctl#483

## Testing

- Added `Test_Users_V2_GetUsers` e2e coverage for fetching the current
user by ID list.
- Verified the new e2e test against the configured Nobl9 environment.

## Release Notes

Added `GetUsers` to the Go SDK users v2 endpoint for fetching users by
ID list.
Remove the required user ID check so `get user` can return all users.
Add coverage for the new behavior and normalize shell heredoc spacing in tests.
Support `get user` with no positional arguments by returning all users up to a configurable limit.
This also adds a `--limit` flag and coverage for the limited listing behavior.
nieomylnieja added a commit to nobl9/nobl9-go that referenced this pull request Jun 16, 2026
## Motivation

Allow `GetUsers` to pass a `limit` query parameter through the SDK.
Without it the API is limited to 100 results and there's no way to
circumvent it.

## Related changes

nobl9/sloctl#483

## Testing

Expanded users v2 tests to cover fetching all users and limiting
results.

## Release Notes

`GetUsers` now supports a limit parameter.
Allow `get` commands to combine piped input with positional arguments for
resource and user lookups, and add coverage for stdin-based project queries.
Only set the users limit when listing all users or when `--limit` is provided.
This lets `get user <id>` return requested IDs without being constrained by the default page size.
@nieomylnieja
nieomylnieja merged commit 38109bd into main Jun 16, 2026
5 checks passed
@nieomylnieja
nieomylnieja deleted the get-user-by-id branch June 16, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants