Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/api-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Analyze API Changes
description: Runs apidiff-go action to check for breaking changes to modules' public APIs

on:
pull_request:

jobs:
root-module:
name: Root Module
permissions:
pull-requests: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
cache: false

- uses: smartcontractkit/.github/actions/changed-modules-go@feat/changed-modules-go
Comment thread Dismissed
id: changed-modules

- uses: smartcontractkit/.github/actions/apidiff-go@apidiff-go/0.1.0
env:
GITHUB_TOKEN: ${{ github.token }}
with:
go-mod-paths: "${{ steps.changed-modules.outputs.modified-modules }}"
enforce-compatible: "false" # dont fail on breaking changes
4 changes: 4 additions & 0 deletions pkg/monitoring/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ type Monitor struct {
Manager Manager

HTTPServer HTTPServer

NewParam uint64
}

// NewMonitor builds a new Monitor instance using dependency injection.
Expand All @@ -56,6 +58,7 @@ func NewMonitor(
txResultsSourceFactory SourceFactory,
feedsParser FeedsParser,
nodesParser NodesParser,
newParam uint64,
) (*Monitor, error) {
cfg, err := config.Parse()
if err != nil {
Expand Down Expand Up @@ -147,6 +150,7 @@ func NewMonitor(
RDDPoller: rddPoller,
Manager: manager,
HTTPServer: httpServer,
NewParam: newParam,
}, nil
}

Expand Down
7 changes: 5 additions & 2 deletions pkg/utils/mailbox/mailbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@ func NewHighCapacity[T any]() *Mailbox[T] {
// NewSingle returns a new Mailbox with capacity one.
func NewSingle[T any]() *Mailbox[T] { return New[T](1) }

// NewSingleDuplicate copies the above function to demonstrate API analysis
func NewSingleDuplicate[T any]() *Mailbox[T] { return New[T](1) }

// New creates a new mailbox instance. If name is non-empty, it must be unique and calling Start will launch
// prometheus metric monitor that periodically reports mailbox load until Close() is called.
func New[T any](capacity uint64) *Mailbox[T] {
func New[T any](capacity uint32) *Mailbox[T] {
queueCap := capacity
if queueCap == 0 {
queueCap = 100
}
return &Mailbox[T]{
chNotify: make(chan struct{}, 1),
queue: make([]T, 0, queueCap),
capacity: capacity,
capacity: uint64(capacity),
}
}

Expand Down
Loading