Commit ddd1052
committed
fix: normalize repoFullName to lowercase in validateRepoFullName
Admin endpoints treated repoFullName as case-sensitive even though
GitHub repository identity is case-insensitive. registerRepo did an
exact-case update match that failed silently when request casing
differed from stored row casing (e.g. 'Entrius/das-github-mirror'
vs 'entrius/das-github-mirror').
Add .toLowerCase() to validateRepoFullName so all incoming values
are normalized at the entry point before any persistence or lookup.
This covers both the backfill and registerRepo endpoints which both
call validateRepoFullName.
Fixes #1214
fix: use LOWER() comparison for case-insensitive repoFullName matching
Input-only normalization (.toLowerCase()) misses repos stored with
GitHub's canonical casing. Storage keeps the original case from
installation.handler.ts so lowercasing the input causes
registerRepo's update and getTokenForRepo's findOneBy to miss rows
for any repo whose stored name has uppercase characters.
Apply the same LOWER(repo_full_name) = LOWER(:repoFullName) pattern
already used in repos.service.ts and pulls.service.ts:
- registerRepo: createQueryBuilder update with LOWER() WHERE clause
- getTokenForRepo: createQueryBuilder select with LOWER() WHERE clause
Fixes #12141 parent 44604b5 commit ddd1052
2 files changed
Lines changed: 12 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
194 | 199 | | |
195 | 200 | | |
196 | 201 | | |
| |||
0 commit comments