Skip to content
Merged
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
44 changes: 30 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,21 @@ jobs:
} >> "$GITHUB_STEP_SUMMARY"

nightly-submodules:
# Always runs (cheap) so the build jobs' `needs:` never short-circuits
# them. Only does real work on the nightly cron or `submodules=latest`:
# resolves every submodule, recursively, to its upstream master and
# Only runs in latest mode: the nightly cron or `submodules=latest`.
# Resolves every submodule, recursively, to its upstream master and
# reports whether anything moved relative to the committed pointers.
# Build jobs check out exactly these SHAs so every leg tests the same
# tips even when they start minutes apart. Nothing is committed.
#
# On every other trigger this job is skipped, so ordinary pushes, PRs and
# release tags do not queue a runner to do nothing. Its dependents carry
# `!cancelled()` so a skipped dependency does not cascade into skipping
# them, and they read its outputs as empty, which their conditions and
# `name:` expressions already treat as pinned mode.
name: Resolve latest submodule tips (nightly)
if: >-
(github.event_name == 'schedule' && github.event.schedule == '0 3 * * *')
|| inputs.submodules == 'latest'
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.resolve.outputs.latest }}
Expand Down Expand Up @@ -379,8 +387,10 @@ jobs:
# Normal triggers as before; additionally the nightly cron, but only when
# a submodule actually moved off its committed pointer.
if: >-
github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
|| (needs.nightly-submodules.outputs.latest == 'true' && needs.nightly-submodules.outputs.moved == 'true')
!cancelled()
&& contains(fromJSON('["success", "skipped"]'), needs.nightly-submodules.result)
&& (github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
|| (needs.nightly-submodules.outputs.latest == 'true' && needs.nightly-submodules.outputs.moved == 'true'))
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v7
Expand Down Expand Up @@ -446,13 +456,15 @@ jobs:
run: python3 -m pytest scripts/tests/test_generate_latest_json.py scripts/tests/test_configure_tauri_release.py -q

build-qt:
name: Build Qt artifacts${{ needs.nightly-submodules.outputs.latest == 'true' && ' [latest submodules]' || '' }}
name: Build Qt artifacts (${{ matrix.os }}${{ (matrix.research || (github.event_name == 'workflow_dispatch' && inputs.edition == 'research') || endsWith(github.ref_name, '-research')) && ', research' || '' }})${{ needs.nightly-submodules.outputs.latest == 'true' && ' [latest submodules]' || '' }}
needs: nightly-submodules
# Normal triggers as before; additionally the nightly cron, but only when
# a submodule actually moved off its committed pointer.
if: >-
github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
|| (needs.nightly-submodules.outputs.latest == 'true' && needs.nightly-submodules.outputs.moved == 'true')
!cancelled()

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.

P1 Latest dispatch falls back

When a manual run requests submodules=latest and the resolver fails, !cancelled() remains true and the workflow_dispatch branch still allows the dependent jobs to run. Because the failed resolver leaves latest empty, those jobs skip the latest-SHA checkout and build the pinned tree instead. This wastes the full build matrix and presents pinned-tree results for a run intended to validate the latest submodule tips.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Correct, and it contradicts a claim I made in the PR description. I wrote that a failed resolver still could not pull the build jobs in because their remaining condition needs latest == 'true' && moved == 'true'. That reasoning only holds for the schedule path: on a workflow_dispatch run the github.event_name == 'workflow_dispatch' disjunct short-circuits before the latest/moved check ever gets evaluated, so a failed resolver would have let the whole matrix build the pinned tree and report success for a run whose only purpose was to validate the latest tips.

Fixed in 5414cff by gating the dependents on the resolver's result as well:

&& contains(fromJSON('["success", "skipped"]'), needs.nightly-submodules.result)

A skipped resolver still passes through, which is what this PR is for; a failed or cancelled one blocks the dependents exactly as it did before the PR. Applied to all four dependents.

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.

You're right, and the distinction is important: on workflow_dispatch, the event-name disjunct bypassed the resolver-result check, so a failed latest-submodule resolution could have triggered a pinned-tree build. The additional needs.nightly-submodules.result gate fixes that while preserving the intended behavior: skipped proceeds for ordinary pinned runs, whereas failure and cancelled block all four dependents. No further concern with this fix.

&& contains(fromJSON('["success", "skipped"]'), needs.nightly-submodules.result)
&& (github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
|| (needs.nightly-submodules.outputs.latest == 'true' && needs.nightly-submodules.outputs.moved == 'true'))
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
env:
Expand Down Expand Up @@ -804,13 +816,15 @@ jobs:
path: dist/activitywatch-*.*

build-qt-manylinux-2-28:
name: Build Qt artifacts (manylinux_2_28 — glibc 2.28 ABI floor)${{ needs.nightly-submodules.outputs.latest == 'true' && ' [latest submodules]' || '' }}
name: Build Qt artifacts (manylinux_2_28 — glibc 2.28 ABI floor${{ ((github.event_name == 'workflow_dispatch' && inputs.edition == 'research') || endsWith(github.ref_name, '-research')) && ', research' || '' }})${{ needs.nightly-submodules.outputs.latest == 'true' && ' [latest submodules]' || '' }}
needs: nightly-submodules
# Normal triggers as before; additionally the nightly cron, but only when
# a submodule actually moved off its committed pointer.
if: >-
github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
|| (needs.nightly-submodules.outputs.latest == 'true' && needs.nightly-submodules.outputs.moved == 'true')
!cancelled()
&& contains(fromJSON('["success", "skipped"]'), needs.nightly-submodules.result)
&& (github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
|| (needs.nightly-submodules.outputs.latest == 'true' && needs.nightly-submodules.outputs.moved == 'true'))
runs-on: ubuntu-22.04
container:
image: quay.io/pypa/manylinux_2_28_x86_64
Expand Down Expand Up @@ -1110,13 +1124,15 @@ jobs:
path: dist/activitywatch-*.*

build-tauri:
name: Build Tauri artifacts${{ needs.nightly-submodules.outputs.latest == 'true' && ' [latest submodules]' || '' }}
name: Build Tauri artifacts (${{ matrix.os }}${{ (matrix.research || (github.event_name == 'workflow_dispatch' && inputs.edition == 'research') || endsWith(github.ref_name, '-research')) && ', research' || '' }})${{ needs.nightly-submodules.outputs.latest == 'true' && ' [latest submodules]' || '' }}
needs: nightly-submodules
# Normal triggers as before; additionally the nightly cron, but only when
# a submodule actually moved off its committed pointer.
if: >-
github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
|| (needs.nightly-submodules.outputs.latest == 'true' && needs.nightly-submodules.outputs.moved == 'true')
!cancelled()
&& contains(fromJSON('["success", "skipped"]'), needs.nightly-submodules.result)
&& (github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
|| (needs.nightly-submodules.outputs.latest == 'true' && needs.nightly-submodules.outputs.moved == 'true'))
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
env:
Expand Down
Loading