vatsrahul1001 commented on code in PR #74837:
URL: https://github.com/apache/airflow/pull/74837#discussion_r4294515512


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/connections.py:
##########
@@ -452,7 +452,8 @@ def enqueue_connection_test(
     else:
         effective_team = test_body.team_name
 
-    auth_method: ResourceMethod = "PUT" if existing is not None and 
test_body.commit_on_success else "POST"
+    commit_allows_update = existing is not None and test_body.commit_on_success

Review Comment:
   Question: this closes the create-only case, but if the test is queued with 
`commit_on_success` for an existing connection (`commit_allows_update=True`), I 
think it can still overwrite a newer one. For example, user A queues the test, 
user B edits the connection, then A's test succeeds and commits over B's edit. 
Same if the connection is deleted and re-created by someone else in the 
meantime.
   
   Is that intentionally out of scope for 3.4.0 (this PR only addresses the 
create-only case)? If so, a sentence in the description or newsfragment saying 
so would help. Otherwise I guess it would need some kind of version / 
`updated_at` check at commit time.



-- 
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]

Reply via email to