cft/bols_linux: Add Go implementation and Makefile [infra/infra : main]

0 views
Skip to first unread message

Otabek Kasimov (Gerrit)

unread,
2:14 PM (7 hours ago) 2:14 PM
to chromium...@chromium.org, infra-rev...@chromium.org

Otabek Kasimov has uploaded the change for review

Commit message

cft/bols_linux: Add Go implementation and Makefile

Add main entrypoint, gRPC server, local command executor, CLI parser,
version runner, and Makefile for bols_linux microservice.

BUG=b:535648254
TAG=agy
CONV=36a8a6f6-1fca-4066-b3ab-db52fba1ecdc
Change-Id: I7070cddc3d7308f7e035d75336134c181c9c3102

Change diff


Change information

Files:
  • A go/src/infra/cros/cmd/cft/bols_linux/Makefile
  • A go/src/infra/cros/cmd/cft/bols_linux/internal/parser/parser.go
  • A go/src/infra/cros/cmd/cft/bols_linux/internal/server/common.go
  • A go/src/infra/cros/cmd/cft/bols_linux/internal/server/local_executor.go
  • A go/src/infra/cros/cmd/cft/bols_linux/internal/server/service.go
  • A go/src/infra/cros/cmd/cft/bols_linux/internal/version/version.go
  • A go/src/infra/cros/cmd/cft/bols_linux/main.go
Change size: XL
Delta: 7 files changed, 1076 insertions(+), 0 deletions(-)
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: infra/infra
Gerrit-Branch: main
Gerrit-Change-Id: I7070cddc3d7308f7e035d75336134c181c9c3102
Gerrit-Change-Number: 8129075
Gerrit-PatchSet: 1
Gerrit-Owner: Otabek Kasimov <ota...@google.com>
unsatisfied_requirement
open
diffy

Otabek Kasimov (Gerrit)

unread,
5:07 PM (4 hours ago) 5:07 PM
to chromium...@chromium.org, infra-rev...@chromium.org

Otabek Kasimov added 6 comments

File go/src/infra/cros/cmd/cft/bols_linux/internal/server/common.go
Line 55, Patchset 3 (Latest): log.Fatalln("Failed to create log file: ", err)
Otabek Kasimov . unresolved

Using `log.Fatalln` inside a method like `Run` is generally discouraged as it prevents the caller from handling the error or performing cleanup. Since `Run` returns an `error`, consider returning the error here instead.

File go/src/infra/cros/cmd/cft/bols_linux/internal/server/service.go
Line 52, Patchset 3 (Latest): resolvedPath, err := os.Readlink(fn)
Otabek Kasimov . unresolved

Consider using `filepath.EvalSymlinks(fn)` which handles nested symlinks and relative paths more robustly than a single `Readlink` call.

