Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/actions/private-git-deps-auth/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# TK-TODO: Temporary. `airbyte-server-models` is consumed from the private airbyte-ops-mcp repo
# until it is published to PyPI (airbytehq/airbyte-ops-mcp#1326). Remove this action and its
# call sites once pyproject.toml pins a released version.
name: Authenticate git for private dependency repos

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partly mitigated in 30edcb4. The app token is now least-privilege (permission-contents: read, scoped to airbytehq/airbyte-ops-mcp only). On the exposure itself: python_lint/python_pytest trigger on pull_request, so fork PRs never receive these secrets. Same-repo branches already need write access, and those authors can read secrets by editing any workflow, so loading the action from the PR checkout doesn't widen access. The slash-command workflows (test-pr-command, etc.) already used this pattern before this PR. The action is temporary (TK-TODO) and goes away once airbyte-server-models is published to PyPI. Leaving this thread open for a maintainer to decide whether to move it to a trusted reusable workflow in the meantime.

Written by Devin

description: Authenticate git for private dependency repos
inputs:
app-id:
description: GitHub App ID.
required: true
private-key:
description: GitHub App private key.
required: true
runs:
using: composite
steps:
- name: Create GitHub App token
id: get-app-token
uses: actions/create-github-app-token@67018539274d69449ef7c02e8e71183d1719ab42 # v2.1.4
with:
owner: "airbytehq"
repositories: "airbyte-ops-mcp"
permission-contents: read
app-id: ${{ inputs.app-id }}
private-key: ${{ inputs.private-key }}
- name: Configure git credentials for airbyte-ops-mcp
shell: bash
env:
GH_APP_TOKEN: ${{ steps.get-app-token.outputs.token }}
run: |
git config --global url."https://x-access-token:${GH_APP_TOKEN}@github.com/airbytehq/airbyte-ops-mcp".insteadOf "https://github.com/airbytehq/airbyte-ops-mcp"
5 changes: 5 additions & 0 deletions .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
version: "latest"
python-version: '3.11'

- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/fix-pr-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ jobs:
with:
version: "latest"
python-version: ${{ matrix.python-version }}
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pydoc_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
version: "latest"
python-version: '3.11'

- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pydoc_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ jobs:
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5

- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/python_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
with:
version: "latest"
python-version: '3.11'
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand All @@ -44,6 +49,11 @@ jobs:
with:
version: "latest"
python-version: '3.11'
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand All @@ -64,6 +74,11 @@ jobs:
with:
version: "latest"
python-version: '3.11'
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand All @@ -86,6 +101,11 @@ jobs:
with:
version: "latest"
python-version: '3.11'
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/python_pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ jobs:
with:
version: "latest"
python-version: '3.11'
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down Expand Up @@ -130,6 +135,11 @@ jobs:
with:
version: "latest"
python-version: ${{ matrix.python-version }}
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down Expand Up @@ -233,6 +243,11 @@ jobs:
with:
version: "latest"
python-version: '3.11'
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down Expand Up @@ -311,6 +326,11 @@ jobs:
with:
version: "latest"
python-version: '3.11'
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down Expand Up @@ -357,6 +377,11 @@ jobs:
with:
version: "latest"
python-version: '3.11'
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-pr-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ jobs:
with:
version: "latest"
python-version: ${{ matrix.python-version }}
- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}
- name: Install dev dependencies
# We only need helper libraries
run: uv sync --group dev
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/uv-lock-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ jobs:

# Run `uv lock`

- name: Authenticate git for private dependencies
uses: ./.github/actions/private-git-deps-auth
with:
app-id: ${{ secrets.OCTAVIA_BOT_APP_ID }}
private-key: ${{ secrets.OCTAVIA_BOT_PRIVATE_KEY }}

- name: Run `uv lock`
run: uv lock

Expand Down
10 changes: 5 additions & 5 deletions airbyte/_util/api_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
for type hinting purposes.

Design Guidelines:
- No modules except `api_util` and `api_imports` should import from `airbyte_api`.
- If a module needs to import from `airbyte_api`, it should import from `api_imports` (this module)
instead.
- No modules except `api_util` and `api_imports` should import from `airbyte_server_models`.
- If a module needs to import from `airbyte_server_models`, it should import from
`api_imports` (this module) instead.
- This module is divided into two sections: internal-use classes and public-use classes.
- Public-use classes should be carefully reviewed to ensure that they are necessary for public use
and that we are willing to support them as part of PyAirbyte.
Expand All @@ -21,7 +21,7 @@
# Internal-Use Classes

# These classes are used internally to cache API responses.
from airbyte_api.models import (
from airbyte_server_models.public_api import (
ConnectionResponse,
DestinationResponse,
JobResponse,
Expand All @@ -32,7 +32,7 @@

# This class is used to represent the status of a job. It may be used in
# type hints for public functions that return a job status.
from airbyte_api.models import JobStatusEnum # Alias not needed
from airbyte_server_models.public_api import JobStatusEnum # Alias not needed


__all__: list[str] = [
Expand Down
Loading
Loading