Skip to content

Commit

Permalink
Merge branch 'main' into add-logs-scraper-in-factory
Browse files Browse the repository at this point in the history
  • Loading branch information
sincejune authored Dec 27, 2024
2 parents 3d31da9 + 46a808b commit 3dbb083
Show file tree
Hide file tree
Showing 137 changed files with 445 additions and 397 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/api-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ on:
branches:
- main

permissions:
contents: read
permissions: read-all

jobs:
Check-Compatibility:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build-and-test-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ env:
# We limit cache download as a whole to 5 minutes.
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2

permissions:
contents: read
permissions: read-all

# Do not cancel this workflow on main. See https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/16616
concurrency:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build-and-test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions:
contents: read
permissions: read-all

jobs:
windows-unittest:
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:
types: [checks_requested]
pull_request:

permissions:
contents: read
permissions: read-all

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
Expand Down Expand Up @@ -169,7 +168,12 @@ jobs:
key: unittest-${{ runner.os }}-${{ matrix.runner }}-go-build-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
- name: Run Unit Tests
run: |
make -j4 gotest
make -j4 gotest-with-junit
- uses: actions/upload-artifact@v4
with:
name: test-results-${{ runner.os }}-${{ matrix.runner }}-${{ matrix.go-version }}
path: internal/tools/testresults/
retention-days: 4
unittest:
if: always()
runs-on: ubuntu-latest
Expand Down Expand Up @@ -214,7 +218,7 @@ jobs:
- name: Run Unit Tests With Coverage
run: make gotest-with-cover
- name: Upload coverage report
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # 5.1.1
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # 5.1.2
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/builder-integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ on:

# manual execution
workflow_dispatch:

merge_group:
types: [checks_requested]

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions:
contents: read
permissions: read-all

jobs:
integration-test:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions:
contents: read
permissions: read-all

jobs:
changelog:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/check-links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions:
contents: read
permissions: read-all

jobs:
changedfiles:
Expand Down
13 changes: 12 additions & 1 deletion .github/workflows/check-merge-freeze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,22 @@ name: Merge freeze

on:
pull_request:
types: [opened, ready_for_review, synchronize, reopened, labeled, unlabeled, enqueued]
types:
[
opened,
ready_for_review,
synchronize,
reopened,
labeled,
unlabeled,
enqueued,
]
branches: [main]
merge_group:
types: [checks_requested]

permissions: read-all

jobs:
check-merge-freeze:
name: Check
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions:
contents: read
permissions: read-all

jobs:
CodeQL-Build:
Expand All @@ -30,12 +29,12 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/init@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
languages: go

- name: Autobuild
uses: github/codeql-action/autobuild@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/autobuild@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/analyze@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
3 changes: 1 addition & 2 deletions .github/workflows/contrib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions:
contents: read
permissions: read-all

jobs:
contrib-tests-matrix:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/generate-semantic-conventions-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ on:
- cron: "30 1 * * *"
workflow_dispatch:

permissions:
contents: read
permissions: read-all

jobs:
check-versions:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/milestone-add-to-pr.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# This action adds the "next release" milestone to a pull request
# when it is merged

name: 'Project: Add PR to Milestone'
name: "Project: Add PR to Milestone"
on:
pull_request_target:
types:
- closed

permissions: read-all

jobs:
update-pr:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
push:
branches: [main]

permissions:
contents: read
permissions: read-all

jobs:
runperf:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
uses: github/codeql-action/upload-sarif@48ab28a6f5dbc2a99bf1e0131198dd8f1df78169 # v3.28.0
with:
sarif_file: results.sarif
7 changes: 3 additions & 4 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: Shellcheck lint
on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
merge_group:
types: [checks_requested]

permissions:
contents: read
permissions: read-all

jobs:
shellcheck:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/stale-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,20 @@ on:
schedule:
- cron: "12 3 * * *" # arbitrary time not to DDOS GitHub

permissions:
contents: read
permissions: read-all

