Skip to content

Commit ba79edb

Browse files
committed
ci: add Socket Firewall aggregator gate; bump 3.2.0 -> 3.2.1
Add a single sfw-gate job (if: always(), needs the conditional inspect + free/enterprise smoke + workflow-notice jobs) that fails only when an upstream job failed or was cancelled -- success and skipped both pass. This is the check intended to become the required status check on main: the smoke jobs are conditional (deps-changed gates them, and exactly one of free/enterprise runs per PR), so none can be required directly -- a required check whose job is if-skipped is never created and blocks merge forever. The gate is green when no deps change and is satisfied by whichever smoke path actually ran. NOT yet wired into branch protection -- added during a soak period so the check is visible before it becomes blocking, and so requiring it doesn't strand other open PRs. Pattern adapted from SocketDev/socket-python-cli #224. Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
1 parent 6beea88 commit ba79edb

4 files changed

Lines changed: 51 additions & 3 deletions

File tree

.github/workflows/dependency-review.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,3 +279,51 @@ jobs:
279279
echo "This PR changes workflow, composite-action, or dependabot config files."
280280
echo "Require explicit human review before merge."
281281
} >> "$GITHUB_STEP_SUMMARY"
282+
283+
# Aggregator gate -- the single check intended to become the required status
284+
# check on main. The Socket Firewall smoke jobs are conditional (deps-changed
285+
# gates them, and exactly one of free/enterprise runs per PR), so neither can
286+
# be required directly: a required check whose job is `if:`-skipped is never
287+
# created and sits at "Expected -- Waiting for status to be reported"
288+
# forever, permanently blocking merge (this hits every Dependabot/fork PR and
289+
# every PR that doesn't touch deps).
290+
#
291+
# This job runs unconditionally (`if: always()`), depends on all the
292+
# conditional jobs, and fails ONLY when one of them actually failed or was
293+
# cancelled. A `skipped` dependency passes -- so the gate is green when no
294+
# deps changed, and otherwise satisfied by whichever smoke path ran (free for
295+
# Dependabot/forks, enterprise for trusted maintainers). A real Socket
296+
# Firewall block surfaces as a smoke-job failure and thus a gate failure.
297+
#
298+
# NOT YET wired into branch protection -- added during a soak period so the
299+
# check is visible before it becomes blocking. Requiring it before it lands
300+
# on main would strand every other open PR on the trap above.
301+
sfw-gate:
302+
name: Socket Firewall Gate
303+
needs: [inspect, python-sfw-smoke-free, python-sfw-smoke-enterprise, workflow-notice]
304+
if: always()
305+
runs-on: ubuntu-latest
306+
timeout-minutes: 2
307+
steps:
308+
- name: Evaluate dependency-review results
309+
env:
310+
NEEDS_JSON: ${{ toJSON(needs) }}
311+
run: |
312+
echo "$NEEDS_JSON"
313+
# Fail iff any needed job reported failure or cancelled; success and
314+
# skipped both pass. jq returns the count of offending results.
315+
bad="$(printf '%s' "$NEEDS_JSON" \
316+
| jq '[to_entries[] | select(.value.result == "failure" or .value.result == "cancelled")] | length')"
317+
318+
{
319+
echo "## Socket Firewall Gate"
320+
printf '%s\n' "$NEEDS_JSON" | jq -r 'to_entries[] | "- \(.key): \(.value.result)"'
321+
} >> "$GITHUB_STEP_SUMMARY"
322+
323+
if [ "$bad" -ne 0 ]; then
324+
echo "Gate failed: $bad upstream job(s) failed or were cancelled." >> "$GITHUB_STEP_SUMMARY"
325+
echo "::error::Socket Firewall Gate failed -- $bad upstream job(s) failed or were cancelled."
326+
exit 1
327+
fi
328+
329+
echo "Gate passed." >> "$GITHUB_STEP_SUMMARY"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "socketdev"
7-
version = "3.2.0"
7+
version = "3.2.1"
88
requires-python = ">= 3.9"
99
dependencies = [
1010
'requests',

socketdev/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.2.0"
1+
__version__ = "3.2.1"

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)