Menu/navigation hardening, referral onboarding, tooltips loader, and 30 SC manual bonus admin flow with tests - #106
Conversation
|
CodeAnt AI is reviewing your PR. Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
…for-runewager-bot-wi8wfz
Nitpicks 🔍
|
| if git diff --cached --quiet; then | ||
| echo "[8] No changes to commit; skipping git commit/push." | ||
| else | ||
| echo "[8] Committing..." | ||
| git commit -m "GCZ: ensure tooltips.json exists, ignore it, and run load_tooltips.sh" |
There was a problem hiding this comment.
Suggestion: The script claims to stage and commit only the ignore rule, but git commit without a path will include any other already-staged files in the repo, potentially causing unintended commits; restricting both the diff check and the commit to .gitignore ensures only the intended file is pushed. [logic error]
Severity Level: Major ⚠️
- ❌ Script can push unrelated staged changes to origin main.
- ⚠️ Bypasses usual code review protections for those staged changes.| if git diff --cached --quiet; then | |
| echo "[8] No changes to commit; skipping git commit/push." | |
| else | |
| echo "[8] Committing..." | |
| git commit -m "GCZ: ensure tooltips.json exists, ignore it, and run load_tooltips.sh" | |
| if git diff --cached --quiet -- .gitignore; then | |
| echo "[8] No changes to commit; skipping git commit/push." | |
| else | |
| echo "[8] Committing..." | |
| git commit -m "GCZ: ensure tooltips.json exists, ignore it, and run load_tooltips.sh" .gitignore |
Steps of Reproduction ✅
1. In `/var/www/html/Runewager` (path used at `load_tooltips.sh:7`), modify a tracked file
such as `index.js` and stage it manually with `git add index.js`, leaving it in the index.
2. From the same repository root, execute the operational script `./load_tooltips.sh`
(script content confirmed at `/workspace/Runewager/load_tooltips.sh:1-63`).
3. The script executes the block at `load_tooltips.sh:24-25`, printing `"[7] Staging
.gitignore only..."` and running `git add .gitignore`, which adds `.gitignore` alongside
the already-staged `index.js`.
4. The conditional at `load_tooltips.sh:27` calls `git diff --cached --quiet` without a
pathspec, which detects any staged changes (including `index.js`), so it enters the `else`
branch and runs `git commit -m ...` at `load_tooltips.sh:31`, committing both `.gitignore`
and the unrelated `index.js` changes.
5. Immediately after, the script pushes this commit to `origin main` via `git push origin
main` at `load_tooltips.sh:34`, causing unintended, unreviewed changes from `index.js` (or
any other pre-staged files) to be pushed along with the `.gitignore` update.Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** load_tooltips.sh
**Line:** 27:31
**Comment:**
*Logic Error: The script claims to stage and commit only the ignore rule, but `git commit` without a path will include any other already-staged files in the repo, potentially causing unintended commits; restricting both the diff check and the commit to `.gitignore` ensures only the intended file is pushed.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.|
CodeAnt AI finished reviewing your PR. |
User description
Motivation
Description
.env.exampleupdated to documentBOT_PRIVACY_MODE, HTTPS cert/key envs, Telegram links,LOG_LEVELordering and other runtime keys used by the app.index.jsadditions and refactors: addedunwrapTelegramUrl/getDiscordLink, unified play/link helpers (getPlayMode,getPlayLink,getPlayButton,playButtonMarkup), and made Play buttons deterministic for browser vs mini-app modes.clearOldMenus,replyMenu,replyMenuusage across settings/main menu flows, and callback hygiene middleware to delete source callback cards when replying.ACTION_LABELSandevaluatePendingActionTimeoutwith exact-15-minute boundary semantics and slash-command escape handling (/cancel,/menu,/start,/help).applyOnboardingReferralCode, shareable HTML, referral store persistence and dual-boost application for owner+referred user; onboarding prompts added (onboard_ref_yes/onboard_ref_no).w30_menu_*), admin review tools (w30_admin_menu), and an append-only admin audit sinkbonus_admin.logviaappendBonusAdminLog./var/www/html/Runewager/data/tooltips.jsoninloadHelpfulMessages, and addedload_tooltips.shto seed/ignore and populatetooltips.jsonwith 15 approved entries.test/*.test.js.Testing
test/unit.test.jsandtest/smoke.test.js) locally via the project's test runner; all unit and smoke tests passed./testalllogic via the smoke test harness to verify environment/link checks, pending-action boundary behavior, and the new summary line; the smoke suite reported no failures.load_tooltips.shtarget usingpython -m json.toolin the script as part of the script’s self-check (script writes and validatestooltips.json).Codex Task
CodeAnt-AI Description
Make tooltip pipeline fail fast and skip empty commits during deployment
What Changed
Impact
✅ Fewer failed deployments due to hidden errors✅ No empty commits or unnecessary pushes✅ More reliable tooltip updates during deployment💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.