fedora-infra / fasjson

GNU General Public License v3.0
8 stars 15 forks source link

How to get fields from all users in a specific group? #447

Open phsmoura opened 1 year ago

phsmoura commented 1 year ago

Is it possible to get username, human_name and website fields from all users in a specific group? This would be used in Fedora Planet to create the planet.ini file. The way it is now, the idea is to query members from the group and then query each user to get its info.

As we have +5k users in fedora-contributor, not all of them have website and it's needed to query 2 endpoints: Would be possible to add an endpoint to get that info easier? Or does an endpoint with this info already exist? Or the idea of querying the group members first and then each user is really the one that should be used?

abompard commented 1 year ago

Yes, you can use the X-Fields header to select the fields you want:

curl -u : --negotiate \
  'https://fasjson.fedoraproject.org/v1/groups/fedora-contributor/members/?page_number=1' \
  -H 'X-Fields: username,human_name,website'

Would this work for you?

phsmoura commented 1 year ago

Thanks! Yes, that will work

abompard commented 1 year ago

Leaving the issue opened to add this example to the documentation

ginjardev commented 3 months ago

@abompard can this issue be assigned to me? I just wanted to let you know that I can get this done. I'm an Outreachy intern.

abompard commented 3 months ago

Sure, could you try assigning it to yourself using the link on the top of the right column? Thanks.

ginjardev commented 3 months ago

@abompard sorry, I currently do not have access to assign this to myself. Can you please help?

onyiipaula commented 3 months ago

Hello i'm an outreachy intern and i would love to be assigned to this

anshikavashistha commented 3 months ago

I want to work on this @phsmoura .Please assign me

Precious000 commented 3 months ago

Hi @abompard can you please assign this project to me? I’ll really appreciate, thanks!

abompard commented 3 months ago

I've assigned it to you @ginjardev , please tell me if you're no longer interested in this ticket.

ginjardev commented 3 months ago

I'm still interested and working on it. I'll send a PR soon.

On Mon, 11 Mar 2024, 7:20 am Aurélien Bompard, @.***> wrote:

I've assigned it to you @ginjardev https://github.com/ginjardev , please tell me if you're no longer interested in this ticket.

— Reply to this email directly, view it on GitHub https://github.com/fedora-infra/fasjson/issues/447#issuecomment-1987768498, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2UUMYB37HRISY4HAMKYILYXVLMDAVCNFSM6AAAAAAVFA257OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBXG43DQNBZHA . You are receiving this because you were mentioned.Message ID: @.***>