Skip to content

Characterize data-binding allowlist through public binding API#16003

Open
jamesfredley wants to merge 1 commit into
8.0.xfrom
test/databinding-codegen-contract
Open

Characterize data-binding allowlist through public binding API#16003
jamesfredley wants to merge 1 commit into
8.0.xfrom
test/databinding-codegen-contract

Conversation

@jamesfredley

Copy link
Copy Markdown
Contributor

Summary

  • add a test-only characterization spec that pins the compile-time data-binding allowlist contract via OBSERVABLE behavior through the public binding API
  • covers a domain (via DataBindingUtils.bindObjectToInstance) and a controller-action @Validateable command
  • asserts which properties actually bind vs stay null, so the test tracks the generated allowlist's effect rather than an internal field

Behavior characterized (current 8.0.x)

  • Domain: name and nested address.street bind; id/version/dateCreated/lastUpdated and a declared non-allowlisted Object property stay null
  • @Validateable command: declared special properties bind; the non-allowlisted property stays null

Scope note

Test-only; no production changes. Exercises only public data-binding APIs (per the repo's test-through-public-API policy); it does not read the AST-generated allowlist field.

Verification

  • :grails-test-suite-web:test --tests DefaultDatabindingWhitelistBehaviorSpec
  • :grails-test-suite-web:test
  • git diff --check

This is an AI-generated starting point pinning the data-binding code-generation contract.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a characterization test in grails-test-suite-web to pin the observable behavior of the compile-time data-binding allowlist via public data-binding APIs, without inspecting internal AST-generated fields.

Changes:

  • Introduces a new Spock spec that verifies which properties bind vs remain unset for a domain instance when binding via DataBindingUtils.bindObjectToInstance.
  • Adds a controller-action command object scenario (a Validateable command) to assert allowlist behavior through controller command binding, including nested property binding.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.1210%. Comparing base (0c63c26) to head (23f7c46).

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                 @@
##                8.0.x     #16003        +/-   ##
==================================================
+ Coverage     51.1168%   51.1210%   +0.0042%     
- Complexity      17597      17600         +3     
==================================================
  Files            2041       2041                
  Lines           95493      95493                
  Branches        16587      16587                
==================================================
+ Hits            48813      48817         +4     
+ Misses          39394      39390         -4     
  Partials         7286       7286                

see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app

testlens-app Bot commented Jul 17, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 23f7c46
▶️ Tests: 18621 executed
⚪️ Checks: 61/61 completed


Learn more about TestLens at testlens.app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants