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
8 changes: 1 addition & 7 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,11 @@ jobs:
with:
fetch-depth: 0

- name: Read Go version
id: tool_versions
shell: bash
run: |
echo "go_version=$(grep -E '^VERSION_GO=' tool-versions.env | cut -d= -f2)" >> $GITHUB_OUTPUT

- name: Set up Go
uses: actions/setup-go@v6 # v6
with:
cache: true
go-version: ${{ steps.tool_versions.outputs.go_version }}
go-version-file: 'go.mod'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misc cleanup in yaml files


- name: Load tool versions
id: tool-versions
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/mod-tidy-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,11 @@ jobs:
with:
fetch-depth: 0

- name: Read Go version
id: tool_versions
shell: bash
run: |
echo "go_version=$(grep -E '^VERSION_GO=' tool-versions.env | cut -d= -f2)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v6 # v6
with:
cache: true
go-version: ${{ steps.tool_versions.outputs.go_version }}
go-version-file: 'go.mod'

- name: Populate go envs
run: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release-rc-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ jobs:

- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: '1.40.0'

- name: Authenticate to AWS ECR
uses: ./.github/actions/aws-ecr-auth
Expand All @@ -40,4 +38,4 @@ jobs:
echo "Building Release Candidate Image.."
just "$MODULE"/build-rc
echo "Publishing Release Candidate Image.."
just "$MODULE"/publish-rc "${{ secrets.ECR_REGISTRY }}" "$VERSION"
just "$MODULE"/publish-rc "${{ secrets.ECR_REGISTRY }}" "$VERSION"
32 changes: 32 additions & 0 deletions .github/workflows/repo-hygiene.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Repo Hygiene Checks

on:
merge_group:
pull_request:
push:
branches:
- main

jobs:
hygiene-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v6 # v6
with:
cache: true
go-version-file: 'go.mod'

- name: Install just
uses: extractions/setup-just@69d82fb0233557aec017ef13706851d0694e0f1d # v2.0.0

Check warning on line 26 in .github/workflows/repo-hygiene.yaml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. Action is using node16 (node-version / warning)

- name: Install go-tools
run: just install-go-tools

- name: Run repo hygiene checks
run: tools/bin/check_repo_clean.sh tidy mock generate shellcheck
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New CI command. Runs the provided just targets and ensures they don't modify the repo or return an error.

4 changes: 1 addition & 3 deletions .github/workflows/test-nightly-performance-chaos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:

- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: '1.40.0'

- name: Authenticate to AWS ECR
uses: ./.github/actions/aws-ecr-auth
Expand Down Expand Up @@ -78,4 +76,4 @@ jobs:
env:
LOKI_URL: http://localhost:3030/loki/api/v1/push
run: |
go test -v -run ${{ matrix.test.name }} -timeout 1h
go test -v -run ${{ matrix.test.name }} -timeout 1h
6 changes: 2 additions & 4 deletions .github/workflows/test-performance-on-demand.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@ jobs:

- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: '1.40.0'
Comment on lines -40 to -41
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only concern w/ this unpinning is if there's a new major version that somehow breaks things - is that a realistic concern?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same thought but removed it anyway because: we don't pin the version for developers, we don't pin it consistently in other actions, and the just project would be foolish to break things in that way.


- name: Authenticate to AWS ECR
uses: ./.github/actions/aws-ecr-auth
with:
role-to-assume: ${{ secrets.CCV_IAM_ROLE }}
aws-region: us-east-1
registry-type: public

- name: Authenticate to AWS ECR (JD)
uses: ./.github/actions/aws-ecr-auth
with:
Expand Down Expand Up @@ -86,4 +84,4 @@ jobs:
env:
LOKI_URL: http://localhost:3030/loki/api/v1/push
run: |
go test -v -run ${{ matrix.test.name }} -timeout 1h
go test -v -run ${{ matrix.test.name }} -timeout 1h
2 changes: 0 additions & 2 deletions .github/workflows/test-services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ jobs:

- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: '1.40.0'

- name: Authenticate to AWS ECR
uses: ./.github/actions/aws-ecr-auth
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test-smoke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,14 @@ jobs:

- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: '1.40.0'

- name: Authenticate to AWS ECR
uses: ./.github/actions/aws-ecr-auth
with:
role-to-assume: ${{ secrets.CCV_IAM_ROLE }}
aws-region: us-east-1
registry-type: public

- name: Authenticate to AWS ECR (JD)
uses: ./.github/actions/aws-ecr-auth
with:
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test-testnets-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,14 @@ jobs:

- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: '1.40.0'

- name: Authenticate to AWS ECR
uses: ./.github/actions/aws-ecr-auth
with:
role-to-assume: ${{ secrets.CCV_IAM_ROLE }}
aws-region: us-east-1
registry-type: public

- name: Authenticate to AWS ECR (JD)
uses: ./.github/actions/aws-ecr-auth
with:
Expand Down Expand Up @@ -83,4 +81,4 @@ jobs:

- name: Run Soak Test
working-directory: build/devenv/tests/e2e
run: go test -timeout 2h -v -run TestSoak
run: go test -timeout 2h -v -run TestSoak
7 changes: 7 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ fmt: ensure-golangci-lint
lint fix="": ensure-golangci-lint
find . -type f -name go.mod -execdir golangci-lint run {{ if fix != "" { "--fix" } else { "" } }} \;

shellcheck:
@command -v shellcheck >/dev/null 2>&1 || { \
echo "shellcheck is not installed. Please install it first."; \
exit 1; \
}
find . -type f -name *.sh -execdir shellcheck {} +

mod-download: ensure-go
go mod download

Expand Down
2 changes: 1 addition & 1 deletion indexer/docs/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.20.0-SNAPSHOT
7.19.0
2 changes: 1 addition & 1 deletion indexer/generate-docs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
docker run --rm \
-v "${PWD}:/local" \
openapitools/openapi-generator-cli generate \
openapitools/openapi-generator-cli:v7.19.0 generate \
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pin version so that the VERSION file doesn't change unexpectedly.

-i /local/indexer_opanapi_v1.yaml \
-g markdown \
-o /local/docs
67 changes: 67 additions & 0 deletions tools/bin/check_repo_clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash
set -euo pipefail

# Script to run repository hygiene commands and fail if they modify the repo.
# Exits non-zero and prints modified files if any step fails or changes the working tree.

# Default list of just targets to run for checks (fallback).
just_targets_to_run=(tidy mock generate shellcheck)

# If the script is invoked with positional arguments, use those as the targets
# instead of the default list. Example:
# ./tools/bin/check_repo_clean.sh tidy mock generate
if [ "$#" -gt 0 ]; then
just_targets_to_run=("$@")
fi

# Ensure we are inside a git repository
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
echo "ERROR: not inside a git repository" >&2
exit 2
fi

# Ensure `just` is available
if ! command -v just >/dev/null 2>&1; then
echo "ERROR: 'just' not found in PATH" >&2
exit 2
fi

run_and_check() {
local before
local after

echo "--- Running: just $* ---"
before=$(git status --porcelain)

if ! just "$@"; then
echo "ERROR: 'just $*' failed" >&2
exit 1
fi

after=$(git status --porcelain)

if [ "${before}" != "${after}" ]; then
echo ""
echo "ERROR: Repository changed after 'just $*'." >&2
echo "Changed files (git status --porcelain):" >&2
git --no-pager status --porcelain >&2
echo ""
echo "You should inspect and commit or revert these changes." >&2
exit 1
fi

echo "OK: no repo changes after 'just $*'."
echo ""
}

for c in "${just_targets_to_run[@]}"; do
run_and_check "$c"
done

# Print a multiline bulleted list showing which just targets ran
echo "All checks passed:"
for t in "${just_targets_to_run[@]}"; do
echo " * just $t"
done

exit 0
2 changes: 1 addition & 1 deletion tools/bin/cov_compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ for arg in "$@"; do
done

# Reset positional parameters
set -- $ARGS
set -- "$ARGS"

if [ "$#" -ne 2 ]; then
echo "Usage: $0 [--no-header] coverage1.out coverage2.out" >&2
Expand Down
12 changes: 6 additions & 6 deletions tools/bin/install-protoc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ os=$(uname)
arch=$(uname -m)

install_dir=/usr/local
$install_dir/bin/protoc --version | grep $VERSION
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misc shellcheck fixes

$install_dir/bin/protoc --version | grep "$VERSION"
rc=$?
if [ $rc -eq 0 ]; then
# we have the current VERSION
Expand All @@ -38,12 +38,12 @@ else
fi

workdir=$(mktemp -d)
pushd $workdir
pushd "$workdir" || exit 1
pb_url="https://github.com/protocolbuffers/protobuf/releases"
artifact=protoc-$VERSION-$os-$arch.zip
curl -LO $pb_url/download/v${VERSION}/$artifact
unzip -o $artifact -d $install_dir
rm $artifact
curl -LO "$pb_url/download/v${VERSION}/$artifact"
unzip -o "$artifact" -d "$install_dir"
rm "$artifact"

echo "protoc $VERSION installed in $install_dir"
popd
popd || exit 1
Loading