diff --git a/.changelog/172.txt b/.changelog/172.txt new file mode 100644 index 00000000..5a0e1171 --- /dev/null +++ b/.changelog/172.txt @@ -0,0 +1,3 @@ +```release-note:bug +darwin: Prevent possible runtime panic while reading process arguments. +``` diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index a05e7866..15dc345b 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -37,11 +37,11 @@ pipeline { axes { axis { name 'GO_VERSION' - values '1.18.10', '1.19.5' + values '1.20.4' } axis { name 'PLATFORM' - values 'ubuntu-18 && immutable', 'windows-2019 && immutable', 'orka && darwin && x86_64', 'orka && darwin && arm64' + values 'ubuntu-18 && immutable', 'orka && darwin && arm64' } axis { name 'CGO_ENABLED' @@ -51,22 +51,12 @@ pipeline { excludes { exclude { axis { - name 'GO_VERSION' - values '1.18.10' + name 'CGO_ENABLED' + values '1' } axis { name 'PLATFORM' - values 'orka && darwin && arm64' - } - } - exclude { - axis { - name 'GO_VERSION' - values '1.19.5' - } - axis { - name 'PLATFORM' - notValues 'orka && darwin && arm64' + values 'ubuntu-18 && immutable' } } } diff --git a/.ci/release/changelog.gotmpl b/.ci/release/changelog.gotmpl new file mode 100644 index 00000000..61f8f4f1 --- /dev/null +++ b/.ci/release/changelog.gotmpl @@ -0,0 +1,43 @@ +{{- if .NotesByType.note -}} +NOTES: +{{range .NotesByType.note -}} +* {{ template "note" .}} +{{ end -}} +{{- end -}} + +{{- if .NotesByType.deprecation -}} +DEPRECATIONS: +{{range .NotesByType.deprecation -}} +* {{ template "note" .}} +{{ end -}} +{{- end -}} + +{{- if index .NotesByType "breaking-change" -}} +BREAKING CHANGES: +{{range index .NotesByType "breaking-change" -}} +* {{ template "note" .}} +{{ end -}} +{{- end -}} + +{{- $features := combineTypes .NotesByType.feature (index .NotesByType "new-resource" ) (index .NotesByType "new-datasource") (index .NotesByType "new-data-source") -}} +{{- if $features }} +FEATURES: +{{range $features | sort -}} +* {{ template "note" . }} +{{ end -}} +{{- end -}} + +{{- $improvements := combineTypes .NotesByType.improvement .NotesByType.enhancement -}} +{{- if $improvements }} +IMPROVEMENTS: +{{range $improvements | sort -}} +* {{ template "note" . }} +{{ end -}} +{{- end -}} + +{{- if .NotesByType.bug }} +BUG FIXES: +{{range .NotesByType.bug -}} +* {{ template "note" . }} +{{ end -}} +{{- end -}} diff --git a/.ci/release/release-note.gotmpl b/.ci/release/release-note.gotmpl new file mode 100644 index 00000000..6310047c --- /dev/null +++ b/.ci/release/release-note.gotmpl @@ -0,0 +1,3 @@ +{{- define "note" -}} +{{if eq "new-resource" .Type}}**New Resource:** {{else if eq "new-datasource" .Type}}**New Data Source:** {{ end }}{{.Body}} ([GH-{{- .Issue -}}]) +{{- end -}} diff --git a/.ci/scripts/check-changelog.sh b/.ci/scripts/check-changelog.sh new file mode 100755 index 00000000..11e71e5b --- /dev/null +++ b/.ci/scripts/check-changelog.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +set -uo pipefail + +if [[ -z "${PR_NUMBER}" ]]; then + echo "PR_NUMBER must be set." + exit 1 +fi + +if [[ -z "${BASE_REF}" ]]; then + echo "BASE_REF must be set." + exit 1 +fi + +docs_url="https://github.com/GoogleCloudPlatform/magic-modules/blob/2834761fec3acbf35cacbffe100530f82eada650/.ci/RELEASE_NOTES_GUIDE.md#expected-format" + +# Version of https://github.com/hashicorp/go-changelog. +go_changelog_version=ba40b3a +go_changelog_check="go run github.com/hashicorp/go-changelog/cmd/changelog-check@${go_changelog_version}" + +expected_changelog_file=.changelog/${PR_NUMBER}.txt + +# Verify file is present. +if [ ! -e "${expected_changelog_file}" ]; then + echo "Changelog file missing at ${expected_changelog_file}. + +Please add a changelog entry following the format described [here](${docs_url}). + +If this change does not require a changelog entry then label the pull request +with skip-changelog. +" >> $GITHUB_STEP_SUMMARY + exit 1 +fi + +# Check the format. +if ! ${go_changelog_check} "${expected_changelog_file}"; then + echo "Changelog format is invalid. See build log." >> $GITHUB_STEP_SUMMARY + exit 1 +fi + +echo "Changelog is valid." >> $GITHUB_STEP_SUMMARY diff --git a/.ci/scripts/check-cross-compile.sh b/.ci/scripts/check-cross-compile.sh new file mode 100755 index 00000000..82de7c22 --- /dev/null +++ b/.ci/scripts/check-cross-compile.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -xeuo pipefail + +export CGO_ENABLED=0 + +# Test that there are no compilation issues when not using CGO. This does +# not imply that all of these targets are supported without CGO. It's only +# a sanity check for build tag issues. +GOOS=aix GOARCH=ppc64 go build ./... +GOOS=darwin GOARCH=amd64 go build ./... +GOOS=darwin GOARCH=arm64 go build ./... +GOOS=linux GOARCH=386 go build ./... +GOOS=linux GOARCH=amd64 go build ./... +GOOS=linux GOARCH=arm go build ./... +GOOS=linux GOARCH=arm64 go build ./... +GOOS=linux GOARCH=mips go build ./... +GOOS=linux GOARCH=mips64 go build ./... +GOOS=linux GOARCH=mips64le go build ./... +GOOS=linux GOARCH=mipsle go build ./... +GOOS=linux GOARCH=ppc64 go build ./... +GOOS=linux GOARCH=ppc64le go build ./... +GOOS=linux GOARCH=riscv64 go build ./... +GOOS=linux GOARCH=s390x go build ./... +GOOS=windows GOARCH=amd64 go build ./... +GOOS=windows GOARCH=arm go build ./... +GOOS=windows GOARCH=arm64 go build ./... diff --git a/.ci/scripts/check_format.go b/.ci/scripts/check_format.go deleted file mode 100644 index 5a234a10..00000000 --- a/.ci/scripts/check_format.go +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package main - -import ( - "flag" - "fmt" - "go/build" - "log" - "os" - "os/exec" - "path/filepath" - "strings" -) - -const localPkgs = "github.com/elastic/go-sysinfo" - -var defaultPaths = []string{"."} - -func main() { - log.SetFlags(0) - flag.Parse() - - paths := defaultPaths - if len(flag.Args()) > 0 { - paths = flag.Args() - } - - goGet := exec.Command("go", "install", "golang.org/x/tools/cmd/goimports@latest") - out, err := goGet.Output() - if err != nil { - log.Fatalf("failed to %v: %v", strings.Join(goGet.Args, " "), err) - } - - goimports := exec.Command(filepath.Join(build.Default.GOPATH, "bin", "goimports"), - append([]string{"-l", "-local", localPkgs}, paths...)...) - out, err = goimports.Output() - if err != nil { - log.Fatalf("failed to %v: %v", strings.Join(goimports.Args, " "), err) - } - if len(out) > 0 { - fmt.Fprintln(os.Stderr, "Run goimports on the code.") - fmt.Printf(string(out)) - os.Exit(1) - } -} diff --git a/.ci/scripts/check_lint.go b/.ci/scripts/check_lint.go deleted file mode 100644 index b2100491..00000000 --- a/.ci/scripts/check_lint.go +++ /dev/null @@ -1,80 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -package main - -import ( - "bufio" - "bytes" - "flag" - "fmt" - "log" - "os" - "os/exec" - "regexp" - "strings" -) - -var ignoreWarnings = []string{ - `don't use underscores in Go names`, - `don't use ALL_CAPS in Go names`, -} - -var ignoreWarningsRe = regexp.MustCompile(strings.Join(ignoreWarnings, "|")) - -func main() { - log.SetFlags(0) - flag.Parse() - - goGet := exec.Command("go", "install", "golang.org/x/lint/golint@latest") - out, err := goGet.Output() - if err != nil { - log.Fatalf("failed to %v: %v", strings.Join(goGet.Args, " "), err) - } - - golint := exec.Command("golint", flag.Args()...) - golint.Env = os.Environ() - golint.Env = append(golint.Env, "GOOS=windows") - out, err = golint.Output() - if err != nil { - log.Fatalf("failed to %v: %v", strings.Join(golint.Args, " "), err) - } - - out, err = filterIgnores(out) - if err != nil { - log.Fatal(err) - } - - if len(out) > 0 { - log.Println("There are golint warnings.") - fmt.Printf(string(out)) - os.Exit(1) - } -} - -func filterIgnores(out []byte) ([]byte, error) { - var buffer bytes.Buffer - s := bufio.NewScanner(bytes.NewReader(out)) - for s.Scan() { - if !ignoreWarningsRe.Match(s.Bytes()) { - buffer.Write(s.Bytes()) - buffer.WriteByte('\n') - } - } - - return buffer.Bytes(), s.Err() -} diff --git a/.ci/scripts/test.bat b/.ci/scripts/test.bat index 0df559f1..66dc5a9c 100755 --- a/.ci/scripts/test.bat +++ b/.ci/scripts/test.bat @@ -1,11 +1,5 @@ -go install github.com/elastic/go-licenser@latest go install gotest.tools/gotestsum@latest -go mod verify -go-licenser -d -go run .ci/scripts/check_format.go -go run .ci/scripts/check_lint.go - mkdir -p build SET OUT_FILE=build\output-report.out gotestsum --format testname --junitfile build\junit-%GO_VERSION%.xml -- ./... diff --git a/.ci/scripts/test.sh b/.ci/scripts/test.sh index 1fd009fd..a4e048a6 100755 --- a/.ci/scripts/test.sh +++ b/.ci/scripts/test.sh @@ -1,39 +1,8 @@ #!/usr/bin/env bash set -euxo pipefail -go install github.com/elastic/go-licenser@latest go install gotest.tools/gotestsum@latest -go mod verify -go-licenser -d -go run .ci/scripts/check_format.go -go run .ci/scripts/check_lint.go - -# Cross-compile checks (only execute on Linux to avoid running this multiple times). -if [[ $(go env GOOS) == "linux" ]]; then -# Test that there are no compilation issues when not using CGO. This does -# not imply that all of these targets are supported without CGO. It's only -# a sanity check for build tag issues. -CGO_ENABLED=0 GOOS=aix GOARCH=ppc64 go build ./... -CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build ./... -CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=386 go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=arm go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=mips go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=mips64 go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=mips64le go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=mipsle go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=ppc64 go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=riscv64 go build ./... -CGO_ENABLED=0 GOOS=linux GOARCH=s390x go build ./... -CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build ./... -CGO_ENABLED=0 GOOS=windows GOARCH=arm go build ./... -CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build ./... -fi - # Run the tests export OUT_FILE="build/test-report.out" mkdir -p build diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 00000000..9b1cc130 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,20 @@ +name: changelog + +on: + pull_request: + types: [opened, synchronize, labeled, unlabeled] + branches: + - main + +jobs: + check: + if: "!contains(github.event.pull_request.labels.*.name, 'skip-changelog')" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: changelog + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + BASE_REF: ${{ github.event.pull_request.base.ref }} + run: .ci/scripts/check-changelog.sh diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000..08cedc52 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,93 @@ +name: go + +on: + pull_request: + push: + branches: + - main + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v4 + with: + go-version: 1.20.x + + - name: go.mod tidy + run: go mod tidy && git diff --exit-code + + - name: license header + run: go run github.com/elastic/go-licenser@v0.4.1 -d + + - name: cross-compile + run: .ci/scripts/check-cross-compile.sh + + test: + needs: check + strategy: + matrix: + go: + - 1.20.x + - 1.18.x + os: + - macos-11 + - macos-12 + - macos-13 + - windows-2019 + - windows-2022 + - ubuntu-20.04 + - ubuntu-22.04 + cgo: + - cgo + - nocgo + exclude: + # Exclude cgo testing for platforms that don't use CGO. + - {cgo: cgo, os: windows-2019} + - {cgo: cgo, os: windows-2022} + - {cgo: cgo, os: ubuntu-20.04} + - {cgo: cgo, os: ubuntu-22.04} + # Limit the OS variants tested with the earliest supported Go version (save resources). + - {go: 1.18.10, os: macos-11} + - {go: 1.18.10, os: macos-12} + - {go: 1.18.10, os: windows-2019} + - {go: 1.18.10, os: ubuntu-22.04} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v4 + id: setup_go + with: + go-version: ${{ matrix.go }} + + - name: Set GO_VERSION + run: echo "GO_VERSION=${{ steps.setup_go.outputs.go-version }}" >> $GITHUB_ENV + + - name: Set CGO_ENABLED=1 + if: ${{ matrix.cgo }} == "cgo" + run: echo "CGO_ENABLED=1" >> $GITHUB_ENV + + - name: Set CGO_ENABLED=0 + if: ${{ matrix.cgo }} == "nocgo" + run: echo "CGO_ENABLED=0" >> $GITHUB_ENV + + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + if: github.event_name == 'pull_request' + with: + version: latest + only-new-issues: true + args: --timeout=3m + # Don't cache or restore ~/go/pkg. It conflicts with caching from setup-go@v4. + skip-pkg-cache: true + + - name: Test + if: runner.os != 'Windows' + run: .ci/scripts/test.sh + + - name: Test + if: runner.os == 'Windows' + run: .ci/scripts/test.bat diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..f0daa8dd --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: release + +on: + workflow_dispatch: + inputs: + version: + description: Tag name (e.g. v1.2.3) for this version (does not need to exist). + required: true + type: string + last_release: + description: Last release tag. + required: true + type: string + +permissions: + contents: read + +jobs: + draft: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + ref: main + fetch-depth: 0 # Need full history. + + - name: release notes + run: >- + go run github.com/hashicorp/go-changelog/cmd/changelog-build@ba40b3a + -changelog-template .ci/release/changelog.gotmpl + -entries-dir ./.changelog + -note-template .ci/release/release-note.gotmpl + -last-release "${{ inputs.last_release }}" + -this-release HEAD | tee /tmp/release-notes.txt + + - name: draft GH release + run: >- + gh release create "${{ inputs.version }}" + --draft + --notes-file /tmp/release-notes.txt + --title "${{ inputs.version }}" diff --git a/.golangci.yml b/.golangci.yml new file mode 100644 index 00000000..5c0e8616 --- /dev/null +++ b/.golangci.yml @@ -0,0 +1,16 @@ +--- + +run: + issues-exit-code: 1 + modules-download-mode: readonly + +linters: + disable-all: true + fast: false + enable: + - goimports + - revive + +linters-settings: + goimports: + local-prefixes: github.com/elastic/go-sysinfo diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index defde489..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,198 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -### Added - -### Changed - -### Deprecated - -### Removed - -### Fixed - -- Prevent possible runtime panic while reading process arguments on darwin. [#172](https://github.com/elastic/go-sysinfo/pull/172) - -## [1.10.1] - -### Added - -- Bump github.com/docker/docker from 20.10.24+incompatible to 23.0.3+incompatible [#163](https://github.com/elastic/go-sysinfo/pull/163) - -## [1.10.0] - -### Added - -- Add OS family mappings for `opensuse-leap` and `opensuse-tumbleweed`. [#146](https://github.com/elastic/go-sysinfo/pull/146) -- Add FQDN to host info. [#144](https://github.com/elastic/go-sysinfo/pull/144) -- Return FQDN and error via `FQDN()` method on `Host` interface. [#159](https://github.com/elastic/go-sysinfo/pull/159) -- Bump golang.org/x/net from 0.0.0-20220722155237-a158d28d115b to 0.7.0 [#153](https://github.com/elastic/go-sysinfo/pull/153) -- Bump github.com/docker/docker from 20.10.22+incompatible to 20.10.24+incompatible [#160](https://github.com/elastic/go-sysinfo/pull/160) - -### Changed - -- Requires Go 1.18+ [#144](https://github.com/elastic/go-sysinfo/pull/144) - -### Deprecated - -### Removed - -### Fixed - -- On darwin without CGO `process.Info()` could fail, but would not return the error. [#150](https://github.com/elastic/go-sysinfo/pull/150) - -## [1.9.0] - -### Added - -- Replace pkg/errors with Go 1.13 native errors. [#123](https://github.com/elastic/go-sysinfo/pull/123) -- Add OS family mappings for `rocky`, `openEuler`, and `almalinux`. [#143](https://github.com/elastic/go-sysinfo/pull/143) - -### Changed - -- Remove custom sysctl implementation and partial cgo requirement. [#135](https://github.com/elastic/go-sysinfo/pull/135) -- Changes on the `Host` and `LoadAverage` interfaces, now implemented by default on Linux and Darwin platforms. [#140](https://github.com/elastic/go-sysinfo/pull/140) - -## [1.8.1] - -### Fixed - -- Report OS name as Windows 11 when version is >= 10.0.22000. [#118](https://github.com/elastic/go-sysinfo/issues/118) [#121](https://github.com/elastic/go-sysinfo/pull/121) - -## [1.8.0] - -### Added - -- Added the Oracle Linux ("ol") platform to the "redhat" OS family. [#54](https://github.com/elastic/go-sysinfo/issues/54) [#115](https://github.com/elastic/go-sysinfo/pull/115) -- Added the Linux Mint ("linuxmint") platform to the "debian" OS family. [#52](https://github.com/elastic/go-sysinfo/issues/52) - -### Changed - -- Updated module to require Go 1.17. [#111](https://github.com/elastic/go-sysinfo/pull/111) -- The boot time value for Windows is now rounded to the nearest second to provide a more stable value. [#53](https://github.com/elastic/go-sysinfo/issues/53) [#114](https://github.com/elastic/go-sysinfo/pull/114) - -### Fixed - -- Fix handling of environment variables without values on macOS. [#94](https://github.com/elastic/go-sysinfo/pull/94) -- Fix build tags on AIX provider such that CGO is required. [#106](https://github.com/elastic/go-sysinfo/issues/106) - -## [1.7.1] - 2021-10-11 - -### Fixed - -- Fixed getting OS info when an unsupported file or directory is found matching /etc/\*-release [#102](https://github.com/elastic/go-sysinfo/pull/102) - -## [1.7.0] - 2021-02-22 - -### Added - -- Add per-process network stats [#96](https://github.com/elastic/go-sysinfo/pull/96) - -## [1.6.0] - 2021-02-09 - -### Added - -- Add darwin/arm64 support (Apple M1). [#91](https://github.com/elastic/go-sysinfo/pull/91) - -## [1.5.0] - 2021-01-14 - -### Added - -- Added os.type field to host info. [#87](https://github.com/elastic/go-sysinfo/pull/87) - -## [1.4.0] - 2020-07-21 - -### Added - -- Add AIX support [#77](https://github.com/elastic/go-sysinfo/pull/77) -- Added detection of containerized cgroup in Kubernetes [#80](https://github.com/elastic/go-sysinfo/pull/80) - -## [1.3.0] - 2020-01-13 - -### Changed - -- Convert NetworkCountersInfo maps to uint64 [#75](https://github.com/elastic/go-sysinfo/pull/75) - -## [1.2.1] - 2020-01-03 - -### Fixed - -- Create a `sidToString` function to deal with API changes in various versions of golang.org/x/sys/windows. [#74](https://github.com/elastic/go-sysinfo/pull/74) - -## [1.2.0] - 2019-12-09 - -### Added - -- Added detection of systemd cgroups to the `IsContainerized` check. [#71](https://github.com/elastic/go-sysinfo/pull/71) -- Added networking counters for Linux hosts. [#72](https://github.com/elastic/go-sysinfo/pull/72) - -## [1.1.1] - 2019-10-29 - -### Fixed - -- Fixed an issue determining the Linux distribution for Fedora 30. [#69](https://github.com/elastic/go-sysinfo/pull/69) - -## [1.1.0] - 2019-08-22 - -### Added - -- Add `VMStat` interface for Linux. [#59](https://github.com/elastic/go-sysinfo/pull/59) - -## [1.0.2] - 2019-07-09 - -### Fixed - -- Fixed a leak when calling the CommandLineToArgv function. [#51](https://github.com/elastic/go-sysinfo/pull/51) -- Fixed a crash when calling the CommandLineToArgv function. [#58](https://github.com/elastic/go-sysinfo/pull/58) - -## [1.0.1] - 2019-05-08 - -### Fixed - -- Add support for new prometheus/procfs API. [#49](https://github.com/elastic/go-sysinfo/pull/49) - -## [1.0.0] - 2019-05-03 - -### Added - -- Add Windows provider implementation. [#22](https://github.com/elastic/go-sysinfo/pull/22) -- Add Windows process provider. [#26](https://github.com/elastic/go-sysinfo/pull/26) -- Add `OpenHandleEnumerator` and `OpenHandleCount` and implement these for Windows. [#27](https://github.com/elastic/go-sysinfo/pull/27) -- Add user info to Process. [#34](https://github.com/elastic/go-sysinfo/pull/34) -- Implement `Processes` for Darwin. [#35](https://github.com/elastic/go-sysinfo/pull/35) -- Add `Parent()` to `Process`. [#46](https://github.com/elastic/go-sysinfo/pull/46) - -### Fixed - -- Fix Windows registry handle leak. [#33](https://github.com/elastic/go-sysinfo/pull/33) -- Fix Linux host ID by search for older locations for the machine-id file. [#44](https://github.com/elastic/go-sysinfo/pull/44) - -### Changed - -- Changed the host containerized check to reduce false positives. [#42](https://github.com/elastic/go-sysinfo/pull/42) [#43](https://github.com/elastic/go-sysinfo/pull/43) - -[Unreleased]: https://github.com/elastic/go-sysinfo/compare/v1.10.1...HEAD -[1.10.1]: https://github.com/elastic/go-sysinfo/releases/tag/v1.10.1 -[1.10.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.10.0 -[1.9.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.9.0 -[1.8.1]: https://github.com/elastic/go-sysinfo/releases/tag/v1.8.1 -[1.8.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.8.0 -[1.7.1]: https://github.com/elastic/go-sysinfo/releases/tag/v1.7.1 -[1.7.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.7.0 -[1.6.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.6.0 -[1.5.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.5.0 -[1.4.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.4.0 -[1.3.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.3.0 -[1.2.1]: https://github.com/elastic/go-sysinfo/releases/tag/v1.2.1 -[1.2.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.2.0 -[1.1.1]: https://github.com/elastic/go-sysinfo/releases/tag/v1.1.0 -[1.1.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.1.0 -[1.0.2]: https://github.com/elastic/go-sysinfo/releases/tag/v1.0.2 -[1.0.1]: https://github.com/elastic/go-sysinfo/releases/tag/v1.0.1 -[1.0.0]: https://github.com/elastic/go-sysinfo/releases/tag/v1.0.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..c206aa31 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# Contributing + +Pull requests are welcomed. You must + +- Sign the Elastic [Contributor License Agreement](https://www.elastic.co/contributor-agreement). +- Include a [changelog][changelog_docs] entry at `.changelog/{pr-number}.txt` with your pull request. +- Include tests that demonstrate the change is working. + +[changelog_docs]: https://github.com/GoogleCloudPlatform/magic-modules/blob/2834761fec3acbf35cacbffe100530f82eada650/.ci/RELEASE_NOTES_GUIDE.md#expected-format + +## Releasing + +To create a new release use the release workflow in GitHub actions. This will create a new draft +release in GitHub releases with a changelog. After the job completes, review the draft and if +everything is correct, publish the release. When the release is published GitHub will create the +git tag. diff --git a/README.md b/README.md index 409432cd..881bdccc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # go-sysinfo [![Build Status](https://beats-ci.elastic.co/job/Library/job/go-sysinfo-mbp/job/main/badge/icon)](https://beats-ci.elastic.co/job/Library/job/go-sysinfo-mbp/job/main/) +![Github Workflow](https://github.com/elastic/go-sysinfo/actions/workflows/go.yml/badge.svg) [![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godocs] [godocs]: http://godoc.org/github.com/elastic/go-sysinfo