Skip to content

add go sidecar build#1622

Draft
mchenani wants to merge 8 commits intomainfrom
mc/gateway-go-sidecar
Draft

add go sidecar build#1622
mchenani wants to merge 8 commits intomainfrom
mc/gateway-go-sidecar

Conversation

@mchenani
Copy link

No description provided.

@mchenani mchenani marked this pull request as ready for review February 11, 2026 19:37
@mchenani mchenani requested a review from a team as a code owner February 11, 2026 19:37
@mchenani mchenani marked this pull request as draft February 11, 2026 19:37
Comment on lines +72 to +73
XMTPD_API_PORT: String(port),
XMTPD_API_ENABLE: "true",
Copy link
Collaborator

@mkysel mkysel Feb 11, 2026

Choose a reason for hiding this comment

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

does it need the API? Thats a lot of computation for nothing

Copy link
Author

Choose a reason for hiding this comment

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

for now just testing, will clean it up later.


on:
push:
branches: [main, dev]
Copy link
Collaborator

Choose a reason for hiding this comment

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

there is no dev branch

@mkysel
Copy link
Collaborator

mkysel commented Feb 11, 2026

@mchenani this particular implementation of the gateway does not support any extensions or JWT token auth. Does that meet your requirements?

@mchenani
Copy link
Author

@mchenani this particular implementation of the gateway does not support any extensions or JWT token auth. Does that meet your requirements?

Thanks for the review, tbh I'm not sure if I'm aware of the requirements there, will discuss them with @cameronvoell to make sure I have the full picture how we want to tackle that.

@macroscopeapp
Copy link

macroscopeapp bot commented Feb 12, 2026

  • Removed Windows platform support from gateway binary resolution and installation [3a8281c]
  • Removed auto-restart functionality and changed process lifecycle management in startGateway [3a8281c]
  • Refactored health check and port availability detection logic [3a8281c]
  • Implemented buffered log forwarding with partial line handling [3a8281c]
  • Gated npm publishing and tagging to run only on main branch [3a8281c]
  • Added command injection protection to version synchronization script [3a8281c]

Changes since #1622 opened

  • Updated conditional execution logic for npm package publishing steps in GitHub workflow [265ca0d]
  • Replaced dev npm tag with poc tag and updated automatic tag selection logic in publish-gateway-npm workflow [8da95fa]
  • Modified versioning strategy to apply -<tag>.<git-hash> suffix to all non-latest tags [8da95fa]
  • Removed branch-based publication constraints from all publish steps in publish-gateway-npm workflow [8da95fa]
  • Removed path filters from the publish-gateway-npm.yml workflow trigger configuration [ef95594]
  • Added public access and provenance configuration to npm publish steps [c03b2cf]
  • Replaced JS-DevTools/npm-publish action with direct npm publish CLI commands for publishing packages @xmtp/gateway-darwin-arm64, @xmtp/gateway-darwin-x64, @xmtp/gateway-linux-arm64, @xmtp/gateway-linux-x64, and @xmtp/gateway in the GitHub Actions workflow [90fe32d]
  • Modified npm package publishing authentication and provenance configuration in the publish-gateway-npm.yml workflow [f3127ba]
  • Added npm version update step to the publish-gateway-npm.yml workflow [f3127ba]

📊 Macroscope summarized 265ca0d. 11 files reviewed, 9 issues evaluated, 4 issues filtered, 1 comment posted. View details

function setupLogForwarding(child: ChildProcess): void {
let buffer = "";
child.stdout?.on("data", (data: Buffer) => {
buffer += data.toString();
Copy link

Choose a reason for hiding this comment

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

🟡 Medium

src/process-manager.ts:90 The buffer grows unbounded if stdout never emits newlines. Consider capping buffer size (e.g., 1MB) and discarding/truncating when exceeded, or document why this is acceptable for the expected gateway output format.

🚀 Want me to fix this? Reply ex: "fix it for me".

🤖 Prompt for AI
In file npm/gateway/src/process-manager.ts around line 90:

The `buffer` grows unbounded if stdout never emits newlines. Consider capping buffer size (e.g., 1MB) and discarding/truncating when exceeded, or document why this is acceptable for the expected gateway output format.


const timeout = config.healthCheckTimeout ?? 30_000;
try {
await Promise.race([waitForHealthy(port, timeout), earlyExit]);
Copy link

Choose a reason for hiding this comment

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

🟡 Medium

src/process-manager.ts:42 Consider verifying the gateway actually bound to the port, not just that the port is in use. If another process occupies the port, waitForHealthy succeeds immediately while the gateway fails to bind. One option: hit the gateway's health endpoint instead of just checking port occupancy.

🚀 Want me to fix this? Reply ex: "fix it for me".

🤖 Prompt for AI
In file npm/gateway/src/process-manager.ts around line 42:

Consider verifying the gateway actually bound to the port, not just that the port is in use. If another process occupies the port, `waitForHealthy` succeeds immediately while the gateway fails to bind. One option: hit the gateway's health endpoint instead of just checking port occupancy.

Comment on lines +148 to +150
server.once("listening", () => {
server.close();
resolve(false);
Copy link

Choose a reason for hiding this comment

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

🟡 Medium

src/process-manager.ts:148 Consider waiting for the close event before resolving, since server.close() is asynchronous and the port may not be released yet when findAvailablePort returns.

Suggested change
server.once("listening", () => {
server.close();
resolve(false);
server.once("listening", () => {
server.close(() => resolve(false));
});

🚀 Want me to fix this? Reply ex: "fix it for me".

🤖 Prompt for AI
In file npm/gateway/src/process-manager.ts around lines 148-150:

Consider waiting for the `close` event before resolving, since `server.close()` is asynchronous and the port may not be released yet when `findAvailablePort` returns.

Comment on lines +15 to +16
echo " Building ${goos}/${goarch} -> ${output}"
CGO_ENABLED=0 GOOS="${goos}" GOARCH="${goarch}" \
Copy link

Choose a reason for hiding this comment

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

🟠 High

npm/build.sh:15 go build -o doesn't create parent directories. Consider adding mkdir -p "$(dirname "${output}")" before the build command.

Suggested change
echo " Building ${goos}/${goarch} -> ${output}"
CGO_ENABLED=0 GOOS="${goos}" GOARCH="${goarch}" \
echo " Building ${goos}/${goarch} -> ${output}"
mkdir -p "$(dirname "${output}")"
CGO_ENABLED=0 GOOS="${goos}" GOARCH="${goarch}" \

🚀 Want me to fix this? Reply ex: "fix it for me".

🤖 Prompt for AI
In file npm/build.sh around lines 15-16:

`go build -o` doesn't create parent directories. Consider adding `mkdir -p "$(dirname "${output}")"` before the build command.

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