Tomasz Skorupa activity https://gitlab.com/tskorupa-gl 2026-03-17T17:53:17Z tag:gitlab.com,2026-03-17:5214141830 Tomasz Skorupa approved merge request !227058: Backend changes for duplicate token feature at GitLab.org / GitLab 2026-03-17T17:53:17Z tskorupa-gl Tomasz Skorupa

What does this MR do and why?

Backend changes for duplicate token feature:

  • Add project field to GranularScopeType to resolve the actual Project from a Namespaces::ProjectNamespace, enabling correct prefill of project scopes
  • Add id field to PersonalAccessTokensResolver
  • Add by_id filter to PersonalAccessTokensFinder

References

Issue: #591665

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

tag:gitlab.com,2026-03-17:5214128858 Tomasz Skorupa commented on merge request !227058 at GitLab.org / GitLab 2026-03-17T17:48:53Z tskorupa-gl Tomasz Skorupa

Would there be a performance problem if the scope was used in the future with an array of ID's?

@alexbuijs Only if it's very large. Since this seems like it's internal-only, correct me if I am wrong here, but the graphql API will ensure token_id is an integer (not an array).

tag:gitlab.com,2026-03-17:5214105458 Tomasz Skorupa commented on merge request !227058 at GitLab.org / GitLab 2026-03-17T17:42:10Z tskorupa-gl Tomasz Skorupa

@alexbuijs Small non-blocking suggestion. Let me know what you think.

tag:gitlab.com,2026-03-17:5214105444 Tomasz Skorupa commented on merge request !227058 at GitLab.org / GitLab 2026-03-17T17:42:09Z tskorupa-gl Tomasz Skorupa

suggestion: The id argument is defined as a singular GlobalIDType[::PersonalAccessToken] (not an array), so only a single ID can ever be passed through the GraphQL API. The generated query will be a simple primary key equality lookup, so there's no risk of an unbounded IN (...) clause here.

That said, the by_token_id method in the finder itself doesn't enforce this constraint at the Ruby level. If a future caller were to pass an array via PersonalAccessTokensFinder.new(token_id: [1, 2, 3, ...]), id_in would accept it. This is a minor hardening consideration rather than a blocking concern.

    token_id = Array(params[:token_id]).first
    return tokens unless token_id

    tokens.id_in(token_id)
tag:gitlab.com,2026-03-17:5214056555 Tomasz Skorupa commented on merge request !227690 at GitLab.org / GitLab 2026-03-17T17:27:55Z tskorupa-gl Tomasz Skorupa

@kivikakk Could you do the backend review?

@maddievn Could you do the database review?

@tkuah Could you do the ~"Database Sharding" review?

tag:gitlab.com,2026-03-17:5213652356 Tomasz Skorupa commented on merge request !227690 at GitLab.org / GitLab 2026-03-17T15:54:44Z tskorupa-gl Tomasz Skorupa
Table "public.pool_repositories"
      Column       |       Type        | Collation | Nullable |                    Default                    
-------------------+-------------------+-----------+----------+-----------------------------------------------
 id                | bigint            |           | not null | nextval('pool_repositories_id_seq'::regclass)
 shard_id          | integer           |           | not null | 
 disk_path         | character varying |           |          | 
 state             | character varying |           |          | 
 source_project_id | integer           |           |          | 
 organization_id   | bigint            |           |          | 
Indexes:
    "pool_repositories_pkey" PRIMARY KEY, btree (id)
    "index_pool_repositories_on_organization_id" btree (organization_id)
    "index_pool_repositories_on_shard_id" btree (shard_id)
    "index_pool_repositories_on_source_project_id_and_shard_id" UNIQUE, btree (source_project_id, shard_id)
    "unique_pool_repositories_on_disk_path_and_shard_id" UNIQUE, btree (disk_path, shard_id)
Check constraints:
    "check_96233d37c0" CHECK (organization_id IS NOT NULL)
Foreign-key constraints:
    "fk_775c554d89" FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE NOT VALID
    "fk_rails_af3f8c5d62" FOREIGN KEY (shard_id) REFERENCES shards(id) ON DELETE RESTRICT
