kolfild26 commented on code in PR #28998:
URL: https://github.com/apache/airflow/pull/28998#discussion_r1081657326


##########
airflow/api_connexion/endpoints/dag_run_endpoint.py:
##########
@@ -280,6 +285,12 @@ def get_dag_runs_batch(*, session: Session = NEW_SESSION) 
-> APIResponse:
     ],
 )
 @provide_session
+@action_logging(
+    event=action_event_from_permission(
+        prefix="log",

Review Comment:
   The same, as above. In other places we are logging the "main" object to its 
correspondent  table. For instance, in `connection_endpoint.py` we are logging 
the `Connection` object to `connection` table. In `variable_endpoint.py` we are 
logging the `Variable` object to `variable` table.
   
   Here is the difference, in `dag_run_endpoint.py` we are logging to `log` 
table rather than `dag_run` table.
   
   Based on that I decided not to have prefix in a global constatnt. I mean if 
we want to add something more to `dag_run` table we will need 
`RESOURCE_EVENT_PREFIX = "dag_run"` rather than `RESOURCE_EVENT_PREFIX = "log"`.
   
   @ephraimbuddy so, the question, is it ok to use `RESOURCE_EVENT_PREFIX` or 
it's better to use smth like `RESOURCE_EVENT_LOG_PREFIX` ?
   ```
   #example
   RESOURCE_EVENT_LOG_PREFIX = "log" 
   ...
   @action_logging(
       event=action_event_from_permission(
           prefix=RESOURCE_EVENT_LOG_PREFIX,
           permission=permissions.ACTION_CAN_CREATE,
       ),
   )
   ```



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