Skip to content

ci(ff): support feature freeze automation#13138

Draft
v1v wants to merge 4 commits intoelastic:mainfrom
v1v:feature/release-scripts-for-ff
Draft

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

Conversation

@v1v
Copy link
Member

@v1v v1v commented Mar 12, 2026

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
Copy link
Member Author

v1v commented Mar 12, 2026

@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
Copy link
Contributor

mergify bot commented Mar 13, 2026

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

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.

1 participant