Skip to content

ADFA-3576 error details on no templates.json and no warnings lack of language mindsk#1154

Merged
davidschachterADFA merged 1 commit intostagefrom
fix/ADFA-3576-templates-warnings
Apr 6, 2026
Merged

ADFA-3576 error details on no templates.json and no warnings lack of language mindsk#1154
davidschachterADFA merged 1 commit intostagefrom
fix/ADFA-3576-templates-warnings

Conversation

@jomen-adfa
Copy link
Copy Markdown
Contributor

Show error details on absence of templates.json in cgt and suppress warnings on absence of language and minsdk in a template.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b86f2130-a504-495d-aa50-da2c8376560f

📥 Commits

Reviewing files that changed from the base of the PR and between c85bf67 and 5cf9b12.

📒 Files selected for processing (2)
  • templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipRecipeExecutor.kt
  • templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipTemplateReader.kt

📝 Walkthrough

Release Notes - ADFA-3576

Changes

  • Suppress warnings for optional template parameters: Language and minsdk fields are now resolved with defaults applied, but no longer generate warnings when missing. Only required parameters (appName, packageName, saveLocation) generate warnings when using defaults.

  • Mandatory templates.json validation: Changed ZipTemplateReader.kt to fail fast when ARCHIVE_JSON (templates.json) is missing from a template archive. Instead of silently returning an empty template list, the code now throws an exception with the archive filename in the error message, which is caught by the outer exception handler for proper error reporting.

Risks & Best Practices Violations

  • Breaking change for malformed archives: Template archives without templates.json will now fail with an error instead of being silently skipped. This could affect downstream processing if such archives were previously handled gracefully in production environments.

  • Loss of optional parameter validation visibility: Suppressing warnings for missing optional fields (language, minsdk) may hide configuration issues in template definitions. Consider documenting that these fields are truly optional with no validation alerts.

  • Limited backwards compatibility: If existing tools or workflows depend on empty template lists being returned for missing templates.json, they will need to handle the new exception behavior.

Walkthrough

Two template-handling files are modified to improve control-flow and error handling: ZipRecipeExecutor adjusts Pebble parameter resolution scoping and removes warnings for optional template parameters, while ZipTemplateReader implements mandatory validation to fail fast when the required ARCHIVE_JSON entry is missing.

Changes

Cohort / File(s) Summary
Template Executor & Reader
templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipRecipeExecutor.kt, templates-impl/src/main/java/com/itsaky/androidide/templates/impl/zip/ZipTemplateReader.kt
ZipRecipeExecutor restructures parameter resolution scoping and removes warning generation for optional language and minsdk parameters. ZipTemplateReader replaces nullable ZIP entry lookup with mandatory presence validation, throwing an exception via requireNotNull() instead of silently returning empty list when ARCHIVE_JSON is missing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • next gen template initial version #1069: Introduces next-gen template infrastructure that these changes directly refine through control-flow adjustments and enhanced error handling in the same zip/template reader/executor modules.

Suggested reviewers

  • itsaky-adfa
  • hal-eisen-adfa
  • davidschachterADFA

Poem

🐰 A rabbit hops through template zips,
Adjusting scopes with dainty flips,
Warnings trimmed, validation tight,
No silent fails in the dead of night!
Control flow cleaned, the logic sings—
Simple tweaks unlock great things! 🎀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title references the core changes: better error handling for missing templates.json and suppression of language/minsdk warnings, which align with the actual modifications in both files.
Description check ✅ Passed The description accurately reflects the changeset: showing error details for absent templates.json and suppressing warnings for missing optional language and minsdk parameters.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ADFA-3576-templates-warnings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@davidschachterADFA davidschachterADFA merged commit 07a2ffc into stage Apr 6, 2026
2 checks passed
@davidschachterADFA davidschachterADFA deleted the fix/ADFA-3576-templates-warnings branch April 6, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants