Skip to content

Commit

Permalink
Merge branch 'master' of github.com:filecoin-project/lotus
Browse files Browse the repository at this point in the history
  • Loading branch information
jennijuju committed Sep 16, 2024
2 parents d68dca6 + 14bfb70 commit a63853b
Show file tree
Hide file tree
Showing 217 changed files with 6,906 additions and 2,258 deletions.
16 changes: 0 additions & 16 deletions .github/actions/start-yugabytedb/action.yml

This file was deleted.

11 changes: 2 additions & 9 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,8 @@
Before you mark the PR ready for review, please make sure that:

- [ ] Commits have a clear commit message.
- [ ] PR title is in the form of of `<PR type>: <area>: <change being made>`
- example: ` fix: mempool: Introduce a cache for valid signatures`
- `PR type`: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
- `area`, e.g. api, chain, state, mempool, multisig, networking, paych, proving, sealing, wallet, deps
- [ ] Update CHANGELOG.md or signal that this change does not need it.
- If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
- If the change does not require a CHANGELOG.md entry, do one of the following:
- Add `[skip changelog]` to the PR title
- Add the label `skip/changelog` to the PR
- [ ] PR title conforms with [contribution conventions](https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#pr-title-conventions)
- [ ] Update CHANGELOG.md or signal that this change does not need it per [contribution conventions](https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#changelog-management)
- [ ] New features have usage guidelines and / or documentation updates in
- [ ] [Lotus Documentation](https://lotus.filecoin.io)
- [ ] [Discussion Tutorials](https://github.com/filecoin-project/lotus/discussions/categories/tutorials)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/builtin-actor-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.21
go-version: 1.22
- run: go test -tags=release ./build
9 changes: 4 additions & 5 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- reopened
- labeled
- unlabeled
- ready_for_review
paths:
- '**.go'
- '**/go.mod'
Expand All @@ -17,7 +18,8 @@ on:
jobs:
changelog:
if: contains(github.event.pull_request.title, '[skip changelog]') == false &&
contains(github.event.pull_request.labels.*.name, 'skip/changelog') == false
contains(github.event.pull_request.labels.*.name, 'skip/changelog') == false &&
github.event.pull_request.draft == false
runs-on: ubuntu-latest
name: Changelog
steps:
Expand All @@ -30,10 +32,7 @@ jobs:
- if: steps.changelog.outputs.modified == '0'
env:
MESSAGE: |
docs/changelogs/ was not modified in this PR. Please do one of the following:
- add a changelog entry
- add `[skip changelog]` to the PR title
- label the PR with `skip/changelog`
docs/changelogs/ was not modified in this PR. Please do one of the options in [changelog management conventions](https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#changelog-management)
run: |
echo "::error::${MESSAGE//$'\n'/%0A}"
exit 1
60 changes: 60 additions & 0 deletions .github/workflows/pr-title-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: PR Title Check

on:
pull_request_target:
types:
- opened
- edited
- reopened
- ready_for_review

permissions:
pull-requests: write

jobs:
check-pr-title:
if: github.event.pull_request.draft == false
name: Check PR Title
runs-on: ubuntu-latest
steps:
- name: Check PR Title and Manage Review
uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const title = context.payload.pull_request.title;
// This should match https://github.com/filecoin-project/lotus/blob/master/README.md#pr-title-conventions
// 202408: Beyond Conventional Commit conventions, we also optionally suport the "scope" outside of paranenthesis for a transitionary period from legacy conventions per https://github.com/filecoin-project/lotus/pull/12340
const pattern = /^(\[skip changelog\]\s)?(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([\w.]+\))?!?:?\s(\w+:)?\s?[a-z].+$/;
if (!pattern.test(title)) {
await github.rest.pulls.createReview({
...context.repo,
pull_number: context.payload.pull_request.number,
body: 'Please update the PR title to match https://github.com/filecoin-project/lotus/blob/master/CONTRIBUTING.md#pr-title-conventions',
event: 'REQUEST_CHANGES'
});
core.setFailed('PR title does not match the required format');
} else if (context.payload.action === 'edited' && context.payload.changes.title) {
// Only proceed with dismissal if the title was just edited
await new Promise(resolve => setTimeout(resolve, 5000)); // 5 second delay
const reviews = await github.rest.pulls.listReviews({
...context.repo,
pull_number: context.payload.pull_request.number
});
const botReview = reviews.data.find(review =>
review.user.type === 'Bot' &&
review.state === 'CHANGES_REQUESTED'
);
if (botReview) {
await github.rest.pulls.dismissReview({
...context.repo,
pull_number: context.payload.pull_request.number,
review_id: botReview.id,
message: 'PR title now matches the required format.'
});
}
}
8 changes: 4 additions & 4 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ jobs:
- uses: actions/stale@v9
with:
repo-token: ${{ github.token }}
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 24 hours.'
stale-issue-message: 'We needed more information for this issue, please comment with more details or this issue will be closed in 72 hours.'
close-issue-message: 'This issue was closed because it is missing author input.'
stale-pr-message: 'Thank you for submitting the PR and contributing to lotus! Lotus maintainers need more of your input before merging it, please address the suggested changes or reply to the comments or this PR will be closed in 48 hours. You are always more than welcome to reopen the PR later as well!'
stale-pr-message: 'Thank you for submitting the PR and contributing to lotus! Lotus maintainers need more of your input before merging it, please address the suggested changes or reply to the comments or this PR will be closed in 72 hours. You are always more than welcome to reopen the PR later as well!'
close-pr-message: 'This PR was closed because it is missing author input. Please feel free to reopen the PR when you get to it! Thank you for your interest in contributing to lotus!'
stale-issue-label: 'kind/stale'
stale-pr-label: 'kind/stale'
any-of-labels: 'need/author-input '
days-before-issue-stale: 3
days-before-issue-close: 1
days-before-issue-close: 3
days-before-pr-stale: 5
days-before-pr-close: 2
days-before-pr-close: 3
remove-stale-when-updated: true
enable-statistics: true
46 changes: 29 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ jobs:
"multicore-sdr": ["self-hosted", "linux", "x64", "xlarge"],
"unit-node": ["self-hosted", "linux", "x64", "xlarge"]
}
# A list of test groups that require YugabyteDB to be running
yugabytedb: |
["itest-harmonydb"]
# A list of test groups that require Proof Parameters to be fetched
parameters: |
[
Expand Down Expand Up @@ -161,9 +158,6 @@ jobs:
# Apply custom runner labels to the groups
groups="$(jq -n --argjson g "$groups" --argjson r "$runners" '$g | map(. + {"runner": (.name as $n | $r | .[$n]) })')"
# Apply the needs_yugabytedb flag to the groups
groups="$(jq -n --argjson g "$groups" --argjson y "$yugabytedb" '$g | map(. + {"needs_yugabytedb": ([.name] | inside($y)) })')"
# Apply the needs_parameters flag to the groups
groups="$(jq -n --argjson g "$groups" --argjson p "$parameters" '$g | map(. + {"needs_parameters": ([.name] | inside($p)) })')"
Expand Down Expand Up @@ -192,7 +186,7 @@ jobs:
echo -e "path<<EOF\n$CACHE_PATH\nEOF" | tee -a $GITHUB_OUTPUT
- id: make_deps
env:
CACHE_KEY: ${{ runner.os }}-${{ runner.arch }}-make-deps-${{ hashFiles('./.git/modules/extern/filecoin-ffi/HEAD') }}
CACHE_KEY: ${{ runner.os }}-${{ runner.arch }}-make-deps-${{ hashFiles('./.git/modules/extern/filecoin-ffi/HEAD') }}-p
CACHE_PATH: |
./extern/filecoin-ffi/filcrypto.h
./extern/filecoin-ffi/libfilcrypto.a
Expand All @@ -212,14 +206,14 @@ jobs:
key: ${{ steps.make_deps.outputs.key }}
path: ${{ steps.make_deps.outputs.path }}
lookup-only: true
- if: steps.restore_fetch_params.outputs.cache-hit != 'true'
- if: steps.restore_fetch_params.outputs.cache-hit != 'true' || steps.restore_make_deps.outputs.cache-hit != 'true'
uses: ./.github/actions/install-system-dependencies
- if: steps.restore_fetch_params.outputs.cache-hit != 'true'
- if: steps.restore_fetch_params.outputs.cache-hit != 'true' || steps.restore_make_deps.outputs.cache-hit != 'true'
uses: ./.github/actions/install-go
- if: steps.restore_fetch_params.outputs.cache-hit != 'true' || steps.restore_make_deps.outputs.cache-hit != 'true'
env:
GITHUB_TOKEN: ${{ github.token }}
run: make deps
run: FFI_PORTABLE=1 make deps
- if: steps.restore_fetch_params.outputs.cache-hit != 'true'
run: make lotus
- if: steps.restore_fetch_params.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -248,7 +242,8 @@ jobs:
submodules: 'recursive'
- uses: ./.github/actions/install-system-dependencies
- uses: ./.github/actions/install-go
- run: go install gotest.tools/gotestsum@latest
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Restore cached make deps outputs
uses: actions/cache/restore@v4
with:
Expand All @@ -262,17 +257,15 @@ jobs:
key: ${{ needs.cache.outputs.fetch_params_key }}
path: ${{ needs.cache.outputs.fetch_params_path }}
fail-on-cache-miss: true
- if: ${{ matrix.needs_yugabytedb }}
uses: ./.github/actions/start-yugabytedb
timeout-minutes: 3
# TODO: Install statediff (used to be used for conformance)
- id: reports
- name: Create temporary directory for reports
id: reports
run: mktemp -d | xargs -0 -I{} echo "path={}" | tee -a $GITHUB_OUTPUT
# TODO: Track coverage (used to be tracked for conformance)
- env:
- name: Run tests
env:
NAME: ${{ matrix.name }}
LOTUS_SRC_DIR: ${{ github.workspace }}
LOTUS_HARMONYDB_HOSTS: 127.0.0.1
REPORTS_PATH: ${{ steps.reports.outputs.path }}
SKIP_CONFORMANCE: ${{ matrix.skip_conformance || '1' }}
TEST_RUSTPROOFS_LOGS: ${{ matrix.test_rustproofs_logs || '0' }}
Expand All @@ -285,6 +278,25 @@ jobs:
--jsonfile "$REPORTS_PATH/$NAME.json" \
--packages="$PACKAGES" \
-- ${{ matrix.go_test_flags || '' }}
- name: Modify junit.xml for BuildPulse
env:
NAME: ${{ matrix.name }}
REPORTS_PATH: ${{ steps.reports.outputs.path }}
PACKAGES: ${{ join(matrix.packages, ' ') }}
if: always()
run: |
# Modify test suite name and classname attributes in JUnit XML for better grouping
# in BuildPulse. itests are run with go test ./itests/file_test.go and therefore Go
# assigns the name and classname attributes to "command-line-arguments". Others get the
# package name for both.
if [[ "${{ matrix.name }}" == itest-* ]]; then
PACKAGE_NAME=$(basename "$PACKAGES" .go)
sed -i 's/ name="command-line-arguments"/ name="itests"/g' "$REPORTS_PATH/$NAME.xml"
sed -i 's/classname="command-line-arguments"/classname="'"$PACKAGE_NAME"'"/g' "$REPORTS_PATH/$NAME.xml"
else
sed -i 's# name="github.com/filecoin-project/lotus/\(.*\)"# name="'${{ matrix.name }}':\1"#g' "$REPORTS_PATH/$NAME.xml"
fi
cat "$REPORTS_PATH/$NAME.xml"
- if: success() || failure()
uses: actions/upload-artifact@v4
with:
Expand Down
Loading

0 comments on commit a63853b

Please sign in to comment.