AlejandroMorgante opened a new pull request, #70160: URL: https://github.com/apache/airflow/pull/70160
Adds foundational Oracle Cloud Infrastructure support to the Oracle provider so Airflow can integrate with OCI Generative AI Hosted Applications and Hosted Deployments. OCI Generative AI management APIs are available through the official OCI Python SDK, while the Oracle provider previously focused on Oracle Database integrations. This PR establishes the reusable OCI connection and native-client hooks needed before lifecycle operators can be added in follow-up work. ## New connection - **`oci` connection type** — stores inline OCI API key credentials, a default region, and an optional compartment OCID independently from the existing Oracle Database connection. - **Authentication support** — supports API key, OCI configuration file, instance principal, and resource principal authentication. - **Connection test** — validates credentials through `IdentityClient.list_regions` without depending on a Generative AI resource. - **Connection UI** — provides declarative and legacy metadata for the OCI-specific fields, labels, placeholders, hidden fields, and private-key password handling. ## New hooks - **`OciBaseHook`** — builds OCI SDK configuration and signers, creates native OCI service clients, resolves compartment IDs, supports explicit service endpoints, and caches the configured client. - **`OciGenerativeAIHook`** — selects and exposes the native `GenerativeAiClient` through `conn` and `get_conn()` for Hosted Application, Hosted Deployment, and work-request lifecycle operations. The hook architecture follows the native-client pattern used by the Amazon provider's boto3 hooks: the specialized hook selects the appropriate SDK client while callers and future operators use the native client directly. This preserves OCI response data, ETags, request identifiers, work-request identifiers, retry options, pagination, and concurrency-control arguments. ## Packaging and security - The OCI SDK is available through the optional `oci` provider extra because it requires the LGPL-licensed `crc32c` transitive dependency. OCI functionality is therefore genuinely optional for users who only use Oracle Database integrations. - Hook modules remain importable without the OCI SDK and raise `AirflowOptionalProviderFeatureException` with installation guidance when OCI functionality is requested. - File-based credentials, principal authentication, and custom service endpoints are explicit hook arguments controlled by Dag authors. Connection fields retain inline credentials and defaults, preventing Connection editors from selecting worker-local files, ambient OCI identities, or non-standard endpoints. ## Other changes - Provider metadata and generated provider information for the new OCI integration, connection, and hooks. - Documentation for OCI authentication, connection configuration, security boundaries, Generative AI endpoint mappings, Hosted Application authentication variants, and native-client examples. - Unit tests for the base hook, authentication modes, client construction, optional SDK behavior, UI metadata, security boundaries, and Generative AI client selection. ## Testing - **Provider suite:** 100 Oracle provider tests passed. - **Coverage:** the new hooks have 100% statement and branch coverage. - **Static validation:** provider mypy, pre-commit and manual checks, selective-checks, and `uv lock --check` passed. - **Documentation:** the Oracle provider documentation build passed. - **Optional dependency:** both hook modules import without the OCI SDK installed, and the missing-extra failure path is covered. - **Live OCI smoke test:** the `oci_default` Connection test succeeded using inline `key_content`, and the native Generative AI hook listed Hosted Applications and Hosted Deployments in `us-chicago-1`. No OCI resources were created, updated, or deleted during the live smoke test. ## Connection UI This PR introduces a new Connection type, so there is no equivalent before state. <img width="3014" height="1714" alt="OCI Connection form" src="https://github.com/user-attachments/assets/e87c1513-a116-402a-bddb-2e0ef6d41aec" /> --- ##### 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
