Skip to content

Fix auto defect regressions#285

Merged
eviltester merged 2 commits into
masterfrom
266-auto-defect-fixes
Jun 29, 2026
Merged

Fix auto defect regressions#285
eviltester merged 2 commits into
masterfrom
266-auto-defect-fixes

Conversation

@eviltester

@eviltester eviltester commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the auto defect batch by tightening invalid schema argument handling, preserving active grid filters after generated-data amendments, and allowing known commands with invalid params to move from text schema back into Schema UI with row-level validation.

Changes

  • Validate autoIncrement.sequence so step=0 and negative zeropadding fail at schema validation instead of producing ERROR rows.
  • Reapply active global filters after bulk/generated data mutations in the Tabulator grid adapter.
  • Distinguish unknown or malformed schema commands from known commands with invalid params during text-to-schema switching.
  • Update controller, Jest, and browser coverage for the fixed paths.

Validation

  • pnpm run verify:ui
  • pnpm run verify:local

Closes #253
Closes #268
Closes #269
Closes #270

Summary by CodeRabbit

  • Bug Fixes
    • Improved schema/grid editor behavior for invalid domain parameters: the UI keeps the row editor active, clears the general error banner, and displays per-row validation messaging (including after text-mode round-trips).
    • Preserved active filters after bulk data updates and generated schema changes, ensuring filtered results remain consistent.
    • Tightened autoIncrement.sequence argument validation by rejecting step = 0 and negative zeropadding, with clearer compiler-style error messages.

Copilot AI review requested due to automatic review settings June 29, 2026 19:00

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1886692e-b2e4-4b43-8ed2-0457a28c2993

📥 Commits

Reviewing files that changed from the base of the PR and between f647e46 and 85fe188.

📒 Files selected for processing (5)
  • packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js
  • packages/core-ui/src/tests/grid/tabulator-duplicate-column-copy.test.js
  • packages/core-ui/src/tests/shared/shared-schema-editor-controller.test.js
  • packages/core/js/keywords/domain/autoincrement/sequence-keyword-definition.js
  • packages/core/src/tests/data_generation/unit/domain/domainKeywords.test.js
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/core/src/tests/data_generation/unit/domain/domainKeywords.test.js
  • packages/core/js/keywords/domain/autoincrement/sequence-keyword-definition.js
  • packages/core-ui/src/tests/grid/tabulator-duplicate-column-copy.test.js
  • packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js
  • packages/core-ui/src/tests/shared/shared-schema-editor-controller.test.js

📝 Walkthrough

Walkthrough

The PR adds validation for autoIncrement.sequence arguments, changes schema editor handling so invalid params can return to row mode with row-level validation, and reapplies active filters after bulk grid updates.

Changes

Validation, schema editor, and grid filter updates

Layer / File(s) Summary
autoIncrement.sequence argument validation
packages/core/js/keywords/domain/autoincrement/sequence-keyword-definition.js, packages/core/src/tests/data_generation/unit/domain/domainKeywords.test.js, packages/core/src/tests/data_generation/keywords/domain/autoincrement/sequence-exec.test.js, packages/core/src/tests/core-api/generateFromTextSpec.test.js
step=0 and negative zeropadding are rejected, and tests cover the updated validation messages.
Schema editor invalid-param row mode
packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js, packages/core-ui/src/tests/shared/shared-schema-editor-controller.test.js, apps/web/src/tests/browser/app/functional/test-data/text-schema-grid-sync.spec.js, apps/web/src/tests/browser/generator/functional/schema-edit.spec.js
Compiler validation errors that map to editable rows now switch back to row mode, clear the schema error text, and surface row-level validation in controller and browser tests.
Bulk mutation filter reapplication
packages/core-ui/js/gui_components/data-grid-editor/tabulator/gridExtension-tabulator.js, packages/core-ui/src/tests/grid/tabulator-duplicate-column-copy.test.js
Bulk data replacement and table refresh now reapply active filters, with tests covering both grid replacement and amend-table flows.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

  • #253: Matches the schema editor change where invalid params in text mode switch back to row mode instead of converting to literal.
  • #268: Matches the new autoIncrement.sequence rejection for step=0.
  • #269: Matches the new autoIncrement.sequence rejection for negative zeropadding.
  • #270: Matches the bulk mutation change that reapplies the active filter after Amend Table.