Triggers:
    pool_repositories_loose_fk_trigger AFTER DELETE ON pool_repositories REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records()
tag:gitlab.com,2026-03-17:5213622260 Tomasz Skorupa opened merge request !227690: Mark pool_repositories as sharded at GitLab.org / GitLab 2026-03-17T15:48:26Z tskorupa-gl Tomasz Skorupa

What does this MR do and why?

Mark pool_repositories as sharded

Follow up to #490484

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

tag:gitlab.com,2026-03-17:5213610038 Tomasz Skorupa pushed new project branch tskorupa/mark-pool_repositories-as-sharded at GitLab.org / GitLab 2026-03-17T15:45:43Z tskorupa-gl Tomasz Skorupa

Tomasz Skorupa (3dcb62cc) at 17 Mar 15:45

Mark pool_repositories as sharded

tag:gitlab.com,2026-03-17:5213138867 Tomasz Skorupa commented on merge request !227058 at GitLab.org / GitLab 2026-03-17T14:12:41Z tskorupa-gl Tomasz Skorupa

@alexbuijs I might be mistaken, but this MR does not seem as if it has been looked at by a database reviewer. Let's have @knejad review it first (chosen through the review roulette).

@knejad Would you be available to do the database review?

tag:gitlab.com,2026-03-17:5213058887 Tomasz Skorupa commented on merge request !225301 at GitLab.org / GitLab 2026-03-17T13:57:55Z tskorupa-gl Tomasz Skorupa

@skundapur I made some changes based on your feedback. Could you have another look?

tag:gitlab.com,2026-03-16:5210316855 Tomasz Skorupa pushed to project branch duo-edit-20260227-151042 at GitLab.org / GitLab 2026-03-16T22:48:06Z tskorupa-gl Tomasz Skorupa

Tomasz Skorupa (0d033924) at 16 Mar 22:48

Fix merge order so explicit routing keys override defaults

tag:gitlab.com,2026-03-16:5209842588 Tomasz Skorupa pushed to project branch duo-edit-20260227-151042 at GitLab.org / GitLab 2026-03-16T19:37:01Z tskorupa-gl Tomasz Skorupa

Tomasz Skorupa (a27938cd) at 16 Mar 19:37

Roll ROUTING_PAYLOAD_REGEX tests into functional tests

tag:gitlab.com,2026-03-16:5209778669 Tomasz Skorupa opened issue #21568: Remove the foreign key constraint `web_hook_logs_daily.project_id` at GitLab.com / GitLab Infrastructure Team / Production 2026-03-16T19:16:29Z tskorupa-gl Tomasz Skorupa tag:gitlab.com,2026-03-16:5209700270 Tomasz Skorupa pushed to project branch tskorupa/switch-uploads-to-new-partitioned-table at GitLab.org / GitLab 2026-03-16T18:50:17Z tskorupa-gl Tomasz Skorupa

Tomasz Skorupa (275a14dd) at 16 Mar 18:50

Update milestones from 18.10 to 18.11

... and 5 more commits

tag:gitlab.com,2026-03-16:5209637061 Tomasz Skorupa commented on merge request !226533 at GitLab.org / GitLab 2026-03-16T18:31:02Z tskorupa-gl Tomasz Skorupa

I won't be able to get to this MR in time. Using the reviewer-roulette to find another reviewer, @missy-gitlab could you do the backend review?

tag:gitlab.com,2026-03-16:5209527467 Tomasz Skorupa pushed to project branch tskorupa/switch-uploads-to-new-partitioned-table at GitLab.org / GitLab 2026-03-16T17:57:02Z tskorupa-gl Tomasz Skorupa

Tomasz Skorupa (67dd5bcb) at 16 Mar 17:57

Update milestones from 18.10 to 18.11

... and 690 more commits

tag:gitlab.com,2026-03-16:5209518820 Tomasz Skorupa pushed to project branch tskorupa/extend-sharding-docs-with-fk-constraint-exceptions at GitLab.org / GitLab 2026-03-16T17:54:37Z tskorupa-gl Tomasz Skorupa

Tomasz Skorupa (d4644fd0) at 16 Mar 17:54

Document when FK constraints on sharding key columns can be omitted