Skip to content

ci(ff): support feature freeze automation#13138

Closed
v1v wants to merge 10 commits into
elastic:mainfrom
v1v:feature/release-scripts-for-ff
Closed

ci(ff): support feature freeze automation#13138
v1v wants to merge 10 commits into
elastic:mainfrom
v1v:feature/release-scripts-for-ff

Conversation

@v1v

@v1v v1v commented Mar 12, 2026

Copy link
Copy Markdown
Member

What does this PR do?

This PR migrates the elastic-agent release automation from Makefile-based scripts to a pure Go implementation using Mage, eliminating all external tool dependencies.

✨ Key Features

  • 8 Mage Commands for complete release workflow automation
  • Pure Go Implementation - no external CLI tools (hub, gh, sed, yq, Python)
  • DRY_RUN Mode - safe testing without pushing changes or creating branches
  • Comprehensive Testing - 60%+ test coverage with unit tests
  • Detailed Documentation - both quick reference and comprehensive guides

Why is it important?

Move away from centralised approach but support the FF automation as part of #12711

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

How to test this PR locally

export PROJECT_OWNER="your-user"
export CURRENT_RELEASE="9.5.0-test"
export GITHUB_TOKEN=$(gh auth token)
export DRY_RUN=true

# Dry run first
mage release:runMajorMinor

# Review changes
git diff

# Run for real on your fork
export DRY_RUN=false
mage release:runMajorMinor

Related issues

Questions to ask yourself

  • How are we going to support this in production?
  • How are we going to measure its adoption?
  • How are we going to debug this?
  • What are the metrics I should take care of?
  • ...

@v1v v1v self-assigned this Mar 12, 2026
@v1v v1v added skip-changelog skip-ci backport-active-all Automated backport with mergify to all the active branches labels Mar 12, 2026
@v1v v1v changed the title Feature/release scripts for ff ci(ff): support feature freeze automation Mar 12, 2026
@v1v

v1v commented Mar 12, 2026

Copy link
Copy Markdown
Member Author

@copilot review the errors in the linting

  Error: dev-tools/mage/release/git_test.go:256:14: Error return value of `os.WriteFile` is not checked (errcheck)
  	os.WriteFile(testFile, []byte("test"), 0644)
  	            ^
  Error: dev-tools/mage/release/release_test.go:42:16: Error return value of `os.Chdir` is not checked (errcheck)
  	defer os.Chdir(originalWd)
  	              ^
  Error: dev-tools/mage/release/release_test.go:43:10: Error return value of `os.Chdir` is not checked (errcheck)
  	os.Chdir(tmpDir)
  	        ^
  Error: dev-tools/mage/release/release_test.go:130:16: Error return value of `os.Chdir` is not checked (errcheck)
  	defer os.Chdir(originalWd)
  	              ^
  Error: dev-tools/mage/release/release_test.go:131:10: Error return value of `os.Chdir` is not checked (errcheck)
  	os.Chdir(tmpDir)
  	        ^
  Error: dev-tools/mage/release/release_test.go:217:16: Error return value of `os.Chdir` is not checked (errcheck)
  	defer os.Chdir(originalWd)
  	              ^
  Error: dev-tools/mage/release/release_test.go:218:10: Error return value of `os.Chdir` is not checked (errcheck)
  	os.Chdir(tmpDir)
  	        ^
  Error: dev-tools/mage/release/release_test.go:314:16: Error return value of `os.Chdir` is not checked (errcheck)
  	defer os.Chdir(originalWd)
  	              ^
  Error: dev-tools/mage/release/release_test.go:315:10: Error return value of `os.Chdir` is not checked (errcheck)
  	os.Chdir(tmpDir)
  	        ^
  Error: dev-tools/mage/release/release_test.go:473:16: Error return value of `os.Chdir` is not checked (errcheck)
  	defer os.Chdir(originalWd)
  	              ^
  Error: dev-tools/mage/release/release_test.go:474:10: Error return value of `os.Chdir` is not checked (errcheck)
  	os.Chdir(tmpDir)
  	        ^
  Error: dev-tools/mage/release/git.go:101:19: comparing with != will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
  	if err != nil && err != git.NoErrAlreadyUpToDate {
  	                 ^
  Error: dev-tools/mage/release/git.go:105:5: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
  	if err == git.NoErrAlreadyUpToDate {
  	   ^
  Error: dev-tools/mage/release/git.go:130:5: comparing with == will fail on wrapped errors. Use errors.Is to check for a specific error (errorlint)
  	if err == git.ErrRemoteNotFound {
  	   ^
  Error: dev-tools/mage/release/github.go:113:19: type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint)
  		if ghErr, ok := err.(*github.ErrorResponse); ok && ghErr.Response.StatusCode == 404 {
  		                ^
  Error: dev-tools/mage/release/github.go:56:24: SA1019: github.String is deprecated: use Ptr instead. (staticcheck)
  		Title:               github.String(opts.Title),
  		                     ^
  Error: dev-tools/mage/release/github.go:57:24: SA1019: github.String is deprecated: use Ptr instead. (staticcheck)
  		Head:                github.String(opts.Head),
  		                     ^
  Error: dev-tools/mage/release/github.go:58:24: SA1019: github.String is deprecated: use Ptr instead. (staticcheck)
  		Base:                github.String(opts.Base),
  		                     ^
  Error: dev-tools/mage/release/github.go:59:24: SA1019: github.String is deprecated: use Ptr instead. (staticcheck)
  		Body:                github.String(opts.Body),
  		                     ^
  Error: dev-tools/mage/release/github.go:60:24: SA1019: github.Bool is deprecated: use Ptr instead. (staticcheck)
  		MaintainerCanModify: github.Bool(opts.Maintainers),
  		                     ^
  Error: dev-tools/mage/release/github.go:61:24: SA1019: github.Bool is deprecated: use Ptr instead. (staticcheck)
  		Draft:               github.Bool(opts.Draft),
  		                     ^

@mergify

mergify Bot commented Mar 13, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/release-scripts-for-ff upstream/feature/release-scripts-for-ff
git merge upstream/main
git push upstream feature/release-scripts-for-ff

@v1v

v1v commented Mar 23, 2026

Copy link
Copy Markdown
Member Author

Minor

export PROJECT_OWNER="v1v"
export CURRENT_RELEASE="9.5.0"
export GITHUB_TOKEN=$(gh auth token)
export DRY_RUN=true

# Dry run first
mage release:runMajorMinor
🔍 DRY RUN MODE - No changes will be pushed or branches created remotely

=== Starting Major/Minor Release Workflow for 9.5.0 ===

Step 1: Preparing release files...
=== Preparing Major/Minor Release 9.5.0 ===
✓ Updated version to 9.5.0 in version/version.go
✓ Updated version to 9.5.0 in deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
✓ Updated version to 9.5.0 in deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
✓ Added backport rule for 9.5 to .mergify.yml
✓ All files updated for major/minor release

Step 2: [DRY RUN] Would create release branch and commit
  Branch: 9.5
  Commit: [Release] Prepare release 9.5.0

Step 3: [DRY RUN] Would push branch to remote
  git push origin 9.5

Step 4: [DRY RUN] Would create pull request
  Title: [Release 9.5.0] Prepare release branch
  Head: 9.5
  Base: main

=== Major/Minor Release Workflow Complete ===

⚠️  This was a DRY RUN. Review the changes with 'git diff' and run again without DRY_RUN=true
diff --git a/.mergify.yml b/.mergify.yml
index a0cc5c8d5c..d0c688987b 100644
--- a/.mergify.yml
+++ b/.mergify.yml
@@ -1,348 +1,339 @@
+    - actions:
+        backport:
+            branches:
+                - "9.5"
+      conditions:
+        - merged
+        - label=backport-9.5
+      name: backport patches to 9.5 branch
diff --git a/beats b/beats
index eff088939b..11d1fe736b 160000
--- a/beats
+++ b/beats
@@ -1 +1 @@
-Subproject commit eff088939b9a4c2f1616a9b64eb5fe4a3352fea4
+Subproject commit 11d1fe736b330f5293576796b8732289259da0ff
diff --git a/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml b/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
index e6451393ff..c7bf6ee93e 100644
--- a/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
+++ b/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
@@ -34,7 +34,7 @@ spec:
       dnsPolicy: ClusterFirstWithHostNet
       containers:
         - name: elastic-agent
-          image: docker.elastic.co/elastic-agent/elastic-agent:9.4.0
+          image: docker.elastic.co/elastic-agent/elastic-agent:9.5.0
           env:
             # Set to 1 for enrollment into Fleet server. If not set, Elastic Agent is run in standalone mode
             - name: FLEET_ENROLL
diff --git a/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml b/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
index 7fbc77540e..f669cfd038 100644
--- a/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
+++ b/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
@@ -711,7 +711,7 @@ spec:
       # Uncomment if using hints feature
       #initContainers:
       #  - name: k8s-templates-downloader
-      #    image: docker.elastic.co/elastic-agent/elastic-agent:9.4.0
+      #    image: docker.elastic.co/elastic-agent/elastic-agent:9.5.0
       #    command: ['bash']
       #    args:
       #      - -c
@@ -723,7 +723,7 @@ spec:
       #        mountPath: /etc/elastic-agent/inputs.d
       containers:
         - name: elastic-agent-standalone
-          image: docker.elastic.co/elastic-agent/elastic-agent:9.4.0
+          image: docker.elastic.co/elastic-agent/elastic-agent:9.5.0
           args: ["-c", "/etc/elastic-agent/agent.yml", "-e"]
           env:
             # The API Key with access privilleges to connect to Elasticsearch. https://www.elastic.co/guide/en/fleet/current/grant-access-to-elasticsearch.html#create-api-key-standalone-agent
diff --git a/version/version.go b/version/version.go
index c308f7ba8b..bdb3291104 100644
--- a/version/version.go
+++ b/version/version.go
@@ -4,5 +4,5 @@
 
 package version
 
-const defaultBeatVersion = "9.4.0"
+const defaultBeatVersion = "9.5.0"
 const Agent = defaultBeatVersion
$ export PROJECT_OWNER="v1v"               
export CURRENT_RELEASE="9.5.1"
export GITHUB_TOKEN=$(gh auth token)
export DRY_RUN=true

# Dry run first
mage release:runPatch

🔍 DRY RUN MODE - No changes will be pushed

=== Starting Patch Release Workflow for 9.5.1 ===

Step 1: Verifying current branch...
Step 1: [DRY RUN] Would verify current branch

Step 2: Updating version files...
✓ Updated version to 9.5.1 in version/version.go
✓ Updated version to 9.5.1 in deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
✓ Updated version to 9.5.1 in deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml

Step 3: [DRY RUN] Would commit changes
  Commit: [Release] Prepare patch release 9.5.1

Step 4: [DRY RUN] Would push changes to remote
  git push origin 9.5

=== Patch Release Workflow Complete ===

⚠️  This was a DRY RUN. Review the changes with 'git diff' and run again without DRY_RUN=true
-Subproject commit eff088939b9a4c2f1616a9b64eb5fe4a3352fea4
+Subproject commit 11d1fe736b330f5293576796b8732289259da0ff
diff --git a/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml b/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
index e6451393ff..1b98569b75 100644
--- a/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
+++ b/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml
@@ -34,7 +34,7 @@ spec:
       dnsPolicy: ClusterFirstWithHostNet
       containers:
         - name: elastic-agent
-          image: docker.elastic.co/elastic-agent/elastic-agent:9.4.0
+          image: docker.elastic.co/elastic-agent/elastic-agent:9.5.1
           env:
             # Set to 1 for enrollment into Fleet server. If not set, Elastic Agent is run in standalone mode
             - name: FLEET_ENROLL
diff --git a/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml b/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
index 7fbc77540e..6072871ac6 100644
--- a/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
+++ b/deploy/kubernetes/elastic-agent-standalone-kubernetes.yaml
@@ -711,7 +711,7 @@ spec:
       # Uncomment if using hints feature
       #initContainers:
       #  - name: k8s-templates-downloader
-      #    image: docker.elastic.co/elastic-agent/elastic-agent:9.4.0
+      #    image: docker.elastic.co/elastic-agent/elastic-agent:9.5.1
       #    command: ['bash']
       #    args:
       #      - -c
@@ -723,7 +723,7 @@ spec:
       #        mountPath: /etc/elastic-agent/inputs.d
       containers:
         - name: elastic-agent-standalone
-          image: docker.elastic.co/elastic-agent/elastic-agent:9.4.0
+          image: docker.elastic.co/elastic-agent/elastic-agent:9.5.1
           args: ["-c", "/etc/elastic-agent/agent.yml", "-e"]
           env:
             # The API Key with access privilleges to connect to Elasticsearch. https://www.elastic.co/guide/en/fleet/current/grant-access-to-elasticsearch.html#create-api-key-standalone-agent
diff --git a/version/version.go b/version/version.go
index c308f7ba8b..e26da47984 100644
--- a/version/version.go
+++ b/version/version.go
@@ -4,5 +4,5 @@
 
 package version
 
-const defaultBeatVersion = "9.4.0"
+const defaultBeatVersion = "9.5.1"
 const Agent = defaultBeatVersion

this should help with manipulating the YAML using the YAML golang library
@v1v

v1v commented Mar 23, 2026

Copy link
Copy Markdown
Member Author

buildkite test this

@v1v v1v marked this pull request as ready for review March 23, 2026 17:11
@v1v v1v requested a review from a team as a code owner March 23, 2026 17:11
@v1v v1v marked this pull request as draft March 24, 2026 12:41
@mergify

mergify Bot commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/release-scripts-for-ff upstream/feature/release-scripts-for-ff
git merge upstream/main
git push upstream feature/release-scripts-for-ff

1 similar comment
@mergify

mergify Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b feature/release-scripts-for-ff upstream/feature/release-scripts-for-ff
git merge upstream/main
git push upstream feature/release-scripts-for-ff

@fr4nc1sc0-r4m0n

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

@fr4nc1sc0-r4m0n

Copy link
Copy Markdown
Contributor

Replaced by #15433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches skip-changelog skip-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants