Skip to content

Commit

Permalink
Add 'pkg/stanza/' from commit 'c912ec5cdb776ada95f4f06fd97d1e315f07fe14'
Browse files Browse the repository at this point in the history
git-subtree-dir: pkg/stanza
git-subtree-mainline: 03b33c3
git-subtree-split: c912ec5
  • Loading branch information
djaglowski committed May 11, 2022
2 parents 03b33c3 + c912ec5 commit 1ecbef4
Show file tree
Hide file tree
Showing 491 changed files with 46,331 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/stanza/.github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#####################################################
#
# List of approvers for OpenTelemetry Log Collection
#
#####################################################
#
# Learn about membership in OpenTelemetry community:
# https://github.com/open-telemetry/community/blob/main/community-membership.md
#
#
# Learn about CODEOWNERS file format:
# https://help.github.com/en/articles/about-code-owners
#

* @open-telemetry/log-collection-approvers
24 changes: 24 additions & 0 deletions pkg/stanza/.github/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
codecov:
require_ci_to_pass: yes

ignore:
- "internal/tools/*"

coverage:
precision: 1
round: down
range: "70...100"
status:
project:
default:
target: auto
threshold: 0.5%
patch:
default:
target: 50%
threshold: 0%

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: yes
10 changes: 10 additions & 0 deletions pkg/stanza/.github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "gomod"
directory: "/internal/tools"
schedule:
interval: "weekly"
50 changes: 50 additions & 0 deletions pkg/stanza/.github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Run CodeCov
on:
push:
branches:
- main
pull_request:
env:
# Path to where test results will be saved.
TEST_RESULTS: /tmp/test-results
# Default minimum version of Go to support.
DEFAULT_GO_VERSION: 1.17
jobs:
test-coverage:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/[email protected]
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Environment
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: Module cache
uses: actions/[email protected]
env:
cache-name: go-mod-cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }}
- name: Run coverage tests
run: |
make test-coverage
mkdir $TEST_RESULTS
cp coverage.out $TEST_RESULTS
cp coverage.txt $TEST_RESULTS
cp coverage.html $TEST_RESULTS
- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
file: ./coverage.txt
fail_ci_if_error: false
verbose: true
- name: Store coverage test output
uses: actions/upload-artifact@v2
with:
name: opentelemetry-log-collection-test-output
path: ${{ env.TEST_RESULTS }}
37 changes: 37 additions & 0 deletions pkg/stanza/.github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: "CodeQL Analysis"
on:
workflow_dispatch:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * *'

pull_request:
branches: [ main ]

jobs:
CodeQL-Build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: go

- name: Autobuild
uses: github/codeql-action/autobuild@v1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
23 changes: 23 additions & 0 deletions pkg/stanza/.github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: contrib-tests
on:
push:
branches: [ main ]
tags:
- v[0-9]+.[0-9]+.[0-9]+.*
pull_request:

jobs:
contrib_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Run Contrib Tests
run: |
contrib_path=/tmp/opentelemetry-collector-contrib
git clone https://github.com/open-telemetry/opentelemetry-collector-contrib.git $contrib_path
./check-contrib.sh
30 changes: 30 additions & 0 deletions pkg/stanza/.github/workflows/gosec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Run Gosec
on:
workflow_dispatch:
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# │ │ │ │ │
# │ │ │ │ │
# * * * * *
- cron: '30 1 * * *'
pull_request:
branches: [ main ]

jobs:
tests:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v2

- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: './...'
146 changes: 146 additions & 0 deletions pkg/stanza/.github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Go

on:
push:
branches: [ main ]
pull_request:

jobs:

lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Cache Go Modules
uses: actions/cache@v2
env:
cache-name: cache-go-modules
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }}
- name: Install tools
if: steps.tool-cache.outputs.cache-hit != 'true'
run: make install-tools
- name: Add Permissions to Tool Binaries
run: chmod -R +x ~/go/bin
- name: Check
run: make ci-check

test-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Cache Go Modules
uses: actions/cache@v2
env:
cache-name: cache-go-modules
with:
path: ~/go/bin
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }}
- name: Run Unit Tests
run: make test

test-macos:
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Cache Go Modules
uses: actions/cache@v2
env:
cache-name: cache-go-modules
with:
path: ~/go/bin
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }}
- name: Run Unit Tests
run: make test

test-windows:
runs-on: windows-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.17
- name: Cache Go Modules
uses: actions/cache@v2
env:
cache-name: cache-go-modules
with:
path: /Users/runneradmin/go/pkg/mod
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }}
- name: Run Unit Tests
run: make test

bench-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Cache Go Modules
uses: actions/cache@v2
env:
cache-name: cache-go-modules
with:
path: ~/go/bin
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }}
- name: Run Benchmarks
run: make bench

bench-macos:
runs-on: macos-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Cache Go Modules
uses: actions/cache@v2
env:
cache-name: cache-go-modules
with:
path: ~/go/bin
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }}
- name: Run Benchmarks
run: make bench

bench-windows:
runs-on: windows-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.17
- name: Cache Go Modules
uses: actions/cache@v2
env:
cache-name: cache-go-modules
with:
path: /Users/runneradmin/go/pkg/mod
key: ${{ runner.os }}-${{ hashFiles('**/go.mod') }}
- name: Run Benchmarks
run: make bench
13 changes: 13 additions & 0 deletions pkg/stanza/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dev/*
.DS_Store
tmp/*
local/*
**/coverage.txt
**/coverage.html
artifacts/*
.vscode/*
gen/
.idea/*
coverage.out
coverage.out.bak
coverage.txt.bak
37 changes: 37 additions & 0 deletions pkg/stanza/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
run:
issues-exit-code: 1
tests: true
skip-dirs:
skip-dirs-use-default: false
skip-files:
linters:
disable:
- errcheck
enable:
- gofmt
- gci
- bodyclose
- goconst
- gocritic
- misspell
- nakedret
- prealloc
- unconvert
- unparam
- whitespace
- ineffassign
linters-settings:
gci:
local-prefixes: github.com/open-telemetry/opentelemetry-log-collection
goconst:
min-occurrences: 5
revive:
# minimal confidence for issues, default is 0.8
min-confidence: 0.8
issues:
exclude-rules:
- path: operator/builtin/input/windows/xml\.go
linters:
- unused
- deadcode
Loading

0 comments on commit 1ecbef4

Please sign in to comment.