From 232d84da85e7fda621c719107257f3bcdab7accd Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Wed, 12 Nov 2025 16:15:58 +0530 Subject: [PATCH 1/5] added renovate bot for otel updates --- renovate.json | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 000000000..6f5a485bb --- /dev/null +++ b/renovate.json @@ -0,0 +1,52 @@ +{ + "extends": ["config:base"], + "regexManagers": [ + { + "description": "Update Sumo Logic container images in values.yaml (repository/tag pattern)", + "fileMatch": ["^deploy/helm/sumologic/values\\.yaml$"], + "matchStrings": [ + "repository:\\s*\"?(?public\\.ecr\\.aws/sumologic/[^\"\\s]+)\"?\\s*\\n[\\s\\S]*?tag:\\s*\"?(?[^\"\\s]+)\"?" + ], + "datasourceTemplate": "docker", + "versioningTemplate": "loose" + }, + { + "description": "Update Sumo Logic container images in test files", + "fileMatch": ["^tests/helm/testdata/goldenfile/.*\\.yaml$"], + "matchStrings": [ + "image:\\s*\"?(?public\\.ecr\\.aws/sumologic/sumologic-otel-collector):(?[a-zA-Z0-9._-]+)\"?" + ], + "datasourceTemplate": "docker", + "versioningTemplate": "loose" + }, + { + "description": "Update version references in documentation tables", + "fileMatch": ["^deploy/helm/sumologic/README\\.md$"], + "matchStrings": [ + "\\|\\s*`(sumologic\\.otelcolImage\\.tag|opentelemetry-operator\\.manager\\.collectorImage\\.tag)`\\s*\\|.*?\\|\\s*`(?[0-9.]+(?:-[a-z0-9-]+)?)`\\s*\\|" + ], + "datasourceTemplate": "docker", + "depNameTemplate": "public.ecr.aws/sumologic/sumologic-otel-collector", + "versioningTemplate": "loose" + }, + { + "description": "Update OpenTelemetry Collector version in docs README table", + "fileMatch": ["^docs/README\\.md$"], + "matchStrings": [ + "\\|\\s*OpenTelemetry Collector\\s*\\|\\s*(?[0-9.]+(?:-[a-z0-9-]+)?)\\s*\\|" + ], + "datasourceTemplate": "docker", + "depNameTemplate": "public.ecr.aws/sumologic/sumologic-otel-collector", + "versioningTemplate": "loose" + } + ], + "packageRules": [ + { + "description": "Group OpenTelemetry Collector updates together", + "matchDatasources": ["docker"], + "matchPackagePatterns": ["^public\\.ecr\\.aws/sumologic/sumologic-otel-collector$"], + "groupName": "sumologic-otel-collector", + "separateMinorPatch": false + } + ] +} \ No newline at end of file From 2e48077b998a85127ad59f51c347f0a345262bfd Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Thu, 13 Nov 2025 01:40:53 +0530 Subject: [PATCH 2/5] update the pattern --- renovate.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/renovate.json b/renovate.json index 6f5a485bb..501809b7a 100644 --- a/renovate.json +++ b/renovate.json @@ -1,16 +1,18 @@ { - "extends": ["config:base"], - "regexManagers": [ + "extends": ["config:recommended"], + "customManagers": [ { + "customType": "regex", "description": "Update Sumo Logic container images in values.yaml (repository/tag pattern)", "fileMatch": ["^deploy/helm/sumologic/values\\.yaml$"], "matchStrings": [ - "repository:\\s*\"?(?public\\.ecr\\.aws/sumologic/[^\"\\s]+)\"?\\s*\\n[\\s\\S]*?tag:\\s*\"?(?[^\"\\s]+)\"?" + "repository:\\s*\"?(?public\\.ecr\\.aws/sumologic/sumologic-otel-collector)\"?\\s*\\n\\s*tag:\\s*\"?(?[^\"\\s]+)\"?" ], "datasourceTemplate": "docker", "versioningTemplate": "loose" }, { + "customType": "regex", "description": "Update Sumo Logic container images in test files", "fileMatch": ["^tests/helm/testdata/goldenfile/.*\\.yaml$"], "matchStrings": [ @@ -20,6 +22,7 @@ "versioningTemplate": "loose" }, { + "customType": "regex", "description": "Update version references in documentation tables", "fileMatch": ["^deploy/helm/sumologic/README\\.md$"], "matchStrings": [ @@ -30,6 +33,7 @@ "versioningTemplate": "loose" }, { + "customType": "regex", "description": "Update OpenTelemetry Collector version in docs README table", "fileMatch": ["^docs/README\\.md$"], "matchStrings": [ @@ -44,7 +48,7 @@ { "description": "Group OpenTelemetry Collector updates together", "matchDatasources": ["docker"], - "matchPackagePatterns": ["^public\\.ecr\\.aws/sumologic/sumologic-otel-collector$"], + "matchPackageNames": ["public.ecr.aws/sumologic/sumologic-otel-collector"], "groupName": "sumologic-otel-collector", "separateMinorPatch": false } From 8879d23560eb4c02079cf9a7f1afb2616eabbf9d Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Thu, 13 Nov 2025 16:27:23 +0530 Subject: [PATCH 3/5] updated the versioningTemplate --- renovate.json | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/renovate.json b/renovate.json index 501809b7a..534a9a588 100644 --- a/renovate.json +++ b/renovate.json @@ -1,5 +1,5 @@ { - "extends": ["config:recommended"], + "enabledManagers": ["custom.regex"], "customManagers": [ { "customType": "regex", @@ -9,7 +9,7 @@ "repository:\\s*\"?(?public\\.ecr\\.aws/sumologic/sumologic-otel-collector)\"?\\s*\\n\\s*tag:\\s*\"?(?[^\"\\s]+)\"?" ], "datasourceTemplate": "docker", - "versioningTemplate": "loose" + "versioningTemplate": "regex:^(?0)\\.(?[0-9]+)\\.(?[0-9]+)-sumo-(?[0-9]+)$" }, { "customType": "regex", @@ -19,7 +19,7 @@ "image:\\s*\"?(?public\\.ecr\\.aws/sumologic/sumologic-otel-collector):(?[a-zA-Z0-9._-]+)\"?" ], "datasourceTemplate": "docker", - "versioningTemplate": "loose" + "versioningTemplate": "regex:^(?0)\\.(?[0-9]+)\\.(?[0-9]+)-sumo-(?[0-9]+)$" }, { "customType": "regex", @@ -30,18 +30,19 @@ ], "datasourceTemplate": "docker", "depNameTemplate": "public.ecr.aws/sumologic/sumologic-otel-collector", - "versioningTemplate": "loose" + "versioningTemplate": "regex:^(?0)\\.(?[0-9]+)\\.(?[0-9]+)-sumo-(?[0-9]+)$" }, { "customType": "regex", "description": "Update OpenTelemetry Collector version in docs README table", "fileMatch": ["^docs/README\\.md$"], "matchStrings": [ - "\\|\\s*OpenTelemetry Collector\\s*\\|\\s*(?[0-9.]+(?:-[a-z0-9-]+)?)\\s*\\|" + "\\|\\s*OpenTelemetry Collector\\s*\\|\\s*(?[0-9]+\\.[0-9]+\\.[0-9]+)\\s*\\|" ], "datasourceTemplate": "docker", "depNameTemplate": "public.ecr.aws/sumologic/sumologic-otel-collector", - "versioningTemplate": "loose" + "versioningTemplate": "loose", + "extractVersionTemplate": "^(?[0-9]+\\.[0-9]+\\.[0-9]+)" } ], "packageRules": [ @@ -50,7 +51,8 @@ "matchDatasources": ["docker"], "matchPackageNames": ["public.ecr.aws/sumologic/sumologic-otel-collector"], "groupName": "sumologic-otel-collector", - "separateMinorPatch": false + "separateMinorPatch": false, + "allowedVersions": "/^0\\.[0-9]+\\.[0-9]+(\\-sumo\\-[0-9]+)?$/" } ] } \ No newline at end of file From 08f4f17b3604918a64d781cc164e0f2aa901b53d Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Fri, 14 Nov 2025 16:59:53 +0530 Subject: [PATCH 4/5] added changelog action --- .github/workflows/renovate-changelog.yaml | 61 +++++++++++++++++++++++ renovate.json | 4 +- 2 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/renovate-changelog.yaml diff --git a/.github/workflows/renovate-changelog.yaml b/.github/workflows/renovate-changelog.yaml new file mode 100644 index 000000000..c6c50eaea --- /dev/null +++ b/.github/workflows/renovate-changelog.yaml @@ -0,0 +1,61 @@ +name: Add Changelog Entry for Renovate PRs + +on: + pull_request: + types: [opened, synchronize] + branches: + - main + +jobs: + add-changelog: + if: startsWith(github.head_ref, 'renovate/sumologic-kubernetes-collection') + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.head_ref }} + + - name: Create changelog entry + run: | + # Create PR-based filename + PR_NUMBER="${{ github.event.pull_request.number }}" + CHANGELOG_FILE=".changelog/${PR_NUMBER}.changed.txt" + + # Ensure .changelog directory exists + mkdir -p .changelog + + # Extract version information from git diff + OLD_VERSION="" + NEW_VERSION="" + + # Check for version changes in values.yaml + if git diff HEAD~1 HEAD -- deploy/helm/sumologic/values.yaml | grep -E "tag.*sumo-"; then + OLD_VERSION=$(git diff HEAD~1 HEAD -- deploy/helm/sumologic/values.yaml | grep -E "^\-.*tag:" | head -1 | sed 's/.*tag: *["'"'"']*\([^"'"'"' ]*\)["'"'"']*.*/\1/' | grep "sumo-" || echo "") + NEW_VERSION=$(git diff HEAD~1 HEAD -- deploy/helm/sumologic/values.yaml | grep -E "^\+.*tag:" | head -1 | sed 's/.*tag: *["'"'"']*\([^"'"'"' ]*\)["'"'"']*.*/\1/' | grep "sumo-" || echo "") + fi + + # Create changelog message + if [[ -n "$OLD_VERSION" && -n "$NEW_VERSION" ]]; then + CHANGELOG_TEXT="Upgraded otel collector version from $OLD_VERSION to $NEW_VERSION" + else + CHANGELOG_TEXT="chore(deps): Update dependencies" + fi + + echo "$CHANGELOG_TEXT" > "$CHANGELOG_FILE" + echo "Created changelog file: $CHANGELOG_FILE with content: $CHANGELOG_TEXT" + + - name: Commit changelog + run: | + # Configure git + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + # Add and commit changelog + git add .changelog/ + git commit -m "chore: Add changelog entry for dependency update" + git push origin ${{ github.head_ref }} \ No newline at end of file diff --git a/renovate.json b/renovate.json index 534a9a588..12cc49d3d 100644 --- a/renovate.json +++ b/renovate.json @@ -50,9 +50,9 @@ "description": "Group OpenTelemetry Collector updates together", "matchDatasources": ["docker"], "matchPackageNames": ["public.ecr.aws/sumologic/sumologic-otel-collector"], - "groupName": "sumologic-otel-collector", + "groupName": "sumologic-kubernetes-collection", "separateMinorPatch": false, "allowedVersions": "/^0\\.[0-9]+\\.[0-9]+(\\-sumo\\-[0-9]+)?$/" } ] -} \ No newline at end of file +} From 31c26111a0b40947475967eeb03976dea2891b0a Mon Sep 17 00:00:00 2001 From: Himanshu Singh Date: Fri, 14 Nov 2025 19:34:34 +0530 Subject: [PATCH 5/5] fix: Format renovate-changelog.yaml with Prettier --- .github/workflows/renovate-changelog.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/renovate-changelog.yaml b/.github/workflows/renovate-changelog.yaml index c6c50eaea..61bc6c02d 100644 --- a/.github/workflows/renovate-changelog.yaml +++ b/.github/workflows/renovate-changelog.yaml @@ -25,27 +25,27 @@ jobs: # Create PR-based filename PR_NUMBER="${{ github.event.pull_request.number }}" CHANGELOG_FILE=".changelog/${PR_NUMBER}.changed.txt" - + # Ensure .changelog directory exists mkdir -p .changelog - + # Extract version information from git diff OLD_VERSION="" NEW_VERSION="" - + # Check for version changes in values.yaml if git diff HEAD~1 HEAD -- deploy/helm/sumologic/values.yaml | grep -E "tag.*sumo-"; then OLD_VERSION=$(git diff HEAD~1 HEAD -- deploy/helm/sumologic/values.yaml | grep -E "^\-.*tag:" | head -1 | sed 's/.*tag: *["'"'"']*\([^"'"'"' ]*\)["'"'"']*.*/\1/' | grep "sumo-" || echo "") NEW_VERSION=$(git diff HEAD~1 HEAD -- deploy/helm/sumologic/values.yaml | grep -E "^\+.*tag:" | head -1 | sed 's/.*tag: *["'"'"']*\([^"'"'"' ]*\)["'"'"']*.*/\1/' | grep "sumo-" || echo "") fi - + # Create changelog message if [[ -n "$OLD_VERSION" && -n "$NEW_VERSION" ]]; then CHANGELOG_TEXT="Upgraded otel collector version from $OLD_VERSION to $NEW_VERSION" else CHANGELOG_TEXT="chore(deps): Update dependencies" fi - + echo "$CHANGELOG_TEXT" > "$CHANGELOG_FILE" echo "Created changelog file: $CHANGELOG_FILE with content: $CHANGELOG_TEXT" @@ -54,8 +54,8 @@ jobs: # Configure git git config --local user.email "action@github.com" git config --local user.name "GitHub Action" - + # Add and commit changelog git add .changelog/ git commit -m "chore: Add changelog entry for dependency update" - git push origin ${{ github.head_ref }} \ No newline at end of file + git push origin ${{ github.head_ref }}