You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Vamsi-klu (via GitHub)" <gi...@apache.org> on 2026/07/11 04:47:46 UTC
[PR] UI: Preserve raw connection extra JSON [airflow]
Vamsi-klu opened a new pull request, #69741:
URL: https://github.com/apache/airflow/pull/69741
## Problem
Editing a Snowflake connection in the UI could silently rewrite the raw `extra` JSON. If the connection had manually entered extras such as `{"account":"1234"}`, opening and saving the form could replace that JSON with provider-field defaults like `{"insecure_mode":false}`.
closes: #57984
## What Changed
The connection form now preserves the raw `extra` JSON as the source of truth for keys that the user did not change through provider-specific fields.
Provider extra fields are initialized from matching keys in the raw JSON, but untouched provider defaults are not serialized back into the JSON. When a user edits a provider field, only that changed key is merged into the existing JSON. Clearing a provider field removes that key while preserving unrelated keys.
## Impact
Users can safely edit Snowflake connections without losing manually configured extras. Existing raw JSON keys are preserved, and defaults such as `insecure_mode: false` are not injected unless the user explicitly changes the field.
## Testing
- `pnpm exec vitest run src/queries/useParamStore.test.ts src/pages/Connections/ConnectionForm.test.tsx`
- `pnpm lint`
- Commit hook: `Compile / format / lint UI`
- `git diff --check`
The tests cover the problem statement expectations: preserving `account`, avoiding untouched `insecure_mode`, preserving unknown keys, merging changed provider fields, and removing cleared provider fields.
---
##### Was generative AI tooling used to co-author this PR?
- [X] Yes — Codex (GPT-5)
Generated-by: Codex (GPT-5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] UI: Preserve raw connection extra JSON [airflow]
Posted by "Vamsi-klu (via GitHub)" <gi...@apache.org>.
Vamsi-klu commented on PR #69741:
URL: https://github.com/apache/airflow/pull/69741#issuecomment-4965893473
@bbovenzi thanks for asking for screenshots. I captured this from the latest PR branch/commit.
### Screenshot proof
1. **Snowflake provider fields loaded from raw Extra JSON**
- Shows: the real Airflow Connections edit form for `pr_69741_snowflake_raw_extra_714`, with `Account` populated from raw extra and other provider fields still blank.
- Addresses: request for visual proof of the new connection form behavior.
- Screenshot: 
2. **Raw Extra JSON preserved before provider edits**
- Shows: raw JSON contains only `account` and `unknown`; no untouched provider default such as `insecure_mode` was injected.
- Addresses: preservation of raw/provider-unknown extras on reopen.
- Screenshot: 
3. **Provider edit merges into raw Extra JSON**
- Shows: after typing `test_warehouse` in the provider `Warehouse` field, raw JSON keeps `unknown`, adds `warehouse`, and still omits `insecure_mode`.
- Addresses: the changed behavior for provider-field edits without losing raw extras or adding untouched defaults.
- Screenshot: 
### Validation
- Branch/commit: `fix-57984-snowflake-extra` / `5247ca8b39d848b5ccd1f679b26b0ef0ded6ee5a`
- Browser/viewport: `Chromium, 1440x1100`
- Manual flow: `Connections -> edit pr_69741_snowflake_raw_extra_714 -> Extra Fields / Extra Fields JSON`
- Local check: `pnpm test ConnectionForm.test.tsx useParamStore.test.ts` passed (`2` files, `5` tests)
- CI: current PR checks returned no failing checks; relevant Airflow React UI and browser e2e checks are passing
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] UI: Preserve raw connection extra JSON [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi closed pull request #69741: UI: Preserve raw connection extra JSON
URL: https://github.com/apache/airflow/pull/69741
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] UI: Preserve raw connection extra JSON [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on code in PR #69741:
URL: https://github.com/apache/airflow/pull/69741#discussion_r3573979511
##########
airflow-core/newsfragments/69741.bugfix.rst:
##########
Review Comment:
Dont need a newsfragment
##########
airflow-core/src/airflow/ui/src/queries/useParamStore.ts:
##########
@@ -45,75 +45,180 @@ type FormStore = {
conf: string;
disabled: boolean;
initialParamDict: ParamsSpec;
+ initParamsDictFromConf: (newParamsDict: ParamsSpec) => void;
+ mergeParamUpdatesIntoConf: boolean;
paramsDict: ParamsSpec;
+ paramsDictSnapshot: ParamsSpec;
setConf: (confString: string) => void;
setDisabled: (disabled: boolean) => void;
setInitialParamDict: (newParamsDict: ParamsSpec) => void;
+ setMergeParamUpdatesIntoConf: (mergeParamUpdatesIntoConf: boolean) => void;
Review Comment:
Could we try to simplify or at least document the variables and the logic flow here. It's hard to understand what a paramsDictSnapshot or setMergeParamUpdatesIntoConf mean.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] UI: Preserve raw connection extra JSON [airflow]
Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #69741:
URL: https://github.com/apache/airflow/pull/69741#issuecomment-4971020565
Thanks for the screenshots.
Actually I am going to close this. The issue was reported in 2.11, I cannot replicate in 3.X. Also, this PR is adding too much complexity by tracking ever more variables with confusingly similar names. This makes the connection form even harder to understand and therefore maintain.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org