Skip to content

Deleting and renaming a GitHub team gives it a new GitHub ID, which causes uniqueness constraint violations #6949

Open
@carols10cents

Description

@carols10cents

Related but slightly distinct:

To reproduce:

  • Create a github team in an org and run cargo owners --add github:org:team to add the team as an owner of the crate.
  • Delete the team in github and recreate it with the same name. This should give the team a new github ID.
  • Attempt to add the team to a different crate, issuing the same cargo owners --add github:org:team command.
  • Crates.io will return a uniqueness constraint violation because we enforce unique team names.

If we get the same ID but a different name, we upsert and update the name. But we aren't doing that for teams. I think as long as the org's github id is the same (that is, the entire organization hasn't been deleted and recreated), it isn't a security problem if we update the team ID when the names are the same (as it indicates the same organization has deleted and recreated the team).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions