Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0877143
Handle WSS shutdown and UDP buffer sizing
AlexStocks Aug 1, 2026
7539afe
docs: design comprehensive GitHub CI hardening
AlexStocks Aug 1, 2026
21f84b8
docs: plan comprehensive GitHub CI hardening
AlexStocks Aug 1, 2026
70dc8a1
docs: fix CI plan whitespace
AlexStocks Aug 1, 2026
84c1557
build: make CI checks deterministic
AlexStocks Aug 1, 2026
4172694
ci: harden tests race and platform builds
AlexStocks Aug 1, 2026
67bb4e2
ci: isolate Codecov OIDC upload
AlexStocks Aug 1, 2026
1999485
ci: minimize coverage permissions
AlexStocks Aug 1, 2026
709cdb8
ci: add CodeQL analysis
AlexStocks Aug 1, 2026
c1dd4d9
ci: add Dependabot updates
AlexStocks Aug 1, 2026
6a17b6e
docs: replace Travis CI references
AlexStocks Aug 1, 2026
7c02e88
docs: align CI design with reviewed implementation
AlexStocks Aug 1, 2026
d075d46
docs: make CI verification plan executable
AlexStocks Aug 1, 2026
6dff6fe
docs: harden remaining WSL command transport
AlexStocks Aug 1, 2026
25bd029
ci: update setup-go to v7
AlexStocks Aug 1, 2026
90d9ec5
build: make format check read-only
AlexStocks Aug 1, 2026
41e5057
build: propagate format enumeration failures
AlexStocks Aug 1, 2026
588997a
ci: disable checkout credential persistence
AlexStocks Aug 1, 2026
7ff8448
Document PR 108 review repair strategy
AlexStocks Aug 16, 2026
36680e8
Test UDP buffer limits through the real receive path
AlexStocks Aug 17, 2026
1e2ea17
Bound UDP receive buffers across limit edge cases
AlexStocks Aug 17, 2026
9cbc414
Check UDP test socket cleanup errors
AlexStocks Aug 17, 2026
b1e1701
Align PR 108 release plan with reviewed implementation
AlexStocks Aug 17, 2026
80c67d8
Align PR 108 mutation rerun checklist
AlexStocks Aug 17, 2026
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
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
target-branch: master
schedule:
interval: weekly
open-pull-requests-limit: 5
commit-message:
prefix: deps

- package-ecosystem: github-actions
directory: /
target-branch: master
schedule:
interval: monthly
open-pull-requests-limit: 3
commit-message:
prefix: ci
42 changes: 42 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CodeQL

on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '30 1 * * 1'

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze (Go)
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@a2983b8bed1923f44751c5c43237f479442827b3 # v3
with:
languages: go
build-mode: autobuild

- name: Analyze
uses: github/codeql-action/analyze@a2983b8bed1923f44751c5c43237f479442827b3 # v3
161 changes: 118 additions & 43 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,141 @@ name: CI

on:
push:
branches: [ master ]
branches:
- master
pull_request:
branches: "*"
branches:
- master

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
license:
name: Check License Header
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false

- name: Check License Header
uses: apache/skywalking-eyes/header@main #NOSONAR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: apache/skywalking-eyes/header@315732dd4b8d3a015d8d9b91936b935a0b854817 # verified main, post-v0.8.0
with:
config: .licenserc.yaml
mode: check

CI:
name: CI
test-and-lint:
name: Test and Lint
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum

- name: Verify Go Modules
run: go mod verify

- name: Check Code Format
run: make check-fmt

- name: Unit Test
run: make test

- name: Lint
run: make lint

- name: Upload Coverage Artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
with:
name: coverage
path: coverage.txt
if-no-files-found: error
retention-days: 1

coverage:
name: Upload Coverage
needs: test-and-lint
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
id-token: write
steps:
- name: Download Coverage Artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
name: coverage

- name: Upload Coverage
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f
with:
version: v11.3.1
use_oidc: true
fail_ci_if_error: true
files: ./coverage.txt
disable_search: true

race:
name: Race
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum

- name: Verify Go Modules
run: go mod verify

- name: Race Test
run: make test-race

build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
# If you want to matrix build , you can append the following list.
fail-fast: false
matrix:
go_version:
- '1.25'
os:
- ubuntu-latest

- windows-latest
- macos-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
with:
persist-credentials: false

- name: Set up Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: go.mod
cache-dependency-path: go.sum

- name: Verify Go Modules
run: go mod verify

- name: Set up Go ${{ matrix.go_version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go_version }}

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Cache Go Dependence
# ref: https://github.com/actions/cache/blob/main/examples.md#go---module
uses: actions/cache@v4
with:
# Cache, works only on Linux
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
# An ordered list of keys to use for restoring the cache if no cache hit occurred for key
restore-keys: ${{ runner.os }}-go-

- name: Check Code Format
run: make fmt && git status && [[ -z `git status -s` ]]

- name: Unit Test
run: make test

- name: Lint
run: make lint

- name: Coverage
run: bash <(curl -s https://codecov.io/bash)
- name: Build
run: go build ./...
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

44 changes: 37 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,54 @@ MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
MAKEFLAGS += --no-print-directory

.PHONY: help test fmt clean lint
.PHONY: help test test-race fmt check-fmt clean lint install-golangci-lint install-imports-formatter

help:
@echo "Available commands:"
@echo " test - Run unit tests"
@echo " clean - Clean test generate files"
@echo " test - Run unit tests with coverage"
@echo " test-race - Run transport race tests"
@echo " fmt - Format code"
@echo " check-fmt - Verify formatting without modifying tracked files"
@echo " lint - Run golangci-lint"
@echo " clean - Clean test generate files"

# Run unit tests
test: clean
# For go 1.25.0
go env -w GOTOOLCHAIN=go1.25.0+auto
go test ./... -coverprofile=coverage.txt -covermode=atomic
GOTOOLCHAIN=go1.25.0+auto go test ./... -count=1 -coverprofile=coverage.txt -covermode=atomic

test-race:
GOTOOLCHAIN=go1.25.0+auto go test -race ./transport -count=1

fmt: install-imports-formatter
go fmt ./... && GOROOT=$(shell go env GOROOT) imports-formatter

check-fmt: install-imports-formatter
@temp_dir=$$(mktemp -d /tmp/getty-check-fmt.XXXXXX); \
trap 'case "$$temp_dir" in /tmp/getty-check-fmt.*) rm -rf -- "$$temp_dir" ;; esac' EXIT; \
mkdir -p "$$temp_dir/.git"; \
tracked_files="$$temp_dir/.git/tracked-files.z"; \
go_files="$$temp_dir/.git/go-files.z"; \
git ls-files -z > "$$tracked_files"; \
git ls-files -z -- '*.go' > "$$go_files"; \
while IFS= read -r -d '' file; do \
mkdir -p "$$temp_dir/$$(dirname "$$file")"; \
cp -p -- "$$file" "$$temp_dir/$$file"; \
done < "$$tracked_files"; \
(cd "$$temp_dir" && \
GOTOOLCHAIN=go1.25.0+auto go fmt ./... && \
GOROOT="$$(GOTOOLCHAIN=go1.25.0+auto go env GOROOT)" \
imports-formatter --path "$$temp_dir" --module github.com/AlexStocks/getty); \
status=0; \
while IFS= read -r -d '' file; do \
current_hash=$$(git hash-object --path="$$file" "$$file"); \
formatted_hash=$$(git hash-object --path="$$file" "$$temp_dir/$$file"); \
if test "$$current_hash" != "$$formatted_hash"; then \
printf 'Formatting changes are required: %s\n' "$$file"; \
status=1; \
fi; \
done < "$$go_files"; \
exit "$$status"

# Clean test generate files
clean:
rm -rf coverage.txt
Expand All @@ -52,4 +82,4 @@ install-golangci-lint:
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0

install-imports-formatter:
go install github.com/dubbogo/tools/cmd/imports-formatter@latest
go install github.com/dubbogo/tools/cmd/imports-formatter@v1.0.10
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

*a netty like asynchronous network I/O library*

[![Build Status](https://travis-ci.org/AlexStocks/getty.svg?branch=master)](https://travis-ci.org/AlexStocks/getty)
[![CI](https://github.com/AlexStocks/getty/actions/workflows/github-actions.yml/badge.svg?branch=master)](https://github.com/AlexStocks/getty/actions/workflows/github-actions.yml)
[![codecov](https://codecov.io/gh/AlexStocks/getty/branch/master/graph/badge.svg)](https://codecov.io/gh/AlexStocks/getty)
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/AlexStocks/getty?tab=doc)
[![Go Report Card](https://goreportcard.com/badge/github.com/AlexStocks/getty)](https://goreportcard.com/report/github.com/AlexStocks/getty)
Expand Down
4 changes: 2 additions & 2 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

*一个类似 Netty 的异步网络 I/O 库*

[![Build Status](https://travis-ci.org/AlexStocks/getty.svg?branch=master)](https://travis-ci.org/AlexStocks/getty)
[![CI](https://github.com/AlexStocks/getty/actions/workflows/github-actions.yml/badge.svg?branch=master)](https://github.com/AlexStocks/getty/actions/workflows/github-actions.yml)
[![codecov](https://codecov.io/gh/AlexStocks/getty/branch/master/graph/badge.svg)](https://codecov.io/gh/AlexStocks/getty)
[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/AlexStocks/getty?tab=doc)
[![Go Report Card](https://goreportcard.com/badge/github.com/AlexStocks/getty)](https://goreportcard.com/report/github.com/AlexStocks/getty)
Expand Down Expand Up @@ -554,4 +554,4 @@ session.AddCloseCallback([]int{1, 2, 3}, "key", callback) // 记录日

## 许可证

Apache 许可证 2.0
Apache 许可证 2.0
Loading
Loading