Line 76, Patchset 3 (Latest): stream.Send(&bols.GetFileResponse{
Otabek Kasimov . unresolved

The error from `stream.Send` should be checked and handled (e.g., logged and returned).

Line 278, Patchset 3 (Latest): if err := stdin.Close(); err != nil {
Otabek Kasimov . unresolved

If `req.GetReqInfo()` was never received, or if `cmd.StdinPipe()` failed earlier, `stdin` will be `nil` here, leading to a panic. Please ensure `stdin` is non-nil before calling `Close`.

Line 314, Patchset 3 (Latest): if _, err := io.Writer.Write(stdin, req.GetData()); err != nil {
Otabek Kasimov . unresolved

Same as above, `stdin` might be `nil` here if the protocol is not followed by the client or if initialization failed. Also, `io.Writer.Write(stdin, ...)` is very non-idiomatic. Use `stdin.Write(...)` instead.

Line 758, Patchset 3 (Latest): body, _ := io.ReadAll(resp.Body)
Otabek Kasimov . unresolved

Reading the entire body without a limit can be risky if the server returns a very large error response. Consider using `io.LimitReader`.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: infra/infra
    Gerrit-Branch: main
    Gerrit-Change-Id: I7070cddc3d7308f7e035d75336134c181c9c3102
    Gerrit-Change-Number: 8129075
    Gerrit-PatchSet: 3
    Gerrit-Owner: Otabek Kasimov <ota...@google.com>
    Gerrit-Comment-Date: Wed, 22 Jul 2026 21:07:17 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Otabek Kasimov (Gerrit)

    unread,
    5:12 PM (4 hours ago) 5:12 PM
    to chromium...@chromium.org, infra-rev...@chromium.org

    Otabek Kasimov added 1 comment

    File go/src/infra/cros/cmd/cft/bols_linux/internal/parser/parser.go
    Line 58, Patchset 3:func parseRunMode(args []string) (runMode, error) {
    if len(args) > 1 {
    Otabek Kasimov . unresolved

    Please fix this WARNING reported by golangci-lint: Linter: unparam

    parseRunMode - result 1 (error) is always nil

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: infra/infra
    Gerrit-Branch: main
    Gerrit-Change-Id: I7070cddc3d7308f7e035d75336134c181c9c3102
    Gerrit-Change-Number: 8129075
    Gerrit-PatchSet: 4
    Gerrit-Owner: Otabek Kasimov <ota...@google.com>
    Gerrit-Comment-Date: Wed, 22 Jul 2026 21:12:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Otabek Kasimov (Gerrit)

    unread,
    5:12 PM (4 hours ago) 5:12 PM
    to chromium...@chromium.org, infra-rev...@chromium.org

    Message from Otabek Kasimov

    Done. Addressed all review comments in PS2:

    • common.go: Return error from Run() instead of calling log.Fatalln.
    • service.go: Use filepath.EvalSymlinks(fn) for robust symlink resolution.
    • service.go: Check and handle error from stream.Send.
    • service.go: Added nil checks for stdin/cmd in WriteFileByBlock and used idiomatic stdin.Write.
    • service.go: Used io.LimitReader(resp.Body, 4096) in downloadFileToHost.
    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: infra/infra
    Gerrit-Branch: main
    Gerrit-Change-Id: I7070cddc3d7308f7e035d75336134c181c9c3102
    Gerrit-Change-Number: 8129075
    Gerrit-PatchSet: 4
    Gerrit-Owner: Otabek Kasimov <ota...@google.com>
    Gerrit-Comment-Date: Wed, 22 Jul 2026 21:12:29 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    unsatisfied_requirement
    open
    diffy

    Otabek Kasimov (Gerrit)

    unread,
    7:04 PM (2 hours ago) 7:04 PM
    to chromium...@chromium.org, infra-rev...@chromium.org

    Otabek Kasimov has uploaded the change for review

    Commit message

    cft/bols_linux: Add Go implementation and Makefile

    Add Go entry point, CLI parser, server constructor, and Makefile
    for bols_linux runner using lib/bols.

    BUG=b:535648254
    TAG=agy
    CONV=36a8a6f6-1fca-4066-b3ab-db52fba1ecdc
    Change-Id: I433cfc6ac20a80c69fc598bd7b4abc6f733b6aed

    Change diff


    Change information

    Files:
    • A go/src/infra/cros/cmd/cft/bols_linux/Makefile
    • A go/src/infra/cros/cmd/cft/bols_linux/internal/parser/parser.go
    • A go/src/infra/cros/cmd/cft/bols_linux/internal/server/service.go
    • A go/src/infra/cros/cmd/cft/bols_linux/internal/version/version.go
    • A go/src/infra/cros/cmd/cft/bols_linux/main.go
      Change size: M
      Delta: 5 files changed, 126 insertions(+), 0 deletions(-)
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newchange
      Gerrit-Project: infra/infra
      Gerrit-Branch: main
      Gerrit-Change-Id: I433cfc6ac20a80c69fc598bd7b4abc6f733b6aed
      Gerrit-Change-Number: 8135556
      Gerrit-PatchSet: 1
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Otabek Kasimov (Gerrit)

      unread,
      7:11 PM (2 hours ago) 7:11 PM
      to chromium...@chromium.org, infra-rev...@chromium.org

      Otabek Kasimov has uploaded the change for review

      Commit message

      cft/bols_linux: Add Go implementation and Makefile

      Add Go entry point, CLI parser, server constructor, and Makefile
      for bols_linux runner using lib/bols.

      BUG=b:535648254
      TAG=agy
      CONV=36a8a6f6-1fca-4066-b3ab-db52fba1ecdc
      Change-Id: I696f1b0b2e91d9cceab5911c2b62512426f40fe4

      Change diff


      Change information

      Files:
      • A go/src/infra/cros/cmd/cft/bols_linux/Makefile
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/parser/parser.go
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/server/service.go
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/version/version.go
      • A go/src/infra/cros/cmd/cft/bols_linux/main.go
      Change size: M
      Delta: 5 files changed, 126 insertions(+), 0 deletions(-)
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newchange
      Gerrit-Project: infra/infra
      Gerrit-Branch: main
      Gerrit-Change-Id: I696f1b0b2e91d9cceab5911c2b62512426f40fe4
      Gerrit-Change-Number: 8135774
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Otabek Kasimov (Gerrit)

      unread,
      7:23 PM (2 hours ago) 7:23 PM
      to chromium...@chromium.org, infra-rev...@chromium.org

      Otabek Kasimov has uploaded the change for review

      Commit message

      cft/bols_linux: Add Go implementation and Makefile

      Add Go entry point, CLI parser, server constructor, and Makefile
      for bols_linux runner using lib/bols.

      BUG=b:535648254
      TAG=agy
      CONV=36a8a6f6-1fca-4066-b3ab-db52fba1ecdc
      Change-Id: Ie31fa84b51747157bb9bbe4ec85315f41ba850de

      Change diff


      Change information

      Files:
      • A go/src/infra/cros/cmd/cft/bols_linux/Makefile
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/parser/parser.go
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/server/service.go
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/version/version.go
      • A go/src/infra/cros/cmd/cft/bols_linux/main.go
      Change size: M
      Delta: 5 files changed, 126 insertions(+), 0 deletions(-)
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newchange
      Gerrit-Project: infra/infra
      Gerrit-Branch: main
      Gerrit-Change-Id: Ie31fa84b51747157bb9bbe4ec85315f41ba850de
      Gerrit-Change-Number: 8134748
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Otabek Kasimov (Gerrit)

      unread,
      7:46 PM (1 hour ago) 7:46 PM
      to chromium...@chromium.org, infra-rev...@chromium.org

      Otabek Kasimov has uploaded the change for review

      Commit message

      cft/bols_linux: Add Go implementation and Makefile

      Add Go entry point, CLI parser, server constructor, and Makefile
      for bols_linux runner using lib/bols.

      BUG=b:535648254
      TAG=agy
      CONV=36a8a6f6-1fca-4066-b3ab-db52fba1ecdc
      Change-Id: I97f8ee4f7b1ecacaf97e3e12de80b9d7a1e8b3a2

      Change diff


      Change information

      Files:
      • A go/src/infra/cros/cmd/cft/bols_linux/Makefile
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/parser/parser.go
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/server/service.go
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/version/version.go
      • A go/src/infra/cros/cmd/cft/bols_linux/main.go
      Change size: M
      Delta: 5 files changed, 126 insertions(+), 0 deletions(-)
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newchange
      Gerrit-Project: infra/infra
      Gerrit-Branch: main
      Gerrit-Change-Id: I97f8ee4f7b1ecacaf97e3e12de80b9d7a1e8b3a2
      Gerrit-Change-Number: 8136053
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Otabek Kasimov (Gerrit)

      unread,
      7:50 PM (1 hour ago) 7:50 PM
      to chromium...@chromium.org, infra-rev...@chromium.org

      Otabek Kasimov has uploaded the change for review

      Commit message

      cft/bols_linux: Add Go implementation and Makefile

      Add Go entry point, CLI parser, server constructor, and Makefile
      for bols_linux runner using lib/bols.

      BUG=b:535648254
      TAG=agy
      CONV=36a8a6f6-1fca-4066-b3ab-db52fba1ecdc
      Change-Id: I8b8b1d1507e0b9eacb43f27fc20bac2c714f5070

      Change diff


      Change information

      Files:
      • A go/src/infra/cros/cmd/cft/bols_linux/Makefile
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/parser/parser.go
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/server/service.go
      • A go/src/infra/cros/cmd/cft/bols_linux/internal/version/version.go
      • A go/src/infra/cros/cmd/cft/bols_linux/main.go
      Change size: M
      Delta: 5 files changed, 126 insertions(+), 0 deletions(-)
      Open in Gerrit

      Related details

      Attention set is empty
      Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newchange
      Gerrit-Project: infra/infra
      Gerrit-Branch: main
      Gerrit-Change-Id: I8b8b1d1507e0b9eacb43f27fc20bac2c714f5070
      Gerrit-Change-Number: 8135914
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Otabek Kasimov (Gerrit)

      unread,
      8:00 PM (1 hour ago) 8:00 PM
      to See Wai Fu, chromium...@chromium.org, infra-rev...@chromium.org
      Attention needed from See Wai Fu

      Otabek Kasimov voted

      Auto-Submit+1
      Commit-Queue+1
      Open in Gerrit

      Related details

      Attention is currently required from:
      • See Wai Fu
      Submit Requirements:
      • requirement satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: infra/infra
      Gerrit-Branch: main
      Gerrit-Change-Id: I8b8b1d1507e0b9eacb43f27fc20bac2c714f5070
      Gerrit-Change-Number: 8135914
      Gerrit-PatchSet: 2
      Gerrit-Owner: Otabek Kasimov <ota...@google.com>
      Gerrit-Reviewer: Otabek Kasimov <ota...@google.com>
      Gerrit-Reviewer: See Wai Fu <seew...@google.com>
      Gerrit-Attention: See Wai Fu <seew...@google.com>
      Gerrit-Comment-Date: Thu, 23 Jul 2026 00:00:52 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages