Skip to content

Support native HTTP services in apply and service run - #112

Merged
SergioLangaritaBenitez merged 2 commits into
develfrom
feat/synchronous-http
Dec 1, 2026
Merged

SergioLangaritaBenitez merged 2 commits into
develfrom
feat/synchronous-http

Conversation

@esparig

@esparig esparig commented Dec 1, 2026

Copy link
Copy Markdown
Member

Support FDLs with synchronous.mode: http and an optional user script. Add service run --raw to send native request bytes and preserve response bytes, including text that happens to be valid base64. The README includes an AnyDoc PDF example.

Uses the OSCAR API types from grycap/oscar#730. Adds regression tests for scriptless HTTP services and binary invocations.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Raw file requests omit Content-Length and use chunked transfer, causing the documented AnyDoc example to fail with HTTP 411; the file size must be propagated and covered by a regression test.

1 open issue
What changed in this PR

Adds native HTTP service support to the CLI’s FDL loading and synchronous invocation paths.

Changes:

  • Allows HTTP-mode FDLs to omit a script.
  • Adds service run --raw to bypass base64 processing for requests and responses.
  • Updates OSCAR API dependencies, adds regression tests, and documents an AnyDoc PDF invocation.
File Description
README.md Documents --raw and the AnyDoc PDF example.
pkg/​service/​service.go Allows scriptless HTTP-mode service definitions.
pkg/​service/​service_test.go Tests loading an HTTP service without a script.
go.sum Updates checksums for the OSCAR dependency change.
go.mod Updates OSCAR API types and indirect dependencies.
cmd/​service_run.go Implements raw input/output and excludes simultaneous output decoding.
cmd/​service_run_test.go Tests binary input and preservation of base64-looking response text.

Review effort: Balanced

Comment thread cmd/service_run.go
}
// Make the request
resBody, err := service.RunService(conf.Oscar[cluster], args[0], token, endpoint, reader, header)
resBody, err := service.RunService(conf.Oscar[cluster], args[0], token, endpoint, inputReader, header)

@esparig esparig Dec 1, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

--raw -f now sends the correct Content-Length for regular files while still streaming the request body. I updated the regression test to return HTTP 411 when the header is missing. The full Go test suite passes, and I verified locally that the documented CLI command workds with a synchronous-http service (PDF conversion to Markdown using AnyDoc).

@SergioLangaritaBenitez
SergioLangaritaBenitez merged commit e6a8cb2 into devel Dec 1, 2026
18 checks passed
@esparig
esparig deleted the feat/synchronous-http branch December 1, 2026 18:02
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.

3 participants