Skip to content

fix: upgrade Go to 1.26.3 + fix esbuild pnpm approval in e2e#28

Merged
Scetrov merged 17 commits into
mainfrom
chore/bump-codeql-and-crypto
May 11, 2026
Merged

fix: upgrade Go to 1.26.3 + fix esbuild pnpm approval in e2e#28
Scetrov merged 17 commits into
mainfrom
chore/bump-codeql-and-crypto

Conversation

@Scetrov
Copy link
Copy Markdown
Owner

@Scetrov Scetrov commented May 10, 2026

Summary

Security and tooling updates

  • Go: go 1.26.2 -> go 1.26.3 in go.mod and CI workflows
  • Go modules: bump golang.org/x/crypto and refresh related x/* dependencies in go.sum
  • CodeQL: update github/codeql-action pins in CI

E2E fix for pnpm/esbuild

  • Problem: efctl env up was failing inside the container with ERR_PNPM_IGNORED_BUILDS for esbuild
  • Cause: pnpm v10.26+ / v11 requires build-script approvals at the workspace level; the older onlyBuiltDependencies path was not sufficient for this containerized flow
  • Fix: patch pnpm-workspace.yaml in both builder-scaffold and world-contracts to set allowBuilds.esbuild: true
  • Implementation details:
    • use YAML-aware updates so existing allowBuilds: blocks are merged instead of duplicated
    • route generated paths through safePath before writing
    • expand tests for traversal rejection, idempotence, and existing / inline allowBuilds maps

Repo agent metadata

  • add the new .pi/agents/ instruction suite and update the managed agent manifests used for repo analysis and review workflows

Supporting docs and notes

  • update the pnpm/esbuild investigation notes to reflect the implemented pnpm-workspace.yaml approach
  • include the related review and handoff artifacts generated while landing the fix

Verification

  • go test ./pkg/setup/...

Copilot AI review requested due to automatic review settings May 10, 2026 18:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates security tooling and Go dependencies to their latest patch/minor releases, keeping CI scanning and crypto-related libraries current for the efctl CLI.

Changes:

  • Bump golang.org/x/crypto to v0.51.0 and refresh related indirect x/* dependencies (x/sys, x/term, x/text).
  • Update github/codeql-action (init/autobuild/analyze) from v4.35.2 to v4.35.3 with pinned SHAs.
  • Regenerate go.sum to match the updated module graph/checksums.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
go.mod Updates direct and indirect Go module versions for x/crypto and related x/* deps.
go.sum Updates checksums to reflect the new module versions pulled in by the bump.
.github/workflows/codeql.yml Advances CodeQL action pins to v4.35.3 for CodeQL scanning in CI.

Resolve GO-2026-4971 (panic in net.Dial/LookupPort with NUL byte on Windows)
and GO-2026-4918 (infinite loop in HTTP/2 transport with bad SETTINGS_MAX_FRAME_SIZE).

Both vulnerabilities are fixed in Go 1.26.3 standard library.
@Scetrov Scetrov changed the title chore: bump codeql-action to v4.35.3 and golang.org/x/crypto to v0.51.0 fix: upgrade Go to 1.26.3 to resolve govulncheck vulnerabilities May 10, 2026
The e2e 'env up' was failing inside the container with:
  [ERR_PNPM_IGNORED_BUILDS] Ignored build scripts: esbuild@0.27.2

pnpm 10+ requires build scripts to be explicitly approved via
onlyBuiltDependencies. The existing patch only wrote to package.json,
but pnpm 10+ with corepack may not pick it up reliably.

Now also writing onlyBuiltDependencies=esbuild to .npmrc in both
builder-scaffold and world-contracts workspace directories.
.npmrc is always read regardless of packageManager field, making
it the most reliable configuration method.

Added unit tests for the new .npmrc patching functionality.
Copilot AI review requested due to automatic review settings May 10, 2026 19:37
@Scetrov Scetrov changed the title fix: upgrade Go to 1.26.3 to resolve govulncheck vulnerabilities fix: upgrade Go to 1.26.3 + fix esbuild pnpm approval in e2e May 10, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Comment thread pkg/setup/pnpm_patch.go Outdated
Comment thread pkg/setup/pnpm_patch.go Outdated
Comment thread pkg/setup/pnpm_patch.go Outdated
Comment thread pkg/setup/pnpm_patch_test.go Outdated
Scetrov added 2 commits May 10, 2026 20:56
gosec v2.26.1 reports G703 (Path traversal via taint analysis) on
the os.WriteFile call in patchNpmrc. The path is already validated
by safePath before being passed in, so this is a false positive.
Added G703 to the #nosec suppression.
…lot suggestions

- Add 'pnpm approve-builds esbuild' to CmdDeployWorld to fix e2e CI
  failure caused by pnpm 10+ requiring explicit build script approval
  for esbuild (ERR_PNPM_IGNORED_BUILDS error)

- Fix CRLF handling in patchNpmrc to trim both \r and \n before
  appending, preventing Windows/CRLF line ending issues

- Fix incorrect #nosec G304 annotation on os.WriteFile call in
  patchNpmrc (should be G306 for write operations)

- Fix test error handling: properly check errors from os.ReadFile
  calls in TestPatchPackageJSON, TestPatchPackageJSON_NoPackageManager,
  and TestPatchNpmrc_Idempotent
Copilot AI review requested due to automatic review settings May 10, 2026 20:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.

Comment thread pkg/setup/pnpm_patch.go Outdated
Comment thread .pi/agents/thoughts-locator.md Outdated
Comment thread .pi/agents/thoughts-locator.md Outdated
Comment thread .pi/agents/codebase-pattern-finder.md Outdated
Comment thread .pi/agents/.rpiv-managed.json Outdated
Scetrov added 2 commits May 10, 2026 23:03
- Change patchPnpmDependencies to return error instead of void
- Aggregate per-repo failures with errors.Join for full visibility
- Update start.go to handle returned error and fail fast before container startup
- Fix containsAllowBuildsForEsbuild regex false-positive using single regex
  that verifies esbuild is nested under allowBuilds
- Align all CI jobs to use go-version-file: go.mod instead of hardcoded
  versions, matching codeql.yml approach
- Update stale comment to reflect pnpm-workspace.yaml approach
- Add test for error propagation when repo directory is missing
- Add false-positive guard test for regex detection
Copilot AI review requested due to automatic review settings May 11, 2026 15:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 26 out of 28 changed files in this pull request and generated 2 comments.

Comment thread pkg/setup/pnpm_patch.go Outdated
Comment thread docs/pnpm_esbuild_e2e_investigation.md Outdated
Scetrov added 2 commits May 11, 2026 16:29
…nsion publish

test-publish only records transactions without executing them on-chain,
so the JSON output lacks objectChanges with published package IDs.
This caused BUILDER_PACKAGE_ID to remain empty in builder-scaffold/.env,
failing the e2e test assertion.

Switch both localnet pubfile and extension fallback to publish to ensure
actual deployment and parseable JSON output.
- Fix typos in agents frontmatter (reseaching→researching, equivilent→equivalent)
- Remove duplicate 'to to' in codebase-pattern-finder.md
- Merge esbuild into existing allowBuilds block to avoid duplicate
  YAML keys in pnpm-workspace.yaml (patchPnpmWorkspaceYaml)
  Also adds TestPatchPnpmWorkspaceYaml_MergesIntoExistingAllowBuilds
- Update pnpm_esbuild_e2e_investigation.md to reflect implemented state
Copilot AI review requested due to automatic review settings May 11, 2026 15:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 30 changed files in this pull request and generated 5 comments.

Comment thread pkg/setup/pnpm_patch.go Outdated
Comment thread pkg/setup/pnpm_patch.go Outdated
Comment thread pkg/setup/start.go
Comment thread docs/pnpm_esbuild_e2e_investigation.md
Comment thread thoughts/shared/handoffs/2026-05-11_15-42-06_code-review-complete.md Outdated
Scetrov added 2 commits May 11, 2026 16:47
Addresses review feedback on PR #28.

Changes:
- replace regex-based pnpm-workspace patching with YAML-aware allowBuilds updates
- add tests for inline allowBuilds maps and false-to-true esbuild updates
- rewrite investigation doc opening into clear long-term documentation prose
- correct the handoff typo in the quoted commit message
Copilot AI review requested due to automatic review settings May 11, 2026 15:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 31 changed files in this pull request and generated 2 comments.

Comment thread pkg/setup/pnpm_patch.go
Comment thread pkg/setup/pnpm_patch.go
Scetrov added 2 commits May 11, 2026 17:03
Recover the extension package ID from the ephemeral pubfile when test-publish JSON does not include a published package change.

Also seed a fresh Pub.extension.toml from the copied world pubfile so repeated localnet extension publishes remain idempotent.
Addresses PR #28 review feedback on the pnpm workspace patcher.

Changes:
- validate workspace-derived pnpm-workspace.yaml paths with safePath before patching
- align #nosec comments with the actual caller validation and gosec behavior
- add a traversal-focused unit test for pnpm workspace path resolution
Copilot AI review requested due to automatic review settings May 11, 2026 16:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 28 out of 31 changed files in this pull request and generated 7 comments.

Comment thread pkg/builder/publish.go
Comment thread pkg/setup/pnpm_patch.go Outdated
Comment thread pkg/setup/pnpm_patch.go
Comment thread docs/pnpm_esbuild_e2e_investigation.md
Comment thread docs/pnpm_esbuild_e2e_investigation.md Outdated
Comment thread docs/pnpm_esbuild_e2e_investigation.md Outdated
Comment thread pkg/builder/publish.go
Address PR #28 review feedback by removing dead pnpm helpers, reverting the unrelated localnet extension publish recovery changes, and rewriting the pnpm investigation notes in clear English.
@Scetrov Scetrov enabled auto-merge (squash) May 11, 2026 18:56
Copilot AI review requested due to automatic review settings May 11, 2026 20:11
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 29 out of 32 changed files in this pull request and generated 3 comments.

Comment thread docs/toolchain-setup.md Outdated
Comment thread docs/pnpm_esbuild_e2e_investigation.md Outdated
Comment thread docs/pnpm_esbuild_e2e_investigation.md Outdated
Scetrov and others added 2 commits May 11, 2026 21:25
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 11, 2026 20:33
@Scetrov Scetrov disabled auto-merge May 11, 2026 20:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 30 out of 33 changed files in this pull request and generated 2 comments.

Comment thread pkg/setup/pnpm_patch.go
Comment thread pkg/builder/publish.go
@Scetrov Scetrov merged commit cf4678c into main May 11, 2026
10 checks passed
@Scetrov Scetrov deleted the chore/bump-codeql-and-crypto branch May 11, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants