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
65 changes: 65 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -586,3 +586,68 @@ jobs:
echo "This PR changes workflow, composite-action, or dependabot config files."
echo "Require explicit human review before merge."
} >> "$GITHUB_STEP_SUMMARY"

# Single required status check that aggregates the conditional smoke jobs
# above. Branch protection can't require those jobs individually: each is
# conditional (per-manifest, and Firewall-free vs -enterprise per author), so
# on any given PR most are legitimately skipped -- and a required check whose
# job is skipped sits at "Expected -- Waiting for status to be reported"
# forever, blocking merge (the same trap that stranded Dependabot PRs on the
# e2e-* checks).
#
# This gate always runs (if: always(), so it reports even when upstream jobs
# are skipped or fail) and collapses them into one pass/fail signal: it FAILS
# if any smoke job that ran ended in failure or was cancelled, and passes when
# everything either succeeded or was not applicable. 'skipped' is expected and
# allowed -- it just means the job didn't apply to this PR.
#
# Mark THIS check (dependency-review-gate) required in branch protection. It
# satisfies Dependabot/fork PRs (which run the Firewall-free job) and
# maintainer PRs (which run Firewall-enterprise) alike, and -- crucially -- a
# Socket Firewall BLOCK now fails the gate and blocks merge, instead of living
# in a non-required enterprise job that nobody is forced to run.
dependency-review-gate:
needs:
- inspect
- python-sfw-smoke-free
- python-sfw-smoke-enterprise
- fixture-npm-sfw-smoke-free
- fixture-npm-sfw-smoke-enterprise
- fixture-pypi-sfw-smoke-free
- fixture-pypi-sfw-smoke-enterprise
- dockerfile-smoke
if: always()
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Verify no smoke job failed
env:
RESULTS: ${{ toJSON(needs) }}
run: |
echo "Upstream job results:"
printf '%s\n' "$RESULTS" | python3 -m json.tool

# Fail the gate if any needed job ended in failure or was cancelled.
# 'success' and 'skipped' both pass: skipped means the job did not
# apply to this PR (wrong manifest, or free-vs-enterprise mismatch).
failed="$(printf '%s\n' "$RESULTS" | python3 -c "
import json, sys
data = json.load(sys.stdin)
bad = [name for name, info in data.items()
if info.get('result') in ('failure', 'cancelled')]
print(' '.join(sorted(bad)))
")"

if [ -n "$failed" ]; then
echo "::error::dependency-review smoke job(s) failed: $failed"
{
echo "## Dependency Review Gate: FAILED"
echo "The following smoke job(s) failed or were cancelled: \`$failed\`"
echo "If a Socket Firewall job is listed, it likely BLOCKED an install --"
echo "inspect its uploaded sfw-artifacts/ report before merging."
} >> "$GITHUB_STEP_SUMMARY"
exit 1
fi

echo "All dependency-review smoke jobs passed or were not applicable."
echo "## Dependency Review Gate: PASSED" >> "$GITHUB_STEP_SUMMARY"
31 changes: 31 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,34 @@ jobs:
env:
SOCKET_SECURITY_API_KEY: ${{ secrets.SOCKET_CLI_API_TOKEN }}
run: bash ${{ matrix.validate }}

# Branch protection requires the e2e-* checks, but the `e2e` job above is
# skipped on PRs that can't access repository secrets -- fork PRs and
# Dependabot PRs. A job skipped via a job-level `if` never expands its
# matrix, so the e2e-* check contexts are never created and the required
# checks sit at "Expected -- Waiting for status to be reported" forever,
# permanently blocking merge.
#
# This bypass reports a green status under the SAME e2e-* check names for
# exactly those PRs, satisfying branch protection without running the real
# tests (which need SOCKET_CLI_API_TOKEN). Its `if` is the precise negation
# of the e2e job's run condition, so the two are mutually exclusive: any
# given PR runs one or the other, never both, and never neither.
#
# Dependency-bump risk on these PRs is still covered by dependency-review.yml's
# Socket Firewall smoke jobs, which run without repository secrets.
e2e-bypass:
if: >-
github.event_name == 'pull_request' &&
(github.event.pull_request.head.repo.full_name != github.repository ||
github.event.pull_request.user.login == 'dependabot[bot]')
runs-on: ubuntu-latest
strategy:
matrix:
name: [scan, sarif, reachability, gitlab, json, pypi]
name: e2e-${{ matrix.name }}
steps:
- name: Report skip status
run: |
echo "Skipping e2e-${{ matrix.name }} for a PR without repository secrets"
echo "(fork or Dependabot). Dependency risk is covered by dependency-review.yml."
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 2.4.5

### Changed: Bump required SDK version to `>=3.2.1`

- Picks up `socketdev 3.2.1`.
- No CLI logic changes.

## 2.4.4

### Changed: Bump required SDK version to `>=3.2.0`
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"

[project]
name = "socketsecurity"
version = "2.4.4"
version = "2.4.5"
requires-python = ">= 3.11"
license = {"file" = "LICENSE"}
dependencies = [
Expand All @@ -16,7 +16,7 @@ dependencies = [
'GitPython',
'packaging',
'python-dotenv',
"socketdev>=3.2.0,<4.0.0",
"socketdev>=3.2.1,<4.0.0",
"bs4>=0.0.2",
"markdown>=3.10",
"brotli>=1.0.9; platform_python_implementation == 'CPython'",
Expand Down
2 changes: 1 addition & 1 deletion socketsecurity/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__author__ = 'socket.dev'
__version__ = '2.4.4'
__version__ = '2.4.5'
USER_AGENT = f'SocketPythonCLI/{__version__}'
10 changes: 5 additions & 5 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading