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
16 changes: 15 additions & 1 deletion .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ on:
pull_request:

jobs:
idl-submodule-points-to-master:
name: IDL submodule points to master
runs-on: ubuntu-latest # uses ubuntu as runner

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true # ensures git submodules are intialized and updated
fetch-depth: 0 # get full history for branch checking

- name: Check IDL submodule status (must point to master)
run: make .idl-status

golang-unit-test:
name: Golang unit test
runs-on: ubuntu-latest
Expand Down Expand Up @@ -153,4 +167,4 @@ jobs:
name: go-integration-grpc-coverage
path: .build/*/coverage/*.out
include-hidden-files: true


24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,30 @@ $(BUILD)/go_mod_check: go.mod internal/tools/go.mod
$Q ./scripts/check-gomod-version.sh go.uber.org/thriftrw $(if $(verbose),-v)
$Q touch $@

# checks that the idl submodule points to a commit on master, and that it matches the go module (which must be a pseudo version).
# this is only used in an explicit CI step, because it's expected to fail when developing.
#
# `git ls-tree HEAD idls` is selected because this only cares about the committed/checked-out target,
# not whatever the current status is, because only the committed value will exist for others.
#
# and last but not least: this avoids using `go` to make this check take only a couple seconds in CI,
# so the whole docker container doesn't have to be prepared.
.idl-status:
$(Q) cd idls && \
SUBMODULE_COMMIT=$$(git rev-parse HEAD) && \
BRANCH_INFO=$$(git branch -r --contains "$$SUBMODULE_COMMIT" | head -n1) && \
if ! git branch -r --contains "$$SUBMODULE_COMMIT" | grep -q "origin/master"; then \
echo "Error: Submodule commit $$SUBMODULE_COMMIT belongs to $$BRANCH_INFO, not to master branch" && \
exit 1; \
fi
$(Q) idlsha=$$(git ls-tree HEAD idls | awk '{print substr($$3,0,12)}') && \
gosha=$$(grep github.com/uber/cadence-idl go.mod | tr '-' '\n' | tail -n1) && \
if [[ "$$idlsha" != "$$gosha" ]]; then \
echo "IDL submodule sha ($$idlsha) does not match go module sha ($$gosha)." >&2 && \
echo "Make sure the IDL PR has been merged, and this PR is updated, before merging here." >&2 && \
exit 1; \
fi

# ====================================
# Codegen targets
# ====================================
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/robfig/cron v1.2.0
github.com/stretchr/testify v1.9.0
github.com/uber-go/tally v3.3.15+incompatible
github.com/uber/cadence-idl v0.0.0-20251027200124-0857e5075a96
github.com/uber/cadence-idl v0.0.0-20251030234320-a2d398f4e4df
github.com/uber/jaeger-client-go v2.22.1+incompatible
github.com/uber/tchannel-go v1.32.1
go.uber.org/atomic v1.11.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ github.com/uber-go/mapdecode v1.0.0/go.mod h1:b5nP15FwXTgpjTjeA9A2uTHXV5UJCl4arw
github.com/uber-go/tally v3.3.12+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyufu1cEi0jdVnRdxvjnmU=
github.com/uber-go/tally v3.3.15+incompatible h1:9hLSgNBP28CjIaDmAuRTq9qV+UZY+9PcvAkXO4nNMwg=
github.com/uber-go/tally v3.3.15+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyufu1cEi0jdVnRdxvjnmU=
github.com/uber/cadence-idl v0.0.0-20251027200124-0857e5075a96 h1:4TWSibG2Ucx+xRna6BsHSNPPnpfzYT7v26uorKuJD0k=
github.com/uber/cadence-idl v0.0.0-20251027200124-0857e5075a96/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/cadence-idl v0.0.0-20251030234320-a2d398f4e4df h1:zwr4iPLB4przghbqi6gwoLkKLr0vHE1oW6zJI8v9csY=
github.com/uber/cadence-idl v0.0.0-20251030234320-a2d398f4e4df/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/jaeger-client-go v2.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM=
github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
Expand Down