Skip to content

Use api.RepoID everywhere where a repository ID is used

Administrator requested to merge api-repo-id-everywhere into master

Created by: mrnugget

Before this change we had three different types all pointing to the same thing:

  • api.RepoID
  • uint32
  • int32

One was more prominent in graphqlbackend, the other in repo-updater and the last one in the a8n packages.

Since api.RepoID is an int32 and since it's a database ID and thus technically unsigned they could all be used interchangeably.

But: there were a ton of conversions between the types and it made writing code cumbersome ("cannot use type int32 where uint32 is expected", etc.)

So this PR is my proposal as the first step to fix this.

Why the first step? I'd also accept int32 or uint32, but I want a single type to be used consistently. Moving to api.RepoID first makes it easy to search/replace afterwards.

Merge request reports

Loading