Skip to content

Commit

Permalink
Update workflows (#626)
Browse files Browse the repository at this point in the history
A few updates to the ecctl github workflows/actions:

- Removed Team:Delivery labels as they are not relevant anymore
- Remove on_master_generation.yml workflow: This used to update the NOTICE and push it to master. Instead, the PR verification now checks that NOTICE is up-to-date so this workflow is not needed.
- Move to go-licence-detector for NOTICE generation, since go-licenser doesn't generate the NOTICE anymore in newer versions.
  • Loading branch information
gigerdo committed Oct 27, 2023
1 parent d9ad9d1 commit cf7edbe
Show file tree
Hide file tree
Showing 10 changed files with 6,395 additions and 98 deletions.
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/BUG_REPORT.md
@@ -1,7 +1,6 @@
---
name: Bug Report
about: Create a report to help us improve.
labels: Team:Delivery

---
<!--- Thank you for taking the time to create a Bug Report! -->
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/FEATURE_REQUEST.md
@@ -1,7 +1,6 @@
---
name: Feature Request
about: Suggest an idea for this project.
labels: Team:Delivery

---
<!--- Thank you for taking the time to open a Feature Request -->
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/GENERIC_QUESTION.md
@@ -1,7 +1,6 @@
---
name: Generic Question
about: Not a Bug Report or a Feature Request? Ask a question.
labels: Team:Delivery

---
<!--- Thank you for taking the time to ask us a question! -->
Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/RELEASE_CHECKLIST.md
@@ -1,7 +1,6 @@
---
name: Release Checklist
about: Items to be completed in every release.
labels: Team:Delivery

---

Expand All @@ -14,9 +13,8 @@ labels: Team:Delivery
The following actions must be performed in the order specified here.
For detailed instructions on all of the steps, read the release [documentation](https://github.com/elastic/ecctl/blob/master/developer_docs/RELEASE.md).

- [ ] Verify a cloud-sdk-go release with the same version has been made.
- [ ] Update the cloud-sdk-go dependency.
- [ ] Update `VERSION` environment variable in the Makefile and generate changelog.
- [ ] Check that the `VERSION` environment variable in the Makefile is updated and generate changelog.
- [ ] Execute the release.
- [ ] Modify the conf.yaml file in the docs repository to add the release branch.
- [ ] Run a full doc rebuild.
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/go.yml
Expand Up @@ -36,6 +36,17 @@ jobs:
run: make docs
id: docs

- name: Ensure formatting caused no changes
run: |
if [[ ! -z "$(git status --untracked-files=no --porcelain)" ]]; then
echo "There are modified files:"
git status --untracked-files=no --porcelain
exit 1
else
exit 0
fi
- name: Run unit tests
run: make unit
id: unit

31 changes: 0 additions & 31 deletions .github/workflows/on_master_generation.yml

This file was deleted.

6,395 changes: 6,340 additions & 55 deletions NOTICE

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions build/Makefile.deps
Expand Up @@ -4,13 +4,14 @@ OS:=$(shell uname -s | tr '[:upper:]' '[:lower:]')
ARCH:=$(shell $(PWD)/scripts/uname_arch.sh)
VERSION_DIR:=$(GOBIN)/versions

VERSION_GOLICENSER:=v0.3.0
VERSION_GOLICENSER:=v0.4.1
VERSION_GOLICENCEDETECTOR:=v0.6.0
VERSION_GOLANGCILINT:=v1.54.2
VERSION_GOBINDATA:=v0.0.0-20190711162640-ee3c2418e368
VERSION_GORELEASER:=v1.21.2
VERSION_VERSIONBUMP:=v1.1.0

deps: $(GOBIN)/go-licenser $(GOBIN)/golangci-lint $(GOBIN)/go-bindata
deps: $(GOBIN)/go-licenser $(GOBIN)/go-licence-detector $(GOBIN)/golangci-lint $(GOBIN)/go-bindata

$(GOBIN):
@ mkdir -p $(GOBIN)
Expand All @@ -26,6 +27,14 @@ $(GOBIN)/go-licenser: $(VERSION_DIR)/.version-go-licenser-$(VERSION_GOLICENSER)
@ echo "-> Installing go-licenser..."
@ go install github.com/elastic/go-licenser@$(VERSION_GOLICENSER)

$(VERSION_DIR)/.version-go-licence-detector-$(VERSION_GOLICENCEDETECTOR): | $(VERSION_DIR)
@ rm -f $(VERSION_DIR)/.version-go-licence-detector-*
@ echo $(VERSION_GOLICENCEDETECTOR) > $(VERSION_DIR)/.version-go-licence-detector-$(VERSION_GOLICENCEDETECTOR)

$(GOBIN)/go-licence-detector: $(VERSION_DIR)/.version-go-licence-detector-$(VERSION_GOLICENCEDETECTOR) | $(GOBIN)
@ echo "-> Installing go-licence-detector..."
@ go install go.elastic.co/go-licence-detector@$(VERSION_GOLICENCEDETECTOR)

$(VERSION_DIR)/.version-golangci-lint-$(VERSION_GOLANGCILINT): | $(VERSION_DIR)
@ rm -f $(VERSION_DIR)/.version-golangci-lint-*
@ echo $(VERSION_GOLANGCILINT) > $(VERSION_DIR)/.version-golangci-lint-$(VERSION_GOLANGCILINT)
Expand Down
7 changes: 3 additions & 4 deletions build/Makefile.dev
Expand Up @@ -49,13 +49,12 @@ format: deps
## Generates the notice file
.PHONY: notice
notice:
@ $(GOBIN)/go-licenser -license ASL2 -notice -notice-year 2019 .
@ go list -m -json all | $(GOBIN)/go-licence-detector -noticeOut=NOTICE -noticeTemplate build/NOTICE.tmpl -includeIndirect

## Checks if there's any format violations on the Go files.
## Checks if there's any format violations on the Go files.
.PHONY: lint
lint: deps
@ echo "-> Running linters..."
@ go vet
@ $(GOBIN)/golangci-lint run --deadline=5m
@ $(GOBIN)/go-licenser -d .
@ echo "-> Done."
Expand All @@ -71,7 +70,7 @@ docs:
@ ./scripts/generate-docs.sh
@ $(MAKE) check-changes

## Removes all temporary files and artifacts.
## Removes all temporary files and artifacts.
.PHONY: clean
clean:
@ rm -rf vendor reports pkg dist pprof-* trace-*
Expand Down
29 changes: 29 additions & 0 deletions build/NOTICE.tmpl
@@ -0,0 +1,29 @@
{{- define "depInfo" -}}
{{- range $i, $dep := . }}
Dependency : {{ $dep.Name }}
Version: {{ $dep.Version }}
Licence type (autodetected): {{ $dep.LicenceType }}

{{ $dep | licenceText }}

{{ "-" | line }}
{{ end }}
{{- end -}}

ecctl
Copyright 2019-{{ currentYear }} Elasticsearch B.V.

This product includes software developed at Elasticsearch B.V. and
third-party software developed by the licenses listed below.

{{ "=" | line }}
Third party libraries used by the Elastic ecctl project:
{{ "=" | line }}
{{ template "depInfo" .Direct }}

{{ if .Indirect }}
{{ "=" | line }}
Indirect dependencies
{{ "=" | line }}
{{ template "depInfo" .Indirect -}}
{{- end}}

0 comments on commit cf7edbe

Please sign in to comment.