forked from open-telemetry/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into no-bail-on-error
- Loading branch information
Showing
1,289 changed files
with
38,470 additions
and
22,261 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
.github/workflows/scripts/check-collector-module-version.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright The OpenTelemetry Authors | ||
|
||
# Licensed 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. | ||
|
||
# | ||
# verifies if the collector components are using the main core collector version | ||
# as a dependency. | ||
# | ||
set -eu -o pipefail | ||
|
||
# Return the collector main core version | ||
get_collector_version() { | ||
collector_module="$1" | ||
main_mod_file="$2" | ||
|
||
if grep -q "$collector_module" "$main_mod_file"; then | ||
grep "$collector_module" "$main_mod_file" | (read mod version; | ||
echo $version) | ||
else | ||
echo "Error: failed to retrieve the \"$collector_module\" version from \"$main_mod_file\"." | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Compare the collector main core version against all the collector component | ||
# modules to verify that they are using this version as its dependency | ||
check_collector_versions_correct() { | ||
collector_module="$1" | ||
collector_mod_version="$2" | ||
incorrect_version=0 | ||
mod_files=$(find . -type f -name "go.mod") | ||
|
||
# Loop through all the module files, checking the collector version | ||
for mod_file in $mod_files; do | ||
if grep -q "$collector_module" "$mod_file"; then | ||
mod_line=$(grep "$collector_module" "$mod_file") | ||
version=$(echo "$mod_line" | cut -d" " -f2) | ||
|
||
# To account for a module on its own 'require' line, | ||
# the version field is shifted right by 1 | ||
if [ "$version" == "$collector_module" ]; then | ||
version=$(echo "$mod_line" | cut -d" " -f3) | ||
fi | ||
|
||
if [ "$version" != "$collector_mod_version" ]; then | ||
incorrect_version=$((incorrect_version+1)) | ||
echo "Incorrect version \"$version\" of \"$collector_module\" is included in \"$mod_file\". It should be version \"$collector_mod_version\"." | ||
fi | ||
fi | ||
done | ||
|
||
echo "There are $incorrect_version incorrect \"$collector_module\" version(s) in the module files." | ||
if [ "$incorrect_version" -gt 0 ]; then | ||
exit 1 | ||
fi | ||
} | ||
|
||
# Note space at end of string. This is so it filters for the exact string | ||
# only and does not return string which contains this string as a substring. | ||
COLLECTOR_MODULE="go.opentelemetry.io/collector " | ||
|
||
COLLECTOR_MODEL_MODULE="go.opentelemetry.io/collector/model" | ||
MAIN_MOD_FILE="./go.mod" | ||
COLLECTOR_MOD_VERSION=$(get_collector_version "$COLLECTOR_MODULE" "$MAIN_MOD_FILE") | ||
|
||
# Check the collector module version in each of the module files | ||
check_collector_versions_correct "$COLLECTOR_MODULE" "$COLLECTOR_MOD_VERSION" | ||
|
||
# Check the collector model module version in each of the module files | ||
check_collector_versions_correct "$COLLECTOR_MODEL_MODULE" "$COLLECTOR_MOD_VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function Install-SQLServer2019 { | ||
Write-Host "Downloading SQL Server 2019..." | ||
$Path = $env:TEMP | ||
$Installer = "SQL2019-SSEI-Dev.exe" | ||
$URL = "https://go.microsoft.com/fwlink/?linkid=866662" | ||
Invoke-WebRequest $URL -OutFile $Path\$Installer | ||
|
||
Write-Host "Installing SQL Server..." | ||
Start-Process -FilePath $Path\$Installer -Args "/ACTION=INSTALL /IACCEPTSQLSERVERLICENSETERMS /QUIET" -Verb RunAs -Wait | ||
Remove-Item $Path\$Installer | ||
} | ||
|
||
Install-SQLServer2019 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.