-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
616 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Release downstreams | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'downstreams/v*' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.21 | ||
|
||
- name: Build | ||
run: /bin/bash .github/workflows/build.sh downstreams | ||
|
||
- name: Compress | ||
run: /bin/bash .github/workflows/compress.sh | ||
|
||
- name: Create release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: dist/* |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
downstreams |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
default: build | ||
|
||
fmt: lint | ||
@echo "✓ Formatting source code with goimports ..." | ||
@goimports -w $(shell find . -type f -name '*.go' -not -path "./vendor/*") | ||
@echo "✓ Formatting source code with gofmt ..." | ||
@gofmt -w $(shell find . -type f -name '*.go' -not -path "./vendor/*") | ||
|
||
lint: vendor | ||
@echo "✓ Linting source code with https://staticcheck.io/ ..." | ||
@staticcheck ./... | ||
|
||
test: | ||
@echo "✓ Running tests ..." | ||
@gotestsum --format pkgname-and-test-fails --no-summary=skipped --raw-command go test -v -json -short -coverprofile=coverage.txt ./... | ||
|
||
coverage: test | ||
@echo "✓ Opening coverage for unit tests ..." | ||
@go tool cover -html=coverage.txt | ||
|
||
vendor: | ||
@echo "✓ Filling vendor folder with library code ..." | ||
@go mod vendor | ||
|
||
.PHONY: build vendor coverage test lint fmt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
--- | ||
title: "Reverse dependabot" | ||
language: go | ||
author: "Serge Smertin" | ||
date: 2024-03-30 | ||
|
||
tags: | ||
- github | ||
- testing | ||
--- | ||
|
||
# Downstream dependency backwards compatibility enforcer | ||
|
||
|
||
- [Downstream dependency backwards compatibility enforcer](#downstream-dependency-backwards-compatibility-enforcer) | ||
- [Usage](#usage) | ||
- [Logs](#logs) | ||
- [Releasing](#releasing) | ||
|
||
Executes tests of a dependent project and provide a report | ||
|
||
## Usage | ||
|
||
Add to your `.github/workflows` folder: | ||
|
||
```yaml | ||
name: downstreams | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
merge_group: | ||
types: [checks_requested] | ||
push: | ||
# Always run on push to main. The build cache can only be reused | ||
# if it was saved by a run from the repository's default branch. | ||
# The run result will be identical to that from the merge queue | ||
# because the commit is identical, yet we need to perform it to | ||
# seed the build cache. | ||
branches: | ||
- main | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
ci: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
downstream: | ||
- name: ucx | ||
- name: lsql | ||
- name: remorph | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
cache: 'pip' | ||
cache-dependency-path: '**/pyproject.toml' | ||
python-version: 3.10 | ||
|
||
- name: Install toolchain | ||
run: | | ||
pip install hatch==1.9.4 | ||
- name: Acceptance | ||
uses: databrickslabs/sandbox/downstreams@downstreams/v0.0.1 | ||
with: | ||
repo: ${{ matrix.downstream.name }} | ||
org: databrickslabs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
``` | ||
## Logs | ||
If you use `github.com/databrickslabs/sandbox/go-libs/fixtures`, the logs would be available in `go-slog.json` artifact: | ||
|
||
```go | ||
import ( | ||
"testing" | ||
"github.com/databrickslabs/sandbox/go-libs/fixtures" | ||
) | ||
func TestShowDatabases(t *testing.T) { | ||
ctx, w := fixtures.WorkspaceTest(t) | ||
// ... | ||
} | ||
``` | ||
|
||
## Releasing | ||
|
||
As long as https://github.com/databrickslabs/sandbox is a monorepo, the `acceptance` action has to get a two-step release process: | ||
|
||
1. NodeJS shim - edit version file in `shim.js` to pick `v0.0.1` as version in the top of the file. | ||
2. Go module - `git tag acceptance/v0.0.1` and wait till https://github.com/databrickslabs/sandbox/actions/workflows/acceptance-release.yml is complete. | ||
|
||
Tag names must start with `acceptance/` in order for [acceptance-release](../.github/workflows/acceptance-release.yml) to trigger and this folder to be used as Go module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: 'Check downstream dependencies' | ||
description: 'Re-runs unit tests over downstream dependencies' | ||
author: Serge Smertin | ||
inputs: | ||
org: | ||
description: 'GitHub Organization' | ||
default: databrickslabs | ||
required: true | ||
repo: | ||
description: 'GitHub Repository' | ||
required: true | ||
|
||
runs: | ||
using: node20 | ||
main: shim.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module github.com/databrickslabs/sandbox/downstreams | ||
|
||
go 1.21.0 | ||
|
||
require github.com/databrickslabs/sandbox/acceptance v0.2.1 | ||
|
||
require ( | ||
cloud.google.com/go/compute v1.24.0 // indirect | ||
cloud.google.com/go/compute/metadata v0.2.3 // indirect | ||
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 // indirect | ||
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect | ||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.3.0 // indirect | ||
github.com/databricks/databricks-sdk-go v0.33.0 // indirect | ||
github.com/databrickslabs/sandbox/go-libs v0.2.0 // indirect | ||
github.com/felixge/httpsnoop v1.0.4 // indirect | ||
github.com/go-logr/logr v1.4.1 // indirect | ||
github.com/go-logr/stdr v1.2.2 // indirect | ||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect | ||
github.com/golang/protobuf v1.5.3 // indirect | ||
github.com/google/go-querystring v1.1.0 // indirect | ||
github.com/google/s2a-go v0.1.7 // indirect | ||
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect | ||
github.com/sethvargo/go-githubactions v1.2.0 // indirect | ||
go.opencensus.io v0.24.0 // indirect | ||
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect | ||
go.opentelemetry.io/otel v1.23.1 // indirect | ||
go.opentelemetry.io/otel/metric v1.23.1 // indirect | ||
go.opentelemetry.io/otel/trace v1.23.1 // indirect | ||
golang.org/x/crypto v0.19.0 // indirect | ||
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect | ||
golang.org/x/mod v0.15.0 // indirect | ||
golang.org/x/net v0.21.0 // indirect | ||
golang.org/x/oauth2 v0.17.0 // indirect | ||
golang.org/x/sys v0.17.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
golang.org/x/time v0.5.0 // indirect | ||
google.golang.org/api v0.166.0 // indirect | ||
google.golang.org/appengine v1.6.8 // indirect | ||
google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect | ||
google.golang.org/grpc v1.62.0 // indirect | ||
google.golang.org/protobuf v1.32.0 // indirect | ||
gopkg.in/ini.v1 v1.67.0 // indirect | ||
) |
Oops, something went wrong.