Skip to content

Commit

Permalink
Added boilerplate automation (#74)
Browse files Browse the repository at this point in the history
Signed-off-by: Yuvraj <evalsocket@gmail.com>
  • Loading branch information
yindia committed May 29, 2021
1 parent 514375f commit 852d7ab
Show file tree
Hide file tree
Showing 23 changed files with 1,387 additions and 605 deletions.
36 changes: 36 additions & 0 deletions flytectl/.github/workflows/boilerplate-automation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update Boilerplate Automation
on:
workflow_dispatch:

jobs:
update-boilerplate:
name: Update Boilerplate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: "0"
- name: Update Boilerplate
run: |
make update_boilerplate
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.FLYTE_BOT_PAT }}
commit-message: Update Boilerplate
committer: Flyte-Bot <admin@flyte.org>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: true
branch: flyte-bot-update-boilerplate
delete-branch: true
title: 'Update Boilerplate'
body: |
Update Boilerplate
- Auto-generated by [flyte-bot]
labels: |
boilerplate
team-reviewers: |
owners
maintainers
draft: false
4 changes: 2 additions & 2 deletions flytectl/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY:
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

run:
skip-dirs:
Expand Down
3 changes: 2 additions & 1 deletion flytectl/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export REPOSITORY=flytectl
include boilerplate/lyft/golang_test_targets/Makefile
include boilerplate/flyte/golang_test_targets/Makefile

GIT_VERSION := $(shell git describe --always --tags)
GIT_HASH := $(shell git rev-parse --short HEAD)
Expand All @@ -25,6 +25,7 @@ compile_debug:

.PHONY: update_boilerplate
update_boilerplate:
@curl https://raw.githubusercontent.com/flyteorg/boilerplate/master/boilerplate/update.sh -o boilerplate/update.sh
@boilerplate/update.sh

.PHONY: install-piptools
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/lyft/boilerplate
module github.com/flyteorg/boilerplate

go 1.13
go 1.16

require (
github.com/alvaroloes/enumer v1.1.2
github.com/golangci/golangci-lint v1.22.2
github.com/lyft/flytestdlib v0.2.31
github.com/flyteorg/flytestdlib v0.3.22
github.com/golangci/golangci-lint v1.38.0
github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5
)

Expand Down
1,267 changes: 1,267 additions & 0 deletions flytectl/boilerplate/flyte/golang_support_tools/go.sum

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package tools

import (
_ "github.com/alvaroloes/enumer"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/flyteorg/flytestdlib/cli/pflags"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
_ "github.com/vektra/mockery/cmd/mockery"
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY:
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst


.PHONY: download_tooling
download_tooling: #download dependencies (including test deps) for the package
@boilerplate/lyft/golang_test_targets/download_tooling.sh
@boilerplate/flyte/golang_test_targets/download_tooling.sh

.PHONY: lint
lint: download_tooling #lints the package for common code smells
Expand All @@ -16,7 +16,7 @@ lint: download_tooling #lints the package for common code smells
# skips 'vendor'
.PHONY: goimports
goimports:
@boilerplate/lyft/golang_test_targets/goimports
@boilerplate/flyte/golang_test_targets/goimports

.PHONY: mod_download
mod_download: #download dependencies (including test deps) for the package
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ Provides a ``test_benchmark`` target for benchmark tests.

**To Enable:**

Add ``lyft/golang_test_targets`` to your ``boilerplate/update.cfg`` file.
Add ``flyteorg/golang_test_targets`` to your ``boilerplate/update.cfg`` file.

Make sure you're using ``go mod`` for dependency management.

Provide a ``.golangci`` configuration (the lint target requires it).

Add ``include boilerplate/lyft/golang_test_targets/Makefile`` in your main ``Makefile`` _after_ your REPOSITORY environment variable
Add ``include boilerplate/flyte/golang_test_targets/Makefile`` in your main ``Makefile`` _after_ your REPOSITORY environment variable

::

REPOSITORY=<myreponame>
include boilerplate/lyft/golang_test_targets/Makefile
include boilerplate/flyte/golang_test_targets/Makefile

(this ensures the extra make targets get included in your main Makefile)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# pins. To facilitate this, we're maintaining two sets of go.mod/sum files - the second one only for tooling. This is
# the same approach that go 1.14 will take as well.
# See:
# https://github.com/lyft/flyte/issues/129
# https://github.com/flyteorg/flyte/issues/129
# https://github.com/golang/go/issues/30515 for some background context
# https://github.com/go-modules-by-example/index/blob/5ec250b4b78114a55001bd7c9cb88f6e07270ea5/010_tools/README.md

Expand All @@ -24,7 +24,7 @@ tools=(

tmp_dir=$(mktemp -d -t gotooling-XXX)
echo "Using temp directory ${tmp_dir}"
cp -R boilerplate/lyft/golang_support_tools/* $tmp_dir
cp -R boilerplate/flyte/golang_support_tools/* $tmp_dir
pushd "$tmp_dir"

for tool in "${tools[@]}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/usr/bin/env bash

# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY:
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./pkg/client/*")
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY:
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

run:
skip-dirs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Provides a ``.golangci`` file with the linters we've agreed upon.

**To Enable:**

Add ``lyft/golangci_file`` to your ``boilerplate/update.cfg`` file.
Add ``flyteorg/golangci_file`` to your ``boilerplate/update.cfg`` file.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash

# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY:
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

set -e

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Provides a Pull Request template.

**To Enable:**

Add ``lyft/golang_test_targets`` to your ``boilerplate/update.cfg`` file.
Add ``flyteorg/golang_test_targets`` to your ``boilerplate/update.cfg`` file.
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Read then delete

- Make sure to use a concise title for the pull-request.
- Use #patch, #minor or #major in the pull-request title to bump the corresponding version. Otherwise, the patch version
will be bumped. [More details](https://github.com/marketplace/actions/github-tag-bump)

# TL;DR
_Please replace this text with a description of what this PR accomplishes._

Expand All @@ -18,9 +24,9 @@ _Please replace this text with a description of what this PR accomplishes._
_How did you fix the bug, make the feature etc. Link to any design docs etc_

## Tracking Issue
https://github.com/lyft/flyte/issues/<number>
https://github.com/flyteorg/flyte/issues/<number>

## Follow-up issue
_NA_
OR
_https://github.com/lyft/flyte/issues/<number>_
_https://github.com/flyteorg/flyte/issues/<number>_
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash

# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY:
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

set -e

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/usr/bin/env bash

# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY:
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

# Clone the config.yml file
echo " - copying ${DIR}/config.yml to the root directory."
cp ${DIR}/config.yml ${DIR}/../../.github/config.yml
cp "${DIR}"/config.yml "${DIR}"/../../../.github/config.yml
Loading

0 comments on commit 852d7ab

Please sign in to comment.