baha-bouali opened a new pull request, #70682:
URL: https://github.com/apache/airflow/pull/70682

   Part of #70265 (related: #67056, migrates #70269).
   
   ## Why
   
   #67056 decoupled remote logging from the hardcoded `if/elif` chain in
   `airflow_local_settings.py`: core and the Task SDK now resolve the remote log
   handler via `ProvidersManager` dispatch, keyed on the URL scheme of
   `[logging] remote_base_log_folder`, and instantiate the provider's class
   through a no-arg `from_config()` classmethod. If `from_config()` is missing 
or
   raises, the shared factory falls back to the legacy branch — so this
   migration is non-breaking by construction.
   
   This PR migrates the `oss` scheme, following the same pattern already merged
   for S3 (#69817) and CloudWatch (#69816).
   
   ## What
   
   - Add `OSSRemoteLogIO.from_config()` in
     
`providers/alibaba/src/airflow/providers/alibaba/cloud/log/oss_task_handler.py`,
     mirroring the legacy `oss://` branch in `airflow_local_settings.py`:
     builds `base_log_folder` (with `expanduser`), `remote_base`, and
     `delete_local_copy` from Airflow config, merged with the IO-specific subset
     of `[logging] remote_task_handler_kwargs`.
   - No connection-id handling is added here — `OSSRemoteLogIO.hook` already
     resolves `[logging] remote_log_conn_id` on its own, the same way
     `S3RemoteLogIO`/`CloudWatchRemoteLogIO` do, so there's nothing for
     `from_config()` to do on that front.
   - Register the `oss` scheme under `remote-logging:` in the alibaba provider's
     `provider.yaml` (and the generated `get_provider_info.py`), so
     `ProvidersManager.remote_logging_handler_by_scheme("oss")` resolves to
     `OSSRemoteLogIO`.
   - Add tests mirroring `TestS3RemoteLogIOFromConfig`: building from config,
     merging `remote_task_handler_kwargs`, rejecting a non-dict
     `remote_task_handler_kwargs`, provider-scheme registration, and an
     end-to-end check that `resolve_remote_task_log` reaches `OSSRemoteLogIO` 
via
     provider dispatch without touching the legacy path.
   
   ## Verification
   
   <!-- Fill in after running a real task against an OSS bucket:
        - bucket/region used (redact the actual name if needed)
        - the `oss` connection config used (redacted secrets)
        - the DAG/task you ran
        - confirmation the log object appeared in the bucket and that the
          Airflow UI read the log back through the new dispatch path -->
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [ x] Yes (please specify the tool below)
   Assisted by Claude Sonnet 5, every line reviewed by the submitter.
   ---
   
   - Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information. Note: commit author/co-author name and email in commits 
become permanently public when merged.
   - For fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   - When adding dependency, check compliance with the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   - For significant user-facing changes create newsfragment: 
`{pr_number}.significant.rst`, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
 You can add this file in a follow-up commit after the PR is created so you 
know the PR number.


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