Skip to content

Commit 7d3a7a2

Browse files
Merge branch 'main' into copilot/fix-10063
2 parents 321a246 + 710c49f commit 7d3a7a2

33 files changed

+3567
-1852
lines changed

.ci/scripts/update-otel.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ else
5252
fi
5353
elastic-agent-changelog-tool new "$changelog_fragment_name"
5454
sed -i.bak "s/^kind:.*$/kind: enhancement/" ./changelog/fragments/*-"${changelog_fragment_name}".yaml
55-
sed -i.bak "s/^summary:.*$/summary: Update OTel components to ${next_contrib}/" ./changelog/fragments/*-"${changelog_fragment_name}".yaml
55+
sed -i.bak "s/^summary:.*$/summary: Update OTel Collector components to ${next_contrib}/" ./changelog/fragments/*-"${changelog_fragment_name}".yaml
5656
sed -i.bak "s/^component:.*$/component: elastic-agent/" ./changelog/fragments/*-"${changelog_fragment_name}".yaml
5757
rm ./changelog/fragments/*-"${changelog_fragment_name}".yaml.bak

.github/workflows/update-docs.yml

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@ jobs:
1717
steps:
1818
- name: Checkout repository
1919
uses: actions/checkout@v5
20+
with:
21+
fetch-depth: 0 # Fetch all history including tags
22+
23+
- name: Add upstream remote and fetch tags
24+
run: |
25+
git remote add upstream https://github.com/elastic/elastic-agent.git || true
26+
git fetch upstream --tags
27+
28+
- name: Find latest semantic version
29+
id: get_version
30+
run: |
31+
# Get the latest semantic version tag (excluding pre-release versions)
32+
LATEST_VERSION=$(git tag --list | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$" | sort -V | tail -1)
33+
echo "Latest version: $LATEST_VERSION"
34+
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT
35+
36+
- name: Pass version to script
37+
run: |
38+
echo "LATEST_VERSION=${{ steps.get_version.outputs.version }}" >> $GITHUB_ENV
2039
2140
- name: Set up Python
2241
uses: actions/setup-python@v6
@@ -34,23 +53,49 @@ jobs:
3453
cd docs/scripts/update-docs
3554
python update-components-docs.py
3655
56+
- name: Check if branch already exists
57+
id: check_branch
58+
run: |
59+
BRANCH_NAME="update-docs-${{ steps.get_version.outputs.version }}"
60+
if git ls-remote --heads origin "$BRANCH_NAME" | grep -q "$BRANCH_NAME"; then
61+
echo "Branch $BRANCH_NAME already exists. Documentation for this version has already been updated."
62+
echo "branch_exists=true" >> $GITHUB_OUTPUT
63+
else
64+
echo "Branch $BRANCH_NAME does not exist. Proceeding with PR creation."
65+
echo "branch_exists=false" >> $GITHUB_OUTPUT
66+
fi
67+
3768
- name: Create Pull Request
69+
if: steps.check_branch.outputs.branch_exists == 'false'
3870
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
3971
with:
4072
token: ${{ secrets.GITHUB_TOKEN }}
41-
commit-message: "docs: update generated documentation"
42-
title: "Update generated documentation"
73+
commit-message: "docs: update generated documentation for ${{ steps.get_version.outputs.version }}"
74+
title: "Update generated documentation for ${{ steps.get_version.outputs.version }}"
4375
body: |
44-
This PR updates the generated documentation based on the latest local repository data.
76+
This PR updates the generated documentation based on the latest released version **${{ steps.get_version.outputs.version }}**.
4577
78+
## Changes
4679
- Updates EDOT Collector component tables
4780
- Updates OpenTelemetry Collector Builder (OCB) configuration
48-
- Uses local version from version.go file
81+
- Uses data from the latest released version tag: `${{ steps.get_version.outputs.version }}`
82+
83+
## References
84+
- **Source go.mod**: https://github.com/elastic/elastic-agent/blob/${{ steps.get_version.outputs.version }}/go.mod
85+
- **Source core-components.yaml**: https://github.com/elastic/elastic-agent/blob/${{ steps.get_version.outputs.version }}/internal/pkg/otel/core-components.yaml
86+
- **Release tag**: https://github.com/elastic/elastic-agent/tree/${{ steps.get_version.outputs.version }}
4987
5088
This is an automated PR created by the documentation update workflow.
51-
branch: update-docs
89+
branch: update-docs-${{ steps.get_version.outputs.version }}
5290
base: main
5391
delete-branch: true
5492
labels: |
5593
documentation
5694
automated-pr
95+
96+
- name: Skip PR creation (branch exists)
97+
if: steps.check_branch.outputs.branch_exists == 'true'
98+
run: |
99+
echo "✅ Documentation for version ${{ steps.get_version.outputs.version }} has already been updated."
100+
echo "Branch update-docs-${{ steps.get_version.outputs.version }} already exists."
101+
echo "Workflow completed successfully - no action needed."

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ linters:
5959
- github.com/google/gopacket
6060
- github.com/insomniacslk/dhcp
6161
- github.com/meraki/dashboard-api-go/v3
62+
- go.opentelemetry.io/otel/exporters/prometheus
6263
replace-local: false
6364
gomodguard:
6465
blocked:

.package-version

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"version": "9.2.0-SNAPSHOT",
3-
"build_id": "9.2.0-5054ab8b",
4-
"manifest_url": "https://snapshots.elastic.co/9.2.0-5054ab8b/manifest-9.2.0-SNAPSHOT.json",
5-
"summary_url": "https://snapshots.elastic.co/9.2.0-5054ab8b/summary-9.2.0-SNAPSHOT.html",
3+
"build_id": "9.2.0-0c7b0ff4",
4+
"manifest_url": "https://snapshots.elastic.co/9.2.0-0c7b0ff4/manifest-9.2.0-SNAPSHOT.json",
5+
"summary_url": "https://snapshots.elastic.co/9.2.0-0c7b0ff4/summary-9.2.0-SNAPSHOT.html",
66
"core_version": "9.2.0",
7-
"stack_build_id": "9.2.0-5054ab8b-SNAPSHOT"
7+
"stack_build_id": "9.2.0-0c7b0ff4-SNAPSHOT"
88
}

0 commit comments

Comments
 (0)