Copilot commented on code in PR #560: URL: https://github.com/apache/grails-static-website/pull/560#discussion_r4223321120
########## guides/creating-your-first-grails-app/v8/guide/creatingTheApp.adoc: ########## @@ -3,7 +3,7 @@ You can recreate `initial/` yourself with the Grails Application Forge: [source,bash] ---- curl -O https://start.grails.org/creating-your-first-grails-app.zip \ - -d version=8.0.0-SNAPSHOT \ + -d version=8.0.0 \ Review Comment: The generated GA application now uses Grails 8's nullable-by-default behavior, but the copied domain snippets still rely on the old defaults. `Make.name`, `Model.name`/`make`, and `Vehicle.name`/`year`/`make`/`model` can therefore be null even though this guide presents them as the inventory model's required data. Update those domain constraints with explicit `nullable: false` alongside this version change. ########## guides/grails-fields-custom-widgets-and-wrappers/v8/snippets/grails-app/domain/example/Book.groovy: ########## @@ -14,10 +14,10 @@ class Book { static hasMany = [tags: Tag] static constraints = { - title blank: false, maxSize: 255 - isbn blank: false, matches: /^(?:\d{10}|\d{13}|\d{3}-\d-\d{2}-\d{6}-\d)$/ + title nullable: false, blank: false, maxSize: 255 + isbn nullable: false, blank: false, matches: /^(?:\d{10}|\d{13}|\d{3}-\d-\d{2}-\d{6}-\d)$/ genre inList: ['Fiction', 'Non-Fiction', 'Biography', 'Science', 'History', 'Poetry'] - description blank: false, maxSize: 2000, widget: 'textarea' + description nullable: false, blank: false, maxSize: 2000, widget: 'textarea' Review Comment: This nullable migration is incomplete for the sample. `Book.author`, `Book.genre`, and `Book.priceUSD` still default to nullable, so null bypasses the association, `inList`, and `min` checks; `ContactInfo.author`/`phone`/`mailingAddress` and `Tag.name` have the same problem. Add explicit `nullable: false` constraints so the model and constraint-driven required markers match the guide. ########## guides/database-per-tenant/v8/snippets/gradle.properties: ########## @@ -1,4 +1,4 @@ -grailsVersion=8.0.0-M5 +grailsVersion=8.0.0 Review Comment: Pinning this sample to Grails 8.0.0 leaves its required fields nullable: `Manufacturer.name` and `Vehicle.model` still rely on `blank: false`, while `Vehicle.year` relies on `min`. In Grails 8, `null` bypasses those constraints, so incomplete tenant and vehicle records now validate. Add `nullable: false` to those domain properties when updating the runtime. ########## guides/grails-transactional-events/v8/snippets/grails-app/domain/example/AuditLog.groovy: ########## @@ -12,7 +12,7 @@ class AuditLog { Date occurredAt static constraints = { - eventType blank: false, maxSize: 64 + eventType nullable: false, blank: false, maxSize: 64 orderId min: 1L customerId min: 1L orderTotal min: new BigDecimal('0.01') Review Comment: `orderId`, `customerId`, and `orderTotal` remain nullable under Grails 8 because `min` does not reject null. That permits audit rows without the identifiers or snapshot total that this model is intended to preserve. Add `nullable: false` to all three constraints. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