Possibly related PRs

Poem

A rabbit hopped through grids and code,
Found filters fixed and validations showed.
No zero step, no padding minus one,
Rows stayed tidy when the edits were done.
Hooray for schemas, filters, and light —
The burrow’s UI feels just right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is broad, but it still accurately points to the auto-related regression fixes in this PR.
Linked Issues check ✅ Passed The changes and tests address #253, #268, #269, and #270 as described in the linked issues.
Out of Scope Changes check ✅ Passed The modified code and tests all align with the stated objectives and do not show unrelated scope creep.
✨ 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 266-auto-defect-fixes

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f647e46b97

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +476 to +478
return !getStaticSchemaRowValidationIssues(row, rowIndex).some((issue) =>
SCHEMA_UI_BLOCKING_ROW_ERROR_CODES.has(issue?.code)
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reject malformed command syntax before row-mode switch

When text schema contains a known domain command with malformed syntax (for example Status\ndatatype.enum(values="active,pending)), parseSchemaTextToRows still returns a domain row with no static row issues, so this new branch treats it as editable in Schema UI. The subsequent applySemanticValidationForAllRows() rebuilds the enum rule and can throw on the unbalanced quote instead of leaving the editor in text mode with the schema error; the existing invalid-enum text-mode flow regresses because this check only blocks static command errors.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Addressed in 85fe188. I tightened the row-mode recovery gate so every compiler validation error must map to an editable faker/domain schema row before the schema-level error can be cleared. Malformed or unanchored compiler errors now keep the editor in text mode, with a regression test covering the unmatched-error path.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
packages/core-ui/src/tests/grid/tabulator-duplicate-column-copy.test.js (1)

189-209: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exercise an actual active filter in these regression tests.

Both tests assert refreshFilter is called, but neither seeds a global filter nor verifies the active/visible rows after mutation. Add one assertion path that calls extension.filterText(...) or stubs setFilter/active rows so this catches regressions to the #270 behavior, not just the method call.

Also applies to: 211-240

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/core-ui/src/tests/grid/tabulator-duplicate-column-copy.test.js`
around lines 189 - 209, The regression test in GridExtensionTabulator only
checks that refreshFilter is invoked, but it does not simulate an actual active
filter or validate visible rows after data replacement. Update the test around
setGridFromGenericDataTable to first apply a real global filter via
extension.filterText(...) or stub Tabulator’s setFilter/getFilteredRows
behavior, then assert the active rows/filtered result after mutation so the `#270`
behavior is covered. Apply the same pattern to the related duplicate-column copy
test setup so the assertion verifies filter preservation, not just the
refreshFilter call.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js`:
- Around line 461-480: `canEditCompilerValidationErrorsInSchemaRows()` is too
permissive because it only checks that some invalid rows are editable, not that
every `compiler_validation_error` is mapped to an editable row. Update this
helper in `shared-schema-editor-controller.js` to verify all compiler errors
resolve to rows that are editable (using `getInvalidSchemaRowIndexes`,
`normaliseSourceType`, and `getStaticSchemaRowValidationIssues`), and return
false if any compiler error is unmatched or non-editable. Then ensure the caller
path that clears the global schema error before switching to row mode only runs
when this stricter check passes.

In
`@packages/core/js/keywords/domain/autoincrement/sequence-keyword-definition.js`:
- Around line 6-10: The step validation in sequence-keyword-definition.js is
only checking Object.is(argsByName.step, 0), so -0 can slip through as a valid
value. Update the validation in the sequence keyword definition logic to use a
numeric zero check that rejects both 0 and -0, while keeping the existing
non-zero integer error handling in place.

---

Nitpick comments:
In `@packages/core-ui/src/tests/grid/tabulator-duplicate-column-copy.test.js`:
- Around line 189-209: The regression test in GridExtensionTabulator only checks
that refreshFilter is invoked, but it does not simulate an actual active filter
or validate visible rows after data replacement. Update the test around
setGridFromGenericDataTable to first apply a real global filter via
extension.filterText(...) or stub Tabulator’s setFilter/getFilteredRows
behavior, then assert the active rows/filtered result after mutation so the `#270`
behavior is covered. Apply the same pattern to the related duplicate-column copy
test setup so the assertion verifies filter preservation, not just the
refreshFilter call.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 38905639-c2a3-420f-bd7b-ec429e0c16a4

📥 Commits

Reviewing files that changed from the base of the PR and between e160997 and f647e46.

📒 Files selected for processing (10)
  • apps/web/src/tests/browser/app/functional/test-data/text-schema-grid-sync.spec.js
  • apps/web/src/tests/browser/generator/functional/schema-edit.spec.js
  • packages/core-ui/js/gui_components/data-grid-editor/tabulator/gridExtension-tabulator.js
  • packages/core-ui/js/gui_components/shared/test-data/schema/shared-schema-editor-controller.js
  • packages/core-ui/src/tests/grid/tabulator-duplicate-column-copy.test.js
  • packages/core-ui/src/tests/shared/shared-schema-editor-controller.test.js
  • packages/core/js/keywords/domain/autoincrement/sequence-keyword-definition.js
  • packages/core/src/tests/core-api/generateFromTextSpec.test.js
  • packages/core/src/tests/data_generation/keywords/domain/autoincrement/sequence-exec.test.js
  • packages/core/src/tests/data_generation/unit/domain/domainKeywords.test.js

Comment thread packages/core/js/keywords/domain/autoincrement/sequence-keyword-definition.js Outdated
@greptile-apps

greptile-apps Bot commented Jun 29, 2026

Copy link
Copy Markdown

Greptile Summary

This PR fixes several schema editing and generated-data regressions. The main changes are:

  • Rejects invalid autoIncrement.sequence arguments before row generation.
  • Keeps active Tabulator filters applied after bulk and generated data updates.
  • Allows known schema commands with invalid params to return to Schema UI with row-level validation.
  • Updates Jest and browser tests for the affected workflows.

Confidence Score: 5/5

The changes are narrowly scoped to validation, schema editor state transitions, and grid filter preservation, with matching unit and browser coverage.

No code issues were identified in the changed paths, and the updated tests cover the regressions described by the PR.

T-Rex T-Rex Logs

What T-Rex did

  • Observed the Before state: the base verification returned ok: true with three ERROR rows for invalid specs.
  • Observed the After state: head verification returned ok: false with compiler_validation_error messages for step and zeropadding, and with rows and rendered set to absent/null.
  • T-Rex ran the requested verification, but its local artifact references were not uploaded.
  • Compared UI flows for schema-invalid parameters, noting the Before screenshot shows a blocked text-state banner and the After screenshot shows the Schema UI opened with the banner cleared; the head log shows an UNKNOWN error and no dialog appeared in that control state.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "Address PR review feedback" | Re-trigger Greptile

Comment thread packages/core/js/keywords/domain/autoincrement/sequence-keyword-definition.js Outdated
@eviltester

Copy link
Copy Markdown
Owner Author

Addressed the remaining top-level review notes in 85fe188:

  • For CodeRabbit's Tabulator filter-test nit, the duplicate-column regression tests now apply a real global filter in the stub and assert active rows before and after setGridFromGenericDataTable/applyGeneratedSchemaAmend, instead of only checking refreshFilter calls.
  • For Greptile's duplicate -0 note, autoIncrement.sequence now rejects -0 via strict zero comparison and has explicit regression coverage.

@eviltester eviltester merged commit 7b6a120 into master Jun 29, 2026
18 checks passed
@eviltester eviltester deleted the 266-auto-defect-fixes branch June 29, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants