Skip to content

ci: Restore Socket Firewall with PUBLIC_SOCKET_FIREWALL_TOKEN - #50

Merged
gjtorikian merged 1 commit into
mainfrom
devin/1795036701-restore-socket-firewall
Nov 18, 2026
Merged

gjtorikian merged 1 commit into
mainfrom
devin/1795036701-restore-socket-firewall

Conversation

@peakematt

@peakematt peakematt commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

#47 dropped the workos/setup-socket-firewall steps from lint, test, release and release-please, along with scripts/sfw-macos-getent.sh, by accident (the PR was a codex fix). This PR restores them as they were before #47.

The token they read is secrets.SOCKET_FIREWALL_TOKEN, which pull request runs can't get. They now read secrets.PUBLIC_SOCKET_FIREWALL_TOKEN, the secret set up for this public repo, and the workflow_call secret release-please.yml passes to release.yml is renamed to match. Lint and test also set allow-external-fork-fallback: true so fork PRs still run, the same as workos-node's CI.


👀 1 finding for you to triage · Follow Devin's work

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Prompt hidden (unlisted session)

@peakematt
peakematt marked this pull request as ready for review November 18, 2026 21:23
@gjtorikian
gjtorikian merged commit 7374959 into main Nov 18, 2026
16 of 17 checks passed
@gjtorikian
gjtorikian deleted the devin/1795036701-restore-socket-firewall branch November 18, 2026 21:25

@devin-ai-integration devin-ai-integration Bot left a comment

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.

Devin Review found 1 finding. It is left for you to triage below.

View findings in Devin Review · Follow Devin's work

Devin Review

Comment on lines +97 to +100
uses: workos/setup-socket-firewall@ca93dd8aa351f54f4729fe3377a9be23c631c25d
with:
token: ${{ secrets.PUBLIC_SOCKET_FIREWALL_TOKEN }}
configure-bun: true

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.

🟡 Fork pull requests fail release validation

On external fork PRs, setup-socket-firewall receives an empty token because GitHub withholds repository secrets. Both build and pack-check omit allow-external-fork-fallback, so the action rejects the missing token. All four binary builds and the tarball self-check fail before dependency installation.

Devin left this for you to triage: This is real: release.yml's build and pack-check jobs run on pull requests, so fork PRs would fail there. The fix is to add allow-external-fork-fallback: true to those two setup-socket-firewall steps and leave the publish step as it is. It's held until Matt OKs pushing to his PR.

Learn more

The pinned action defaults allow-external-fork-fallback to false. Its setup script rejects an empty token unless that input is enabled and the event is an external pull request against a public repository. GitHub withholds repository secrets from fork PRs regardless of the secret's name. The pack-check job has the same omission, while lint and test already enable the fallback.

Example: A contributor opens a PR from alice/quickstudy into the public upstream repository. The token resolves to an empty string, so all four binary builds and the tarball self-check fail during Socket Firewall setup instead of validating the contribution.

Recommended fix: Set allow-external-fork-fallback: true on both the build and pack-check setup steps. The action independently limits fallback to public external-fork pull requests, preserving fail-closed behavior for release publishing.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@greptile-apps

greptile-apps Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes reach CI checks and the release workflow's package-download and publishing paths.

Add the fork fallback to both release checks before merging.

Findings

  1. P1 Fork release checks lack fallback ▶
  2. P2 Restore the helper tests too ▶
Fix with agent prompt
### Issue 1
.github/workflows/release.yml:98-100
**Fork release checks lack fallback.** `release.yml` also runs on `pull_request`, but neither this setup step nor the one in `pack-check` enables `allow-external-fork-fallback`. External fork runs receive no repository secrets, regardless of the `PUBLIC_` prefix, so these jobs lack the token needed for setup and cannot reach their build checks. Add the same fallback used in lint and test to both PR-facing setup steps.

### Issue 2
scripts/sfw-macos-getent.sh:117-122
**Restore the helper tests too.** This brings back the macOS helper without the tests that previously covered it in `tests/ci-sfw-release.test.ts`. Restore the helper-specific cases for IPv4/IPv6, loopback records, empty results, and failed or malformed replies. The existing `__test_getent` entry point lets these run on Linux, so bad DNS replies need not go unchecked until a macOS release build.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

Restores Socket Firewall for CI and releases using PUBLIC_SOCKET_FIREWALL_TOKEN, including explicit teardown and a macOS helper.

  • Lint and test installs now use the Socket Firewall.
  • Release jobs protect package downloads with the public firewall token.
  • macOS release builds use a temporary getent shim during firewall teardown.

Reviews (1) · Last reviewed commit: "ci: Restore Socket Firewall with PUBLIC_..." · Reviewed by Greptile

Comment on lines +98 to +100
with:
token: ${{ secrets.PUBLIC_SOCKET_FIREWALL_TOKEN }}
configure-bun: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Fork release checks lack fallback. release.yml also runs on pull_request, but neither this setup step nor the one in pack-check enables allow-external-fork-fallback. External fork runs receive no repository secrets, regardless of the PUBLIC_ prefix, so these jobs lack the token needed for setup and cannot reach their build checks. Add the same fallback used in lint and test to both PR-facing setup steps.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/release.yml
Line: 98-100

Comment:
**Fork release checks lack fallback.** `release.yml` also runs on `pull_request`, but neither this setup step nor the one in `pack-check` enables `allow-external-fork-fallback`. External fork runs receive no repository secrets, regardless of the `PUBLIC_` prefix, so these jobs lack the token needed for setup and cannot reach their build checks. Add the same fallback used in lint and test to both PR-facing setup steps.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +117 to +122
__test_getent)
shift
[ "$#" -ge 1 ] || { usage; exit 2; }
test_dscacheutil="$1"
shift
emit_ahosts "$test_dscacheutil" "$@"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Restore the helper tests too. This brings back the macOS helper without the tests that previously covered it in tests/ci-sfw-release.test.ts. Restore the helper-specific cases for IPv4/IPv6, loopback records, empty results, and failed or malformed replies. The existing __test_getent entry point lets these run on Linux, so bad DNS replies need not go unchecked until a macOS release build.

Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/sfw-macos-getent.sh
Line: 117-122

Comment:
**Restore the helper tests too.** This brings back the macOS helper without the tests that previously covered it in `tests/ci-sfw-release.test.ts`. Restore the helper-specific cases for IPv4/IPv6, loopback records, empty results, and failed or malformed replies. The existing `__test_getent` entry point lets these run on Linux, so bad DNS replies need not go unchecked until a macOS release build.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants