Skip to content
Merged
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
69 changes: 69 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Bug Report
description: Report a bug in rabbitwrap
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for reporting a bug! Please fill out the sections below.

- type: textarea
id: description
attributes:
label: Description
description: A clear description of the bug.
validations:
required: true

- type: textarea
id: reproduce
attributes:
label: Steps to Reproduce
description: Minimal steps to reproduce the issue.
placeholder: |
1. Create a connection with ...
2. Call Publish() ...
3. See error ...
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected Behavior
description: What you expected to happen.
validations:
required: true

- type: textarea
id: actual
attributes:
label: Actual Behavior
description: What actually happened.
validations:
required: true

- type: input
id: go-version
attributes:
label: Go Version
description: Output of `go version`.
placeholder: "go1.22.0 linux/amd64"
validations:
required: true

- type: input
id: rabbitwrap-version
attributes:
label: rabbitwrap Version
description: The version of rabbitwrap you are using.
placeholder: "v0.1.0"
validations:
required: true

- type: textarea
id: additional
attributes:
label: Additional Context
description: Any other context, logs, or screenshots.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Feature Request
description: Suggest a new feature for rabbitwrap
title: "[Feature]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for suggesting a feature! Please describe it below.

- type: textarea
id: problem
attributes:
label: Problem
description: What problem does this feature solve?
placeholder: "I'm always frustrated when ..."
validations:
required: true

- type: textarea
id: solution
attributes:
label: Proposed Solution
description: How would you like this to work?
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: Any alternative solutions or workarounds you've considered.

- type: textarea
id: additional
attributes:
label: Additional Context
description: Any other context, code examples, or references.
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
commit-message:
prefix: "deps"
labels:
- dependencies
open-pull-requests-limit: 5

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
commit-message:
prefix: "ci"
labels:
- ci
open-pull-requests-limit: 5
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Summary

<!-- Brief description of the changes -->

## Motivation

<!-- Why is this change needed? Link to any related issues. -->

Fixes #

## Changes

<!-- List the key changes made -->

-

## Checklist

- [ ] fmt, vet, lint, test, build passes (`make all`)
- [ ] New code has tests where appropriate
- [ ] Breaking changes are documented
72 changes: 45 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,65 @@ permissions:

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.22", "1.23"]
go-version: ["1.22", "1.23", "1.24", "1.25", "1.26"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- run: go test -race -count=1 -coverprofile=coverage.out ./...
- name: Upload coverage
if: matrix.go-version == '1.23'
uses: actions/upload-artifact@v4
- run: go test -race -count=1 ./...

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: "1.26"
- name: Run tests with coverage
run: go test -race -coverprofile=coverage.out -covermode=atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
name: coverage
path: coverage.out
files: coverage.out
fail_ci_if_error: false

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: go vet ./...
- uses: golangci/golangci-lint-action@v7
go-version: "1.26"
- uses: golangci/golangci-lint-action@v9
with:
version: latest
- name: staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...
version: v2.11
args: --timeout=5m

build:
name: Build
integration:
runs-on: ubuntu-latest
services:
rabbitmq:
image: rabbitmq:3-management-alpine
ports:
- 5672:5672
env:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
options: >-
--health-cmd "rabbitmq-diagnostics -q check_port_connectivity"
--health-interval 5s
--health-timeout 10s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
- run: go build ./...
go-version: "1.26"
- name: Run integration tests
run: go test -race -count=1 -tags=integration -timeout 120s ./...
env:
RABBITMQ_URL: amqp://guest:guest@localhost:5672/
37 changes: 37 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CodeQL

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 6 * * 1"

permissions:
security-events: write
contents: read

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: "1.26"

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: go

- name: Build
run: go build ./...

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
38 changes: 17 additions & 21 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,32 @@
version: "2"

linters:
default: standard
enable:
- errcheck
- govet
- staticcheck
- unused
- ineffassign
- misspell
- gocritic
- gocyclo
- revive
settings:
gocyclo:
min-complexity: 15
revive:
rules:
- name: exported
disabled: true
exclusions:
rules:
# Allow unchecked errors in tests for brevity.
- path: _test\.go
linters:
- errcheck
# Allow unused params in tests.
- path: _test\.go
linters:
- revive
text: unused-parameter
# Allow unused ctx in interface implementations.
- linters:
- revive
text: unused-parameter.*ctx
# Allow min/max as parameter names.
- linters:
- revive
text: redefines-builtin-id
# Examples prioritize readability over strict error handling.
- path: examples/
linters:
- errcheck
- gocritic
path: _test\.go
- path: examples/
text: ".*"

formatters:
enable:
- gofmt
- goimports
Loading
Loading