Repository navigation
fix: allocate four digits to Android monthly MICRO - #7
Conversation
Map three-component CalVer to YYMMXXXX; retain four-component packing with checked component bounds and the Play versionCode limit. Document migration from the old MICRO*100 mapping. Validate cargo fmt --check, cargo clippy --all-targets -- -D warnings, cargo test (67 unit + 1 CLI integration), cargo build, and actionlint. Add the same Cargo gate to PR CI; apply existing Clippy suggestions without changing behavior.
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
| let code_re = Regex::new(r#"(versionCode\s*=?\s*)(\d+)"#).unwrap(); | ||
| if code_re.is_match(&output) { | ||
| let code = version_code(new_version); | ||
| let code = version_code(new_version)?; |
There was a problem hiding this comment.
Suggestion: version_code can fail after earlier targets were written, leaving non-Gradle files updated while this Gradle file and later targets remain unchanged.
Assessment: 🟠 Major · 🔁 Occurrence: Rarely · 🏷️ Incomplete implementation
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** src/target.rs
**Line:** 183:183
**Comment:**
*Incomplete Implementation: `version_code` can fail after earlier targets were written, leaving non-Gradle files updated while this Gradle file and later targets remain unchanged.
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.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix| if a > 2100 || b > 99 { | ||
| bail!("Android version components exceed versionCode capacity: {version}"); |
There was a problem hiding this comment.
Suggestion: A valid YY.MICRO format pads its output to three parts, placing MICRO in b; values above 99 are then rejected as if they were months.
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Api mismatch
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** src/target.rs
**Line:** 247:248
**Comment:**
*Api Mismatch: A valid `YY.MICRO` format pads its output to three parts, placing MICRO in `b`; values above 99 are then rejected as if they were months.
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.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
CodeAnt Nitpicks1 code suggestion1. The CLI reads the date again; crossing a month or year boundary before it runs makes the tag prefix stale and the expected version wrong.Logic error · |
CodeAnt PR Risk: Medium Risk
Assessed commit: |
User description
Three-component Android versions previously multiplied MICRO by 100, so
26.10.100and26.11.0both produced26110000. Pack the defaultYY.MM.MICROasYYMMXXXXinstead:26.10.100→26100100, with MICRO 0–9999. Reject overflow, malformed values, and codes outside Google Play’s 1–2100000000 range before writing the target file. Preserve four-component packing with explicit two-digit bounds.Document the migration constraint: the corrected mapping can lower an existing app’s code within the same month, so a release must exceed its highest already-distributed code. Do not change component counts within a version sequence or rewrite old tags. Store/device migration floors are not discoverable by oneup and have not been verified by this PR.
Add a PR Cargo gate and real CLI integration coverage using temporary Git repositories for both Gradle syntaxes, including MICRO 100, 9999, and exhausted capacity without file changes. Apply the existing Clippy suggestions needed for the strict gate; these are behavior-preserving.
Validation:
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(67 unit tests + 1 CLI integration test),cargo build,actionlint .github/workflows/ci.yml, andgit diff --checkall passed locally. No package release is performed by this PR.CodeAnt-AI Description
Prevent Android version-code collisions as monthly MICRO values grow
What Changed
26.10.100no longer overlap with the next month.Impact
✅ Non-overlapping monthly Android version codes✅ Invalid codes rejected before Gradle files change✅ Clearer migration guidance for existing Android apps💡 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.