Skip to content
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/control-plane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ jobs:
ref: ${{ inputs.sha }}
path: app-repo
fetch-depth: 0
submodules: ${{ steps.control-check-policy.outputs.checkout_submodules == 'true' && inputs.event != 'pull_request' && 'recursive' || 'false' }}
submodules: ${{ steps.control-check-policy.outputs.checkout_submodules == 'true' && 'recursive' || 'false' }}
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false

Expand Down Expand Up @@ -494,7 +494,7 @@ jobs:
ref: ${{ matrix.target.sha }}
path: app-repo
fetch-depth: 0
submodules: ${{ matrix.target.checkout_submodules == true && matrix.target.event != 'pull_request' && 'recursive' || 'false' }}
submodules: ${{ matrix.target.checkout_submodules == true && 'recursive' || 'false' }}
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false

Expand Down
4 changes: 3 additions & 1 deletion src/aio_fleet/poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def poll_targets(
sha=sha,
event="pull_request",
source=f"pr:{number}",
checkout_submodules=False,
checkout_submodules=bool(
repo.raw.get("checkout_submodules")
),
publish=False,
)
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_control_plane_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ def test_app_code_checkouts_gate_submodule_checkout() -> None:

assert "checkout_submodules" in manual["with"]["submodules"] # nosec B101
assert (
"inputs.event != 'pull_request'" in manual["with"]["submodules"]
"inputs.event != 'pull_request'" not in manual["with"]["submodules"]
) # nosec B101
assert "checkout_submodules" in poll["with"]["submodules"] # nosec B101
assert (
"matrix.target.event != 'pull_request'" in poll["with"]["submodules"]
"matrix.target.event != 'pull_request'" not in poll["with"]["submodules"]
) # nosec B101


Expand Down
4 changes: 2 additions & 2 deletions tests/test_poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def test_poll_targets_require_same_repository_pr_identity(
]


def test_poll_targets_emit_checkout_submodules_only_for_main(
def test_poll_targets_emit_checkout_submodules_for_same_repo_pr_and_main(
tmp_path: Path, monkeypatch
) -> None:
manifest_path = _write_manifest(tmp_path, checkout_submodules=True)
Expand All @@ -94,7 +94,7 @@ def test_poll_targets_emit_checkout_submodules_only_for_main(
"pull_request",
"push",
]
assert targets[0].checkout_submodules is False # nosec B101
assert targets[0].checkout_submodules is True # nosec B101
assert targets[1].checkout_submodules is True # nosec B101


Expand Down