• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ooni / probe-cli / 8896593946
72%

Build:
DEFAULT BRANCH: master
Ran 30 Apr 2024 02:35PM UTC
Jobs 1
Files 557
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Apr 2024 02:29PM UTC coverage: 83.326% (+0.05%) from 83.272%
8896593946

push

github

web-flow
refactor(probeservices): httpx -> httpclientx (#1576)

This issue replaces httpx with httpclientx for probeservices.

Part of https://github.com/ooni/probe/issues/2723.

---

Here are some checks to make sure we' not changing API semantics.

## GetTestHelpers

Before:

```Go
	err = c.APIClientTemplate.WithBodyLogging().Build().GetJSON(ctx, "/api/v1/test-helpers", &output)
```

After:

```Go
	// construct the URL to use
	URL, err := urlx.ResolveReference(c.BaseURL, "/api/v1/test-helpers", "")
	if err != nil {
		return nil, err
	}

	// get the response
	return httpclientx.GetJSON[map[string][]model.OOAPIService](ctx, URL, &httpclientx.Config{
		Client:    c.HTTPClient,
		Logger:    c.Logger,
		UserAgent: c.UserAgent,
	})
```

In both cases: uses the same client and user agent, uses the same URL
path, uses logging.

## OpenReport

Before:

```Go
	var cor model.OOAPICollectorOpenResponse
	if err := c.APIClientTemplate.WithBodyLogging().Build().PostJSON(ctx, "/report", rt, &cor); err != nil {
```

After:

```Go
	URL, err := urlx.ResolveReference(c.BaseURL, "/report", "")
	if err != nil {
		return nil, err
	}

	cor, err := httpclientx.PostJSON[model.OOAPIReportTemplate, *model.OOAPICollectorOpenResponse](
		ctx, URL, rt, &httpclientx.Config{
			Client:    c.HTTPClient,
			Logger:    c.Logger,
			UserAgent: c.UserAgent,
		},
	)
```

In both cases: uses the same client and user agent, uses the same URL
path, uses logging.

## SubmitMeasurement

Before:

```Go
	err := r.client.APIClientTemplate.WithBodyLogging().Build().PostJSON(
		ctx, fmt.Sprintf("/report/%s", r.ID), model.OOAPICollectorUpdateRequest{
			Format:  "json",
			Content: m,
		}, &updateResponse,
```

After:

```Go
	URL, err := urlx.ResolveReference(r.client.BaseURL, fmt.Sprintf("/report/%s", r.ID), "")
	if err != nil {
		return err
	}

	apiReq := model.OOAPICollectorUpdateRequest{
		Format:  "json",
		Content: ... (continued)

119 of 119 new or added lines in 8 files covered. (100.0%)

1 existing line in 1 file now uncovered.

27130 of 32559 relevant lines covered (83.33%)

61.4 hits per line

Jobs
ID Job ID Ran Files Coverage
1 0 - 8896593946.1 30 Apr 2024 02:35PM UTC 0
83.33
GitHub Action Run
Source Files on build 8896593946
Detailed source file information is not available for this build.
  • Back to Repo
  • ce621329 on github
  • Prev Build on master (#8895151718)
  • Next Build on master (#8897365823)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc