Fixed typos in da config + everywhere else they were#221
Fixed typos in da config + everywhere else they were#221
Conversation
Deploying hackkit with
|
| Latest commit: |
71f58d7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a6f983df.hackkit.pages.dev |
| Branch Preview URL: | https://fix-hk-config-typos.hackkit.pages.dev |
📝 WalkthroughWalkthroughThis PR systematically corrects a typo across the codebase by renaming the misspelled property Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In `@apps/web/src/lib/constants/index.ts`:
- Line 10: The change to HACKER_REGISTRATION_STORAGE_KEY altered the stored key
(typo fix) and will orphan any in-progress drafts; update the code to handle the
old key by checking for the previous key name
("HackKit_itteration_hackerRegistrationData") and migrating its value to the new
HACKER_REGISTRATION_STORAGE_KEY (or falling back to the old key if present)
before reads/writes. Add the migration logic where
HACKER_REGISTRATION_STORAGE_KEY is used (e.g., the registration save/load helper
or initializer) so existing drafts are preserved and subsequent operations use
the corrected key.
In `@apps/web/src/lib/utils/server/redis.ts`:
- Around line 7-9: Breaking change: includeEnvPrefix switched from using the old
misspelled prefix (c.itteration) to c.iteration which will orphan existing Redis
keys; to avoid data loss restore backward compatibility by updating
includeEnvPrefix to use the original prefix (referencing c.itteration) or
implement a compatibility layer that checks/accepts both prefixes when reading
(and only migrate keys intentionally). Update the includeEnvPrefix function to
reference c.itteration (or add dual-prefix logic) and, if you do intend to
change the canonical prefix, add a documented migration plan for moving existing
keys before deploying.
In `@packages/config/hackkit.config.ts`:
- Around line 985-988: You changed the path used for resume uploads by fixing
the typo in the staticUploads constant (bucketResumeBaseUploadUrl built from
c.hackathonName and c.iteration) which RegisterForm.tsx and
RegisterFormSettings.tsx rely on; verify the infrastructure-migrator migration
script was executed (or run it) before deploying this change so existing resumes
were moved to R2 and DB URLs were updated to the new
/api/upload/resume/view?key=... format—if migration wasn’t run, roll back or run
the migrator and update any DB records pointing to the old itteration-based
paths to the migrated keys to prevent broken resume links.
🧹 Nitpick comments (1)
packages/config/hackkit.config.ts (1)
959-964: MLH badge config changes appear unrelated to the typo fix.The color, foreground, and checked values for the
mlhrole badge have been modified. This is a behavioral change (e.g.,checkedis nowfalse) bundled into a typo-fix PR. Consider noting this in the PR description or splitting it out for clarity.
| "default" as keyof typeof c.db.uniqueKeyMapper; | ||
| export const PAYLOAD_TOO_LARGE_CODE = 413; | ||
| export const HACKER_REGISTRATION_STORAGE_KEY = `${c.hackathonName}_${c.itteration}_hackerRegistrationData`; | ||
| export const HACKER_REGISTRATION_STORAGE_KEY = `${c.hackathonName}_${c.iteration}_hackerRegistrationData`; |
There was a problem hiding this comment.
Storage key value changes — in-progress registration drafts will be lost.
The localStorage key changes from HackKit_itteration_hackerRegistrationData to HackKit_iteration_hackerRegistrationData. Any user with a partially saved registration form will lose that draft. This is low-impact since it's transient data, but worth noting.
🤖 Prompt for AI Agents
In `@apps/web/src/lib/constants/index.ts` at line 10, The change to
HACKER_REGISTRATION_STORAGE_KEY altered the stored key (typo fix) and will
orphan any in-progress drafts; update the code to handle the old key by checking
for the previous key name ("HackKit_itteration_hackerRegistrationData") and
migrating its value to the new HACKER_REGISTRATION_STORAGE_KEY (or falling back
to the old key if present) before reads/writes. Add the migration logic where
HACKER_REGISTRATION_STORAGE_KEY is used (e.g., the registration save/load helper
or initializer) so existing drafts are preserved and subsequent operations use
the corrected key.
| export function includeEnvPrefix(key: string) { | ||
| return `${c.hackathonName}_${c.itteration}_${process.env.HK_ENV}_${key}`; | ||
| return `${c.hackathonName}_${c.iteration}_${process.env.HK_ENV}_${key}`; | ||
| } |
There was a problem hiding this comment.
Breaking change: all Redis keys will use a new prefix, orphaning existing data.
The key prefix changes from HackKit_itteration_… to HackKit_iteration_…. All previously stored Redis entries (nav item configs, cached values, etc.) will no longer be found. If this environment has live data, you'll need to either:
- Flush/migrate the affected Redis keys, or
- Accept that existing cached state will be lost on deploy.
Please confirm this is intentional and won't cause issues in production or staging.
🤖 Prompt for AI Agents
In `@apps/web/src/lib/utils/server/redis.ts` around lines 7 - 9, Breaking change:
includeEnvPrefix switched from using the old misspelled prefix (c.itteration) to
c.iteration which will orphan existing Redis keys; to avoid data loss restore
backward compatibility by updating includeEnvPrefix to use the original prefix
(referencing c.itteration) or implement a compatibility layer that
checks/accepts both prefixes when reading (and only migrate keys intentionally).
Update the includeEnvPrefix function to reference c.itteration (or add
dual-prefix logic) and, if you do intend to change the canonical prefix, add a
documented migration plan for moving existing keys before deploying.
| const staticUploads = { | ||
| bucketHost: "/api/upload/resume/view", | ||
| bucketResumeBaseUploadUrl: `${c.hackathonName}/${c.itteration}/resumes`, | ||
| bucketResumeBaseUploadUrl: `${c.hackathonName}/${c.iteration}/resumes`, | ||
| } as const; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check for any remaining references to "itteration" in the codebase
echo "=== Searching for 'itteration' references ==="
rg -i 'itteration' --type-list | head -20
rg -i 'itteration' -n 2>/dev/null || echo "No 'itteration' found"
# Also check the actual config file to understand context
echo -e "\n=== Checking hackkit.config.ts for upload-related configuration ==="
fd 'hackkit.config.ts' -x cat -n {} | grep -A 5 -B 5 'bucketResumeBaseUploadUrl\|staticUploads'Repository: acmutsa/HackKit
Length of output: 1175
🏁 Script executed:
#!/bin/bash
# Check for any references to the old path or related upload handling
echo "=== Searching for resume upload path patterns ==="
rg 'resumes' -n --context=3 -t ts -t tsx 2>/dev/null | head -50
# Look for any migration or backward compatibility logic
echo -e "\n=== Checking for migration or path handling utilities ==="
rg 'migrate\|backward\|compat' -i -n --context=2 -t ts -t tsx 2>/dev/null | grep -i 'resume\|upload\|path' || echo "No migration logic found related to uploads"
# Check git history for this specific file
echo -e "\n=== Git history for the config file ==="
git log --oneline -10 packages/config/hackkit.config.ts 2>/dev/null || echo "Git history not available"Repository: acmutsa/HackKit
Length of output: 313
🏁 Script executed:
#!/bin/bash
# Search for resume upload/download implementations
echo "=== Searching for resume upload/download handlers ==="
rg 'resume.*upload\|upload.*resume' -i -n --context=3 -t ts -t tsx -t js 2>/dev/null | head -60
# Look for bucketResumeBaseUploadUrl usage
echo -e "\n=== Searching for bucketResumeBaseUploadUrl references ==="
rg 'bucketResumeBaseUploadUrl' -n --context=3 -t ts -t tsx -t js 2>/dev/null
# Check for iteration variable usage
echo -e "\n=== Checking where c.iteration comes from ==="
rg 'iteration["\']?\s*[:=]' -n --context=2 -t ts -t tsx 2>/dev/null | head -40Repository: acmutsa/HackKit
Length of output: 306
🏁 Script executed:
#!/bin/bash
# Check the git diff or commit details for the typo fix
echo "=== Git commit details for typo fix ==="
git log --all --oneline | grep -i 'typo' | head -10
# Get more details about the specific commit that fixed typos
git show 71f58d7 --stat 2>/dev/null | head -30
git show 71f58d7 | head -80 2>/dev/nullRepository: acmutsa/HackKit
Length of output: 5671
🏁 Script executed:
#!/bin/bash
# Search for staticUploads usage
echo "=== Searching for staticUploads references ==="
rg 'staticUploads' -n --context=5 -t ts -t tsx -t js 2>/dev/null
# Check what's exported from the config file
echo -e "\n=== Checking exports from hackkit.config.ts ==="
rg 'export' -n --context=3 packages/config/hackkit.config.ts 2>/dev/null | tail -30
# Look for any files importing from this config
echo -e "\n=== Files importing from hackkit config ==="
rg 'from.*hackkit.config\|from.*["'"'"']config' -n -t ts -t tsx 2>/dev/null | head -20Repository: acmutsa/HackKit
Length of output: 345
🏁 Script executed:
#!/bin/bash
# Check if there's any documentation about resume uploads
echo "=== Searching for resume-related documentation ==="
fd -e md -e txt | xargs rg -l 'resume.*upload\|upload.*resume' -i 2>/dev/null
# Check if there are any migration guides or changelogs
echo -e "\n=== Looking for migration or changelog docs ==="
fd -e md | xargs grep -l -i 'migration\|changelog\|breaking' 2>/dev/nullRepository: acmutsa/HackKit
Length of output: 160
🏁 Script executed:
#!/bin/bash
# Search for any pattern that might access the staticUploads object
echo "=== Searching for potential object destructuring or spreading ==="
rg 'staticUploads\|\bucketHost\|\bucketResume' -n --context=5 2>/dev/null
# Check the entire export section of the config file
echo -e "\n=== Full export section ==="
tail -20 packages/config/hackkit.config.ts
# Search for any references to upload paths or bucket operations
echo -e "\n=== Searching for upload or bucket operations ==="
rg 'bucketHost|bucketResume|\bupload\b' -n --context=3 -t ts -t tsx 2>/dev/null | head -40Repository: acmutsa/HackKit
Length of output: 484
🏁 Script executed:
#!/bin/bash
# Check if staticUploads is even exported
echo "=== Checking complete export block ==="
sed -n '1026,1040p' packages/config/hackkit.config.ts
# Search the entire packages directory for any upload-related code
echo -e "\n=== Checking for upload-related implementations ==="
find packages -type f \( -name "*.ts" -o -name "*.tsx" \) -exec grep -l "upload\|resume" {} \; 2>/dev/null | head -20Repository: acmutsa/HackKit
Length of output: 393
🏁 Script executed:
#!/bin/bash
# Check the database schema and user functions for resume-related code
echo "=== Checking packages/db/schema.ts for resume references ==="
rg -n 'resume' packages/db/schema.ts -i -B2 -A2
echo -e "\n=== Checking packages/db/functions/user.ts for resume references ==="
rg -n 'resume\|upload' packages/db/functions/user.ts -i -B3 -A3
# Also check if staticUploads is imported anywhere
echo -e "\n=== Checking all imports of staticUploads ==="
rg -n 'import.*staticUploads\|from.*config' packages/db -r 'config' --type ts --type tsx 2>/dev/null | head -20Repository: acmutsa/HackKit
Length of output: 635
🏁 Script executed:
#!/bin/bash
# Search more broadly for how bucketResumeBaseUploadUrl or similar paths are used
echo "=== Searching all packages for resume path usage ==="
rg 'iteration.*resume|resume.*iteration|/resumes|resumeUrl|resumePath' -i -n -B2 -A2 2>/dev/null | head -60
# Check if there are any server/api route handlers
echo -e "\n=== Looking for API upload handlers ==="
find packages apps -type f \( -name "*.ts" -o -name "*.tsx" \) -path "*/api/*" -o -name "*upload*" 2>/dev/null | head -20Repository: acmutsa/HackKit
Length of output: 3033
🏁 Script executed:
#!/bin/bash
# Check the resume upload and view handlers
echo "=== Checking resume register endpoint ==="
cat -n apps/web/src/app/api/upload/resume/register/route.ts | head -80
echo -e "\n=== Checking resume view endpoint ==="
cat -n apps/web/src/app/api/upload/resume/view/route.ts | head -80
echo -e "\n=== Checking file upload utilities ==="
cat -n apps/web/src/lib/utils/server/file-upload.ts | head -100Repository: acmutsa/HackKit
Length of output: 3306
🏁 Script executed:
#!/bin/bash
# Now check where staticUploads is actually imported
echo "=== Searching for imports of staticUploads across the codebase ==="
rg 'staticUploads|bucketResumeBaseUploadUrl' -n --context=5 2>/dev/nullRepository: acmutsa/HackKit
Length of output: 9367
🏁 Script executed:
#!/bin/bash
# Let me check how the bucketResumeBaseUploadUrl is actually used in the put() function
echo "=== Checking the client file-upload.ts for put() implementation ==="
cat -n apps/web/src/lib/utils/client/file-upload.ts | head -80
echo -e "\n=== Checking infrastructure-migrator to understand migration context ==="
sed -n '190,240p' apps/infrastructure-migrator/driver.tsRepository: acmutsa/HackKit
Length of output: 3296
bucketResumeBaseUploadUrl is actively used and path change is intentional, but migration completeness should be verified.
The typo fix from itteration to iteration was deliberate (commit "Fixed typos in da config + everywhere else they were") and is actively used in file uploads via RegisterForm.tsx and RegisterFormSettings.tsx. New resumes will be stored at the corrected path.
However, existing resumes depend on proper migration: the infrastructure-migrator script handles moving old resumes to R2 storage and updates database URLs to /api/upload/resume/view?key=... format. Confirm that the migration script was executed before this typo fix was deployed, or that all existing resume URLs in the database have been updated to use the migrated keys. If resumes exist in production with old paths and weren't migrated before the config change, they could become inaccessible.
🤖 Prompt for AI Agents
In `@packages/config/hackkit.config.ts` around lines 985 - 988, You changed the
path used for resume uploads by fixing the typo in the staticUploads constant
(bucketResumeBaseUploadUrl built from c.hackathonName and c.iteration) which
RegisterForm.tsx and RegisterFormSettings.tsx rely on; verify the
infrastructure-migrator migration script was executed (or run it) before
deploying this change so existing resumes were moved to R2 and DB URLs were
updated to the new /api/upload/resume/view?key=... format—if migration wasn’t
run, roll back or run the migrator and update any DB records pointing to the old
itteration-based paths to the migrated keys to prevent broken resume links.
hi josh i cleaned up very small typos. i wanted to focus more on clubhub but i couldnt let these very small fixes go unnoticed when i was doing cq stuff.
Summary by CodeRabbit