Merge remote-tracking branch 'origin/master' into aaron/remotestorage-streaming-download-locations

This commit is contained in:
Aaron Son
2021-05-06 17:37:10 -07:00
4 changed files with 83 additions and 70 deletions

View File

@@ -6,11 +6,9 @@ The initial changes contained in this PR were produced by `go get`ing the depend
```
$ cd ./go
$ go get -u github.com/dolthub/<dependency>/go@<commit>
$ go get github.com/dolthub/<dependency>/go@<commit>
```
### Before Merging
This PR must have passing CI and a review before merging.
If this PR has passing CI, a `check-suite-ok` label will automatically be applied to it.

View File

@@ -71,16 +71,16 @@ jobs:
open-bump-pr:
needs: [get-label, stale-bump-prs]
name: Open Bump PR
runs-on: macos-latest
runs-on: ubuntu-18.04
outputs:
latest-pr: ${{ steps.latest-pr.outputs.pr_url }}
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
- name: Bump dependency
working-directory: go
run: |
go get github.com/dolthub/${{ github.event.client_payload.dependency }}@${{ github.event.client_payload.head_commit_sha }}
go mod tidy
run: go get github.com/dolthub/${{ github.event.client_payload.dependency }}@${{ github.event.client_payload.head_commit_sha }}
- name: Get Assignee and Reviewer
id: get_reviewer
run: |
@@ -142,21 +142,43 @@ jobs:
const pull = JSON.parse(PULL);
for (const label of pull.labels) {
if (label.name === "check-suite-ok") {
await github.issues.createComment({
issue_number: pull.number,
owner,
repo,
body: `This PR has been superseded by ${SUPERSEDED_BY}`
});
await github.pulls.update({
owner,
repo,
pull_number: pull.number,
state: 'closed',
});
break;
}
if (label.name === "keep-alive") {
process.exit(0);
}
}
const checkSuiteRes = github.checks.listSuitesForRef({
owner,
repo,
ref: pull.head.ref,
});
console.log(checkSuiteRes);
if (checkSuiteRes.data) {
let successes = 0;
for (const suite of checkSuiteRes.data.check_suites) {
if (suite.status === "completed" && suite.conclusion === "success") {
successes += 1;
}
}
if (successes == checkSuiteRes.data.total_count) {
await github.issues.createComment({
issue_number: pull.number,
owner,
repo,
body: `This PR has been superseded by ${SUPERSEDED_BY}`
});
await github.pulls.update({
owner,
repo,
pull_number: pull.number,
state: 'closed',
});
}
}
process.exit(0);

View File

@@ -5,50 +5,7 @@ on:
branches: [ master ]
jobs:
format:
name: Format PR
runs-on: ubuntu-18.04
outputs:
has-changes: ${{ steps.detect-changes.outputs.has-changes }}
commit: ${{ steps.get_commit.outputs.commit }}
steps:
- name: Setup Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15
- uses: actions/checkout@v2
- name: Install goimports
run: go get golang.org/x/tools/cmd/goimports
- name: Format repo and update licenses
working-directory: ./go
run: |
./utils/repofmt/format_repo.sh
./Godeps/update.sh
env:
BRANCH_NAME: ${{ github.head_ref }}
CHANGE_TARGET: ${{ github.base_ref }}
- name: Changes detected
id: detect-changes
run: |
changes=$(git status --porcelain)
if [ ! -z "$changes" ]; then
echo "::set-output name=has-changes::true"
fi
- uses: EndBug/add-and-commit@v7
if: ${{ steps.detect-changes.outputs.has-changes == 'true' }}
with:
message: "[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh"
add: "."
cwd: "."
- name: Get commit
id: get_commit
if: ${{ steps.detect-changes.outputs.has-changes == 'true' }}
run: |
commit=$(git rev-parse HEAD)
echo "::set-output name=commit::$commit"
verify:
needs: format
name: Verify format and committers
runs-on: ubuntu-18.04
steps:
@@ -57,11 +14,6 @@ jobs:
with:
go-version: ^1.15
- uses: actions/checkout@v2
if: ${{ needs.format.outputs.has-changes == 'true' && needs.format.outputs.commit != '' }}
with:
ref: ${{ needs.format.outputs.commit }}
- uses: actions/checkout@v2
if: ${{ needs.format.outputs.has-changes != 'true' }}
- name: Check all
working-directory: ./go
# Keep this in sync with //go/utils/prepr/prepr.sh.

41
.github/workflows/ci-format-repo.yaml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: Format PR
on:
pull_request:
branches: [ master ]
jobs:
format:
name: Format PR
runs-on: ubuntu-18.04
steps:
- name: Setup Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15
- uses: actions/checkout@v2
with:
token: ${{ secrets.REPO_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
- name: Install goimports
run: go get golang.org/x/tools/cmd/goimports
- name: Format repo and update licenses
working-directory: ./go
run: |
./utils/repofmt/format_repo.sh
./Godeps/update.sh
env:
BRANCH_NAME: ${{ github.head_ref }}
CHANGE_TARGET: ${{ github.base_ref }}
- name: Changes detected
id: detect-changes
run: |
changes=$(git status --porcelain)
if [ ! -z "$changes" ]; then
echo "::set-output name=has-changes::true"
fi
- uses: EndBug/add-and-commit@v7
if: ${{ steps.detect-changes.outputs.has-changes == 'true' }}
with:
message: "[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh"
add: "."
cwd: "."