jobs:
stale:
permissions:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-latest
steps:
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-pr-message: 'This PR was marked stale due to lack of activity. It will be closed in 14 days.'
close-pr-message: 'Closed as inactive. Feel free to reopen if this PR is still being worked on.'
stale-pr-message: "This PR was marked stale due to lack of activity. It will be closed in 14 days."
close-pr-message: "Closed as inactive. Feel free to reopen if this PR is still being worked on."
days-before-pr-stale: 14
days-before-issue-stale: 730
days-before-pr-close: 14
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/tidy-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ on:
branches:
- main

permissions:
contents: read
permissions: read-all

jobs:
setup-environment:
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ gotest-with-cover:
@$(MAKE) for-all-target TARGET="test-with-cover"
$(GOCMD) tool covdata textfmt -i=./coverage/unit -o ./coverage.txt

.PHONY: gotest-with-junit
gotest-with-junit:
@$(MAKE) for-all-target TARGET="test-with-junit"

.PHONY: gotestifylint-fix
gotestifylint-fix:
$(MAKE) for-all-target TARGET="testifylint-fix"
Expand Down
9 changes: 9 additions & 0 deletions Makefile.Common
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ALL_PKGS := $(sort $(shell go list ./...))
# COVER_PKGS is the list of packages to include in the coverage
COVER_PKGS := $(shell go list ./... | tr "\n" ",")

CURR_MOD := $(shell go list -m | tr '/' '-' )

GOTEST_TIMEOUT?=240s
GOTEST_OPT?= -race -timeout $(GOTEST_TIMEOUT)
GOCMD?= go
Expand All @@ -19,6 +21,8 @@ TOOLS_MOD_REGEX := "\s+_\s+\".*\""
TOOLS_PKG_NAMES := $(shell grep -E $(TOOLS_MOD_REGEX) < $(TOOLS_MOD_DIR)/tools.go | tr -d " _\"" | grep -vE '/v[0-9]+$$')
TOOLS_BIN_NAMES := $(addprefix $(TOOLS_BIN_DIR)/, $(notdir $(shell echo $(TOOLS_PKG_NAMES))))
CHLOGGEN_CONFIG := .chloggen/config.yaml
# no trailing slash
JUNIT_OUT_DIR ?= $(TOOLS_MOD_DIR)/testresults

ADDLICENSE := $(TOOLS_BIN_DIR)/addlicense
APIDIFF := $(TOOLS_BIN_DIR)/apidiff
Expand Down Expand Up @@ -56,6 +60,11 @@ test-with-cover: $(GOTESTSUM)
mkdir -p $(PWD)/coverage/unit
$(GOTESTSUM) --packages="./..." -- $(GOTEST_OPT) -cover -covermode=atomic -coverpkg $(COVER_PKGS) -args -test.gocoverdir="$(PWD)/coverage/unit"

.PHONY: test-with-junit
test-with-junit: $(GOTESTSUM)
mkdir -p $(JUNIT_OUT_DIR)
$(GOTESTSUM) --packages="./..." --junitfile $(JUNIT_OUT_DIR)/$(CURR_MOD)-junit.xml -- $(GOTEST_OPT) ./...

.PHONY: benchmark
benchmark: $(GOTESTSUM)
$(GOTESTSUM) --packages="$(ALL_PKGS)" -- -bench=. -run=notests ./... | tee benchmark.txt
Expand Down
4 changes: 2 additions & 2 deletions client/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ require (
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/grpc v1.69.0 // indirect
google.golang.org/protobuf v1.36.0 // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down
8 changes: 4 additions & 4 deletions client/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/mdatagen/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ require (
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/grpc v1.69.0 // indirect
google.golang.org/protobuf v1.36.0 // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/mdatagen/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/otelcorecol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ require (
gonum.org/v1/gonum v0.15.1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect
google.golang.org/grpc v1.69.0 // indirect
google.golang.org/protobuf v1.36.0 // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down
8 changes: 4 additions & 4 deletions cmd/otelcorecol/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions component/componentstatus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ require (
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect
google.golang.org/grpc v1.69.0 // indirect
google.golang.org/protobuf v1.36.0 // indirect
google.golang.org/grpc v1.69.2 // indirect
google.golang.org/protobuf v1.36.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

Expand Down
Loading

0 comments on commit 3dbb083

Please sign in to comment.