Skip to content

Reject non-object JSON files when importing variables - #75384

Merged
vatsrahul1001 merged 1 commit into
apache:mainfrom
himanshuchawla0807-gif:fix/variable-import-json-object
Oct 29, 2026
Merged

vatsrahul1001 merged 1 commit into
apache:mainfrom
himanshuchawla0807-gif:fix/variable-import-json-object

Conversation

@himanshuchawla0807-gif

Copy link
Copy Markdown
Contributor

The Variables upload form currently accepts any valid JSON value as a dictionary. For example, ["example"] enables Import and is converted by Object.entries into a variable named 0; a JSON string is split into character-indexed variables. Numbers and booleans also enable an empty import, while null silently leaves the button disabled.

Require a non-null, non-array JSON object before enabling Import. Other document shapes now use the existing translated error, which already explains the expected key/value format. Nested values inside a valid object are preserved.

Validation:

  • Five invalid-document regression cases fail on unchanged main; all six component tests pass with the fix, including a valid-object submission control.
  • Full UI suite: 2,038 tests across 250 files pass. Simple-auth UI: 1 test passes.
  • TypeScript, scoped ESLint, production UI build, regular/manual prek checks and commit hooks pass. breeze verify --json selects both UI suites, which were run. Manual hooks unrelated to these files correctly skip.
  • Actual component browser fixture confirms the same array enables Import before the change and shows the error with Import disabled afterward. This is local component verification, not a deployed Airflow/API end-to-end test.
Before After
Array wrongly enables Import Array shows an error and Import stays disabled

Was generative AI tooling used to co-author this PR?
  • Yes — OpenAI Codex

Generated-by: OpenAI Codex following the guidelines

No prior human review is claimed.

Array and primitive documents cannot represent a mapping of variable names to values and can otherwise enable unintended imports.
@boring-cyborg boring-cyborg Bot added the area:UI Related to UI/UX. For Frontend Developers. label Oct 22, 2026
@bbovenzi bbovenzi added the backport-to-v3-4-test Backport to v3-4-test label Oct 27, 2026
@bbovenzi bbovenzi added this to the Airflow 3.4.0 milestone Oct 27, 2026
@bbovenzi
bbovenzi enabled auto-merge (squash) October 27, 2026 17:39
@vatsrahul1001
vatsrahul1001 merged commit eafb6ed into apache:main Oct 29, 2026
77 of 78 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

vatsrahul1001 pushed a commit that referenced this pull request Oct 29, 2026
…5384)

Array and primitive documents cannot represent a mapping of variable names to values and can otherwise enable unintended imports.
(cherry picked from commit eafb6ed)

Co-authored-by: Himanshu Chawla <himanshuchawla0807@gmail.com>
Co-authored-by: Himanshu Chawla <241715894+himanshuchawla0807-gif@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 30, 2026
…5384) (#75950)

Array and primitive documents cannot represent a mapping of variable names to values and can otherwise enable unintended imports.
(cherry picked from commit eafb6ed)

Co-authored-by: Himanshu Chawla <himanshuchawla0807@gmail.com>
Co-authored-by: Himanshu Chawla <241715894+himanshuchawla0807-gif@users.noreply.github.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 30, 2026
…5384) (#75950)

Array and primitive documents cannot represent a mapping of variable names to values and can otherwise enable unintended imports.
(cherry picked from commit eafb6ed)

Co-authored-by: Himanshu Chawla <himanshuchawla0807@gmail.com>
Co-authored-by: Himanshu Chawla <241715894+himanshuchawla0807-gif@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers. backport-to-v3-4-test Backport to v3-4-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants