Skip to content

Commit

Permalink
Merge branch 'master' into sticky-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shijiesheng authored Sep 9, 2024
2 parents 7e55e71 + fd9956a commit b8066d1
Show file tree
Hide file tree
Showing 54 changed files with 2,666 additions and 255 deletions.
20 changes: 0 additions & 20 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ container:
agents:
queue: "buildkite-gcp"
steps:
- label: "fossa analyze"
command: ".buildkite/scripts/fossa.sh"

- label: ":golang: unit-test"
artifact_paths:
- ".build/*/coverage/*.out"
Expand Down Expand Up @@ -136,20 +133,3 @@ steps:
- docker-compose#v3.0.0:
run: integ-test-grpc
config: docker/buildkite/docker-compose.yml

- wait

- label: ":golang: code-coverage"
plugins:
- kubernetes:
<<: *kubernetes
podSpec:
<<: *podSpec
containers:
- <<: *commandContainer
command:
- |-
.buildkite/scripts/gocov.sh
- docker-compose#v3.0.0:
run: coverage-report
config: docker/buildkite/docker-compose.yml
16 changes: 0 additions & 16 deletions .buildkite/scripts/gocov.sh

This file was deleted.

148 changes: 140 additions & 8 deletions .gen/go/shared/shared.go

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions .github/workflows/breaking_change_pr_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**Detailed Description**
[In-depth description of the changes made to the interfaces, specifying new fields, removed fields, or modified data structures]

**Impact Analysis**
- **Backward Compatibility**: [Analysis of backward compatibility]
- **Forward Compatibility**: [Analysis of forward compatibility]

**Testing Plan**
- **Unit Tests**: [Do we have unit test covering the change?]
- **Persistence Tests**: [If the change is related to a data type which is persisted, do we have persistence tests covering the change?]
- **Integration Tests**: [Do we have integration test covering the change?]
- **Compatibility Tests**: [Have we done tests to test the backward and forward compatibility?]

**Rollout Plan**
- What is the rollout plan?
- Does the order of deployment matter?
- Is it safe to rollback? Does the order of rollback matter?
- Is there a kill switch to mitigate the impact immediately?
54 changes: 54 additions & 0 deletions .github/workflows/breaking_change_reminder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Workflow for Breaking Change Reminder
on:
pull_request:
paths:
# below files do not cover all the exposed types/funcs, but it's a good start to detect potentially breaking changes
- activity/activity.go
- client/client.go
- encoded/encoded.go
- interceptors/workflow_interceptor.go
- internal/activity.go
- internal/client.go
- internal/encoded.go
- internal/workflow.go
- internal/interceptors.go
- internal/worker.go
- internal/workflow.go
- worker/worker.go
- workflow/*.go

jobs:
breaking-change-pr-template-reminder:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fail if PR description is missing breaking change template
if: steps.pr-changes.outputs.changes != '[]'
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
PR_URL="https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER}"
BODY=$(curl $PR_URL | jq '.body')
CHECKLIST=(
"Detailed Description"
"Impact Analysis"
"Testing Plan"
"Rollout Plan"
)
TEMPLATE=$(cat .github/workflows/breaking_change_pr_template.md)
for i in "${CHECKLIST[@]}"; do
if [[ "$BODY" == *"$i"* ]]; then
continue
else
echo "Potential breaking changes detected! Please update the PR description to include following template:"
echo "---"
echo "$TEMPLATE"
echo "---"
exit 1
fi
done
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: make unit_test

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1 # https://github.com/codecov/codecov-action
uses: codecov/codecov-action@v4.5.0 # https://github.com/codecov/codecov-action
with:
file: .build/cover.out
exclude: ./
Expand Down
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

35 changes: 35 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,41 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [v1.2.10] - 2024-07-10
### Added
- Revert "Handle panics while polling for tasks (#1352)" (#1357)
- Remove coveralls integration (#1354)
- Change registry Apis signature to return info interface (#1355)
- Adjust startedCount assertion in Test_WorkflowLocalActivityWithMockAndListeners (#1353)
- Handle panics while polling for tasks (#1352)
- Ensure PR description follows a template when potential breaking changes are made (#1351)
- Add tests for replayer utils isDecisionMatchEvent (#1350)
- Adding tests for internal_workflow_client (#1349)
- Extracting domain client to a separate file (#1348)
- Test for GetWorkflowHistory (#1346)
- Added test for TerminateWorkflow in the internal package (#1345)
- Implement the registered workflows and activities APIs in testsuite (#1343)
- Add methods on Worker to get registered workflows and activities (#1342)
- Update compability adapter to support new enum value (#1337)
- Bump x/tools for tools, to support go 1.22 (#1336)
- Added an option to exclude the list of workflows by Type (#1335)
- Migrate CI from AWS queues to Google Kubernetes Engine queues (#1333)
- Internal workflow client test improvements (#1331)
- Update client wrappers with new async APIs (#1327)
- Server-like `make build` and ensuring builds are clean in CI (#1329)
- Pin mockery and regenerate everything (#1328)
- Enforce 85% new line coverage (#1325)
- Add documentation for propagators and how they are executed (#1312)
- Update idl and add wrapper implementaton for async start/signalwithstart APIs (#1321)
- Enable codecov and generate metadata file as artifact (#1320)
- Release v1.2.9 (#1317)

### Fixed
- Partial fix for Continue as new case (#1347)
- Fixing unit_test failure detection, and tests for data converters (#1341)
- Fix coverage metadata commit info (#1323)


## [v1.2.9] - 2024-03-01
### Added
- retract directive for v1.2.8
Expand Down
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -369,20 +369,19 @@ INTEG_GRPC_COVER_FILE := $(COVER_ROOT)/integ_test_grpc_cover.out

UT_DIRS := $(filter-out $(INTEG_TEST_ROOT)%, $(sort $(dir $(filter %_test.go,$(ALL_SRC)))))

.PHONY: unit_test integ_test_sticky_off integ_test_sticky_on integ_test_grpc cover cover_ci
.PHONY: unit_test integ_test_sticky_off integ_test_sticky_on integ_test_grpc cover
test: unit_test integ_test_sticky_off integ_test_sticky_on ## run all tests (requires a running cadence instance)

unit_test: $(ALL_SRC) ## run all unit tests
$Q mkdir -p $(COVER_ROOT)
$Q echo "mode: atomic" > $(UT_COVER_FILE)
$Q failed=0; \
$Q FAIL=""; \
for dir in $(UT_DIRS); do \
mkdir -p $(COVER_ROOT)/"$$dir"; \
go test "$$dir" $(TEST_ARG) -coverprofile=$(COVER_ROOT)/"$$dir"/cover.out || failed=1; \
go test "$$dir" $(TEST_ARG) -coverprofile=$(COVER_ROOT)/"$$dir"/cover.out || FAIL="$$FAIL $$dir"; \
cat $(COVER_ROOT)/"$$dir"/cover.out | grep -v "mode: atomic" >> $(UT_COVER_FILE); \
done; \
done; test -z "$$FAIL" || (echo "Failed packages; $$FAIL"; exit 1)
cat $(UT_COVER_FILE) > .build/cover.out;
exit $$failed

integ_test_sticky_off: $(ALL_SRC)
$Q mkdir -p $(COVER_ROOT)
Expand Down Expand Up @@ -410,6 +409,3 @@ coverage_report: $(COVER_ROOT)/cover.out

cover: $(COVER_ROOT)/cover.out
go tool cover -html=$(COVER_ROOT)/cover.out;

cover_ci: $(COVER_ROOT)/cover.out $(BIN)/goveralls
$(BIN)/goveralls -coverprofile=$(COVER_ROOT)/cover.out -service=buildkite || echo -e "\x1b[31mCoveralls failed\x1b[m";
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Go framework for Cadence [![Build Status](https://badge.buildkite.com/e7241785444519bdfd1defc68839fd19a89c15adb3477c73f7.svg?theme=github&branch=master)](https://buildkite.com/uberopensource/cadence-go-client) [![Coverage Status](https://coveralls.io/repos/uber-go/cadence-client/badge.svg?branch=master&service=github)](https://coveralls.io/github/uber-go/cadence-client?branch=master) [![GoDoc](https://godoc.org/go.uber.org/cadence?status.svg)](https://godoc.org/go.uber.org/cadence)
# Go framework for Cadence
[![Build Status](https://badge.buildkite.com/e7241785444519bdfd1defc68839fd19a89c15adb3477c73f7.svg?theme=github&branch=master)](https://buildkite.com/uberopensource/cadence-go-client)
[![Coverage](https://codecov.io/gh/uber-go/cadence-client/graph/badge.svg?token=iEpqo5HbDe)](https://codecov.io/gh/uber-go/cadence-client)
[![GoDoc](https://godoc.org/go.uber.org/cadence?status.svg)](https://godoc.org/go.uber.org/cadence)

[Cadence](https://github.com/uber/cadence) is a distributed, scalable, durable, and highly available orchestration engine we developed at Uber Engineering to execute asynchronous long-running business logic in a scalable and resilient way.

Expand All @@ -18,14 +21,13 @@ or
go get go.uber.org/cadence
```

See [samples](https://github.com/uber-common/cadence-samples) to get started.
See [samples](https://github.com/uber-common/cadence-samples) to get started.

Documentation is available [here](https://cadenceworkflow.io/docs/go-client/).
Documentation is available [here](https://cadenceworkflow.io/docs/go-client/).
You can also find the API documentation [here](https://godoc.org/go.uber.org/cadence).

## Contributing
We'd love your help in making the Cadence Go client great. Please review our [contribution guidelines](CONTRIBUTING.md).

## License
MIT License, please see [LICENSE](LICENSE) for details.

3 changes: 3 additions & 0 deletions activity/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ type (

// RegisterOptions consists of options for registering an activity
RegisterOptions = internal.RegisterActivityOptions

// RegistryInfo
RegistryInfo = internal.RegistryActivityInfo
)

// ErrResultPending is returned from activity's implementation to indicate the activity is not completed when
Expand Down
58 changes: 58 additions & 0 deletions debug/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Copyright (c) 2017-2021 Uber Technologies Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package debug

import (
internal "go.uber.org/cadence/internal/common/debug"
)

type (
// PollerTracker is an interface to track running pollers on a worker
// Deprecated: in development and very likely to change
PollerTracker = internal.PollerTracker

// Stopper is an interface for tracking stop events in an ongoing process or goroutine.
// Implementations should ensure that Stop() is used to signal and track the stop event
// and not to clean up any resources opened by worker
// Deprecated: in development and very likely to change
Stopper = internal.Stopper

// WorkerStats provides a set of methods that can be used to collect
// stats on the Worker for debugging purposes.
// Deprecated: in development and very likely to change
WorkerStats = internal.WorkerStats

// ActivityTracker is a worker option to track executing activities on a worker
// Deprecated: in development and very likely to change
ActivityTracker = internal.ActivityTracker

// ActivityInfo contains details on the executing activity
// Deprecated: in development and very likely to change
ActivityInfo = internal.ActivityInfo

// Activities is a list of executing activities on the worker
// Deprecated: in development and very likely to change
Activities = internal.Activities

// Debugger exposes stats collected on a running Worker
// Deprecated: in development and very likely to change
Debugger = internal.Debugger
)
1 change: 0 additions & 1 deletion docker/buildkite/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ services:
- BUILDKITE_BUILD_CREATOR_EMAIL
- BUILDKITE_BUILD_CREATOR_TEAMS
- BUILDKITE_PULL_REQUEST_REPO
- COVERALLS_TOKEN
- "GO111MODULE=on"
volumes:
- ../../:/go/src/go.uber.org/cadence
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ require (
github.com/pborman/uuid v0.0.0-20160209185913-a97ce2ca70fa
github.com/robfig/cron v1.2.0
github.com/shirou/gopsutil v3.21.11+incompatible
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.9.0
github.com/uber-go/tally v3.3.15+incompatible
github.com/uber/cadence-idl v0.0.0-20240416202333-83d5cae7fc51
github.com/uber/cadence-idl v0.0.0-20240723221048-0482c040f91d
github.com/uber/jaeger-client-go v2.22.1+incompatible
github.com/uber/tchannel-go v1.32.1
go.uber.org/atomic v1.9.0
go.uber.org/atomic v1.11.0
go.uber.org/goleak v1.1.12
go.uber.org/multierr v1.6.0
go.uber.org/thriftrw v1.25.0
Expand All @@ -45,7 +45,7 @@ require (
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/uber-go/mapdecode v1.0.0 // indirect
Expand Down
Loading

0 comments on commit b8066d1

Please sign in to comment.