Skip to content

Commit

Permalink
build: commit generated code files (#449)
Browse files Browse the repository at this point in the history
* build: commit generated code files

Keeping these files in the repository will help with vendoring
and should make the package "go get"-able.

* build: ignore generated files in code coverage

* build: add "make validate-generated" target

This should ensure go-bindata files are kept up to date.

* fix: replace script with simpler git commands

* fix: revise git diff command for generated file check
  • Loading branch information
mboersma authored and tariq1890 committed Feb 8, 2019
1 parent 8ffcc12 commit 2591593
Show file tree
Hide file tree
Showing 10 changed files with 4,461 additions and 8 deletions.
6 changes: 4 additions & 2 deletions .codecov/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ coverage:
precision: 2
round: down
range: "50...100"

status:
project:
default:
Expand All @@ -27,4 +26,7 @@ parsers:
comment:
layout: "header, diff"
behavior: default
require_changes: no
require_changes: no

ignore:
- "**/*_generated.go"
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ _dist/
bin/
.env
.coverprofile
coverage.txt

test/junit/
test/aks-engine-test/aks-engine-test.exe
pkg/operations/junit.xml
pkg/operations/kubernetesupgrade/junit.xml
pkg/engine/templates.go
pkg/i18n/translations.go

_logs/
test/aks-engine-test/report/TestReport.json
Expand Down
3 changes: 3 additions & 0 deletions .pipelines/pr-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
- script: make validate-copyright-headers test-style
displayName: Run linting rules
workingDirectory: $(modulePath)
- script: make validate-generated
displayName: Check if generated code is up to date
workingDirectory: $(modulePath)
- script: make validate-dependencies
displayName: Check if imports, Gopkg.toml, and Gopkg.lock are in sync
workingDirectory: $(modulePath)
Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ test: generate
test-style:
@scripts/validate-go.sh

.PHONY: validate-generated
validate-generated: generate
@echo "==> Checking generated files <=="
! git diff --name-only pkg/ | grep _generated.go

.PHONY: test-e2e
test-e2e:
@test/e2e.sh
Expand Down
4 changes: 2 additions & 2 deletions pkg/engine/fileloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package engine

//go:generate go-bindata -nometadata -pkg $GOPACKAGE -prefix ../../parts/ -o templates.go ../../parts/...
//go:generate gofmt -s -l -w templates.go
//go:generate go-bindata -nometadata -pkg $GOPACKAGE -prefix ../../parts/ -o templates_generated.go ../../parts/...
//go:generate gofmt -s -l -w templates_generated.go
// fileloader use go-bindata (https://github.com/go-bindata/go-bindata)
// go-bindata is the way we handle embedded files, like binary, template, etc.
3,257 changes: 3,257 additions & 0 deletions pkg/engine/templates_generated.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/i18n/resourceloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

package i18n

//go:generate go-bindata -nometadata -pkg $GOPACKAGE -prefix ../../ -o translations.go ../../translations/...
//go:generate gofmt -s -l -w translations.go
//go:generate go-bindata -nometadata -pkg $GOPACKAGE -prefix ../../ -o translations_generated.go ../../translations/...
//go:generate gofmt -s -l -w translations_generated.go
// resourceloader use go-bindata (https://github.com/go-bindata/go-bindata)
// go-bindata is the way we handle embedded files, like binary, template, etc.
1,187 changes: 1,187 additions & 0 deletions pkg/i18n/translations_generated.go

Large diffs are not rendered by default.

Empty file modified scripts/convert-lcg-lcl.sh
100644 → 100755
Empty file.
Empty file modified scripts/update-enus-po.sh
100644 → 100755
Empty file.

0 comments on commit 2591593

Please sign in to comment.