Skip to content

Centralize variable lookup policies - #1535

Merged
lovasoa merged 2 commits into
mainfrom
codex/cleanup-variable-access
Oct 7, 2026
Merged

lovasoa merged 2 commits into
mainfrom
codex/cleanup-variable-access

Conversation

@lovasoa

@lovasoa lovasoa commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Centralize request-variable lookup and merged enumeration in a private view. GET values remain borrowed, SET values release their RefCell borrow before returning, and explicitly NULL SET values suppress request fallbacks. Merged enumeration streams through Serde with SET > POST > GET precedence.

The existing $name lookup remains SET then GET, with the same POST deprecation warnings. Source-specific sqlpage.variables behavior and public Rust interfaces are unchanged.

Reuse existing regression structures:

  • Extend test_variables_function and its SQL page with GET/POST array collisions, array lookups, missing and POST-only compatibility lookups, and a SET NULL phase. The same test checks merged and source-specific enumeration before SET, after SET, and after NULL assignment.
  • Extend the existing immutable-variable fixture with NULL suppression and unchanged GET enumeration instead of adding a separate fixture.
  • Keep one parameterized unit test for Missing versus explicit NULL, borrowed request scalars, owned SET scalars/arrays, and releasing the SET RefCell borrow before the returned value is consumed.
  • Retain the run_sql isolation fixture covering inherited parent variables, child mutation, and explicit NULL input without changing the parent scope.

The variable-access unit test module shrinks from 93 lines to 44, and total PR additions decrease from 214 to 195. The consolidation changes tests only.

Validation: cargo fmt --all, formatting check, cargo clippy --all-targets --all-features -- -D warnings, and cargo test --features odbc-static passed (236 unit and 89 integration tests with in-memory SQLite). Local fixture servers required running tests outside the network sandbox.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T10:20:49.685033Z da7cf0d New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lovasoa
lovasoa added this pull request to the merge queue Oct 7, 2026
lovasoa added a commit that referenced this pull request Oct 7, 2026
Merge the queued squash commit for PR #1535. Preserve its array and null-value assertions alongside PR #1529 production-app request helpers.
Merged via the queue into main with commit 359f224 Oct 7, 2026
52 checks passed
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.

1 participant