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

mendersoftware / mender-server / 1978354074

11 Aug 2025 05:31PM UTC coverage: 65.755% (+0.3%) from 65.495%
1978354074

Pull #862

gitlab-ci

web-flow
chore: bump the development-dependencies group across 1 directory with 11 updates

Bumps the development-dependencies group with 11 updates in the /frontend directory:

| Package | From | To |
| --- | --- | --- |
| [@rspack/cli](https://github.com/web-infra-dev/rspack/tree/HEAD/packages/rspack-cli) | `1.4.8` | `1.4.11` |
| [@rspack/core](https://github.com/web-infra-dev/rspack/tree/HEAD/packages/rspack) | `1.4.8` | `1.4.11` |
| [@sentry/webpack-plugin](https://github.com/getsentry/sentry-javascript-bundler-plugins) | `4.0.0` | `4.0.2` |
| [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) | `6.6.3` | `6.6.4` |
| [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) | `24.1.0` | `24.2.1` |
| [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) | `8.38.0` | `8.39.0` |
| [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) | `4.7.0` | `5.0.0` |
| [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) | `3.44.0` | `3.45.0` |
| [lint-staged](https://github.com/lint-staged/lint-staged) | `16.1.2` | `16.1.5` |
| [typescript](https://github.com/microsoft/TypeScript) | `5.7.3` | `5.9.2` |
| [undici](https://github.com/nodejs/undici) | `7.12.0` | `7.13.0` |



Updates `@rspack/cli` from 1.4.8 to 1.4.11
- [Release notes](https://github.com/web-infra-dev/rspack/releases)
- [Commits](https://github.com/web-infra-dev/rspack/commits/v1.4.11/packages/rspack-cli)

Updates `@rspack/core` from 1.4.8 to 1.4.11
- [Release notes](https://github.com/web-infra-dev/rspack/releases)
- [Commits](https://github.com/web-infra-dev/rspack/commits/v1.4.11/packages/rspack)

Updates `@sentry/webpack-plugin` from 4.0.0 to 4.0.2
- [Release notes](https://github.com/getsentry/sentry-javascript-bundler-plugins/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript-bundler-plugins/blob... (continued)
Pull Request #862: chore: bump the development-dependencies group across 1 directory with 11 updates

29261 of 44500 relevant lines covered (65.76%)

1.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/backend/pkg/rate/limit.go
1
package rate
2

3
import (
4
        "context"
5
        "time"
6

7
        "golang.org/x/time/rate"
8
)
9

10
// Limiter implements a rate limiting interface based on golang.org/x/time/rate
11
// but extending the interface with the ability to expose internal errors.
12
type Limiter interface {
13
        Reserve(ctx context.Context) (Reservation, error)
14
}
15

16
type LimiterFunc func(context.Context) (Reservation, error)
17

18
func (f LimiterFunc) Reserve(ctx context.Context) (Reservation, error) {
×
19
        return f(ctx)
×
20
}
×
21

22
// EventLimiter allows grouping limiters by eventID.
23
type EventLimiter interface {
24
        ReserveEvent(ctx context.Context, eventID string) (Reservation, error)
25
}
26

27
// Reservation is a point-in-time reservation of a ratelimit token. If the token
28
// is approved OK return true, otherways Delay will return the duration for next
29
// token(s) to become available. While Tokens return the number of available
30
// tokens after the reservation.
31
type Reservation interface {
32
        OK() bool
33
        Delay() time.Duration
34
        Tokens() int64
35
}
36

37
type limiter rate.Limiter
38

39
func NewLimiter(limit int, interval time.Duration) Limiter {
×
40
        return (*limiter)(rate.NewLimiter(rate.Every(interval/time.Duration(limit)), limit))
×
41
}
×
42

43
func (lim *limiter) Reserve(context.Context) (Reservation, error) {
×
44
        now := time.Now()
×
45
        goLimiter := (*rate.Limiter)(lim)
×
46
        res := &reservation{
×
47
                reservation: goLimiter.ReserveN(now, 1),
×
48
                time:        now,
×
49
        }
×
50
        if res.OK() {
×
51
                res.tokens = int64(goLimiter.TokensAt(now))
×
52
        }
×
53
        return res, nil
×
54
}
55

56
type reservation struct {
57
        time        time.Time
58
        tokens      int64
59
        reservation *rate.Reservation
60
}
61

62
func (r *reservation) OK() bool {
×
63
        return r.Delay() == 0
×
64
}
×
65

66
func (r *reservation) Delay() time.Duration {
×
67
        return r.reservation.DelayFrom(r.time)
×
68
}
×
69

70
func (r *reservation) Tokens() int64 {
×
71
        return r.tokens
×
72
}
×
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

© 2025 Coveralls, Inc