Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testing] feat: ci: Automated suggestion if check-gen job fails #12352

Closed
wants to merge 6 commits into from
Closed
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
38 changes: 38 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,47 @@ jobs:
- run: make deps lotus
- run: go install golang.org/x/tools/cmd/goimports
- run: make gen
- run: git diff > codegen_changes.patch
- run: git diff --exit-code
- run: make docsgen-cli
- run: git diff >> codegen_changes.patch
- run: git diff --exit-code
- uses: actions/upload-artifact@v3
if: failure()
with:
name: codegen-diff
path: codegen_changes.patch
suggest-codegen-changes:
needs: check-gen
if: failure() && github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: codegen-diff
- name: Create suggestion
run: |
if [ -s codegen_changes.patch ]; then
PATCH_CONTENT=$(cat codegen_changes.patch)
SUGGESTION=$(cat <<EOF
\`\`\`suggestion
$PATCH_CONTENT
\`\`\`
EOF
)
gh pr comment ${{ github.event.pull_request.number }} --body "`gen-check` failed, suggested fix:

$SUGGESTION

To apply these changes, please review and manually apply the suggestion above."
else
gh pr comment ${{ github.event.pull_request.number }} --body "Attempted to fix codegen, but no changes were necessary."
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
check-lint:
name: Check (lint-all)
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

// NodeBuildVersion is the local build version of the Lotus daemon
const NodeBuildVersion string = "1.28.2-dev"
const NodeBuildVersion string = "1.29.2-dev"

func NodeUserVersion() BuildVersion {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
Expand All @@ -18,7 +18,7 @@ func NodeUserVersion() BuildVersion {
}

// MinerBuildVersion is the local build version of the Lotus miner
const MinerBuildVersion = "1.28.2-dev"
const MinerBuildVersion = "1.29.2-dev"

func MinerUserVersion() BuildVersion {
if os.Getenv("LOTUS_VERSION_IGNORE_COMMIT") == "1" {
Expand Down
Loading