rust-lang / team

Rust teams structure
Apache License 2.0
306 stars 285 forks source link

Add `people` field to the `permissions` API #1290

Closed Turbo87 closed 7 months ago

Turbo87 commented 7 months ago

This PR is similar to https://github.com/rust-lang/team/pull/1196, but adds the new fields to the v1 API instead of introducing a new API version.


The v1 permissions API can be misleading in that the order of the github_users does not match the order of the github_ids (see https://rust-lang.zulipchat.com/#narrow/stream/318791-t-crates-io/topic/team.20repo.20integration/near/412320079).

This change introduces a new people field on the permissions API which uses a list of objects instead of an object with multiple single-field lists. This allows us to easily show both GitHub login and ID of a person in the logs.

Example

{
  "people": [
    {
      "name": "Aaron Hill",
      "github": "Aaron1011",
      "github_id": 1408859,
      "discord_id": null
    },
    {
      "name": "Ed Page",
      "github": "epage",
      "github_id": 60961,
      "discord_id": null
    },
    {
      "name": "Jamie Hill-Daniel",
      "github": "clubby789",
      "github_id": 13556931,
      "discord_id": 85400548534145024
    }
  ]
}

Closes https://github.com/rust-lang/team/pull/1196

r? @rust-lang/infra