jscheffl commented on PR #45251:
URL: https://github.com/apache/airflow/pull/45251#issuecomment-2564378607
> @pierrejeambrun @jscheffl @bbovenzi
>
> I can see that the patch variable api have a check
>
> ```
> if patch_body.key != variable_key:
> raise HTTPException(
> status.HTTP_400_BAD_REQUEST, "Invalid body, key from request
body doesn't match uri parameter"
> )
> non_update_fields = {"key"}
> ```
>
> Is this introduced new that we can't edit the variable key? I checked in
the legacy UI and I was able to edit it.
I believe that this is an artefact from the migration of public API from
Connexion to Fast API, this validation was converted 1:1.
The legacy UI was _not_ using the public API but was directly writing to DB.
So technically we have two options:
1. Restrict changing the key in UI, make the key field read-only when editing
2. Remove the validation in Rest API
3. Add a UI specific API just for this
From UI Perspective dis-allowing to change the key does not make sense. So
I'd propose to remove the validation in REST API. For option 1 I see no reason.
And Option 3 is too much overhead just because of a cross-validation in API
Any other opinions?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]