oracle / oracle/oci-cli

duplicate results with group listing

Open
#963 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

IAM
Dominant language
Python
Stars
669
Forks
236
Avg merge
1m
Merged PRs (30d)
4

Description

I am trying to export all groups with their members to JSON so I can determine groups which may or may not be in use. We have multiple domains set up at my company, so I picked one with the fewest groups to build my query. The domain in question has 2 groups in it.
When I run my query, with the "--all" parameter, it never completes. I let it run for 30+ minutes and no results were returned to screen.
I changed the --all parameter to --limit 2 and it came back very fast which made me happy as I could script that out and I'd be good, but this was not a realistic approach for other domains where group numbers are inconsistent and growing.
So I decided to try a large number for the limit knowing that there are only 2 groups in that domain - I set it to 1000 thinking it should still be quick with a limit 1000 for 2 groups but nope - it sat there thinking for 20 minutes before I cancelled it.
Dropped that 1000 down to 100 and it completed in a few minutes, but instead of giving me 2 results, I got 100 rows. So loaded up the JSON to see and there are 67 records BUT if I expand all of the elements in there that I extracted (members and owners), 100 rows are in the output.
So, the only way to get the proper number of rows back is for me to limit it to 2, but that means I need to check how many rows I should be getting back prior to requesting everything which is a bit silly, no? I mean, it's not THAT hard to do, but feels like overkill.

Note - this works fine using --all with users with the query I have in place but with groups it is just unhappy.
My full command is:
`set query="data.resources[].{GroupName: "display-name" }"

oci identity-domains groups list --endpoint %endpoint% --attribute-sets all --query %query% --output json --config-file c:\users\.oci\config --profile DEFAULT --limit 100
`

Plus I define my endpoint, but I'd rather not publish my endpoint. I reduced my query down to just the display-name for testing purposes and I get 67 rows back with that above query. My actual query has a lot more details than that.

EDIT - edited to remove my username from the command for the config file for privacy reasons.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported oci identity-domains groups list command and compare its --all, --limit 2, and --limit 100 behavior using the reduced display-name query. Trace the group-listing pagination and JSON query handling, then verify that --all completes and returns one result per group rather than duplicate expanded member or owner rows.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.