Skip to content

[9.0](backport #4912) Convert Makefile to magefile.go#5395

Closed
mergify[bot] wants to merge 1 commit into9.0from
mergify/bp/9.0/pr-4912
Closed

[9.0](backport #4912) Convert Makefile to magefile.go#5395
mergify[bot] wants to merge 1 commit into9.0from
mergify/bp/9.0/pr-4912

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Sep 3, 2025

What is the problem this PR solves?

The Makefile has reached a point where it is becoming difficult to understand and add new features/targets.

How does this PR solve the problem?

Reimplement Makefile targets in mage.
Change buildkite pipeline to use mage.
Change Dockerfile* to use mage.

Added bonuses:

  • Support for producing NOTICE-FIPS.txt
    • NOTICE files only contain modules used in shipped binaries.
  • cloudE2E testing is functional
  • Minor increase in parallel execution for targets.
  • env only settings controls
    • target doc strings contain env var usage info
  • conditional linter installation
  • integration/e2e test token reuse
  • improved release testing (archive structure, non-zero len binaries, fips capable indicators if FIPS=true)
  • reimplemented bash scripts in dev-tools for mage, removed unused scripts.

How to test this PR locally

mage -l

See doc strings for targets with mage -h TARGET i.e.:

mage -h build:binary
Binary builds release binaries for the specified platforms. PLATFORMS may be used to set os/arch for compiled binaries. DEV creates a development build. SNAPSHOT creates a snapshot build. FIPS creates a FIPS capable binary. VERSION_QUALIFIER may be used to manually specify a version qualifer for the produced binary.

Usage:

	mage build:binary

```<hr>This is an automatic backport of pull request #4912 done by [Mergify](https://mergify.com).
Reimplement Makefile targets in mage.
Change buildkite pipeline to use mage.
Change Dockerfile* to use mage.

(cherry picked from commit db5f46b)

# Conflicts:
#	.buildkite/pipeline.yml
#	.buildkite/scripts/common.sh
#	.buildkite/scripts/local_build.sh
#	.buildkite/scripts/test-release.sh
#	.buildkite/scripts/unit_test.sh
#	Dockerfile.fips
#	Makefile
#	NOTICE.txt
#	dev-tools/cloud/Makefile
#	dev-tools/cloud/terraform/main.tf
#	dev-tools/e2e/Dockerfile
#	dev-tools/e2e/build.sh
#	dev-tools/e2e/validatecerts.go
#	dev-tools/go.mod
#	dev-tools/go.sum
#	docs/fips.md
#	testing/e2e/fips_test.go
@mergify mergify bot added the backport label Sep 3, 2025
@mergify mergify bot requested a review from a team as a code owner September 3, 2025 15:48
@mergify mergify bot added the conflicts There is a conflict in the backported pull request label Sep 3, 2025
@mergify mergify bot requested review from kaanyalti and ycombinator September 3, 2025 15:48
@mergify mergify bot added the backport label Sep 3, 2025
@mergify
Copy link
Contributor Author

mergify bot commented Sep 3, 2025

Cherry-pick of db5f46b has failed:

On branch mergify/bp/9.0/pr-4912
Your branch is up to date with 'origin/9.0'.

You are currently cherry-picking commit db5f46b.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   .buildkite/scripts/build_push_docker_image.sh
	new file:   .buildkite/scripts/check_ci.sh
	modified:   .buildkite/scripts/cloud_e2e_test.sh
	modified:   .buildkite/scripts/dra_release.sh
	modified:   .buildkite/scripts/e2e_test.sh
	modified:   .buildkite/scripts/integration_test.sh
	modified:   .buildkite/scripts/package.sh
	modified:   .buildkite/scripts/release_test.sh
	modified:   .buildkite/scripts/run_benchmark.sh
	new file:   .buildkite/scripts/unit_test_fipsonly.sh
	modified:   Dockerfile
	modified:   Dockerfile.build
	new file:   NOTICE-FIPS.txt
	modified:   README.md
	modified:   Vagrantfile
	deleted:    dev-tools/cherrypick_pr
	deleted:    dev-tools/cloud/docker/Dockerfile
	deleted:    dev-tools/cloud/docker/build.sh
	deleted:    dev-tools/cloud/launch_cloud_e2e_tests.sh
	new file:   dev-tools/cloud/terraform/.terraform.lock.hcl
	modified:   dev-tools/cloud/terraform/outputs.tf
	deleted:    dev-tools/common.bash
	deleted:    dev-tools/e2e/certs.sh
	deleted:    dev-tools/e2e/get-apm-server-api-key.sh
	deleted:    dev-tools/e2e/get-kibana-servicetoken.sh
	deleted:    dev-tools/e2e/wait-for-apm.sh
	deleted:    dev-tools/integration/get-elasticsearch-servicetoken.sh
	renamed:    dev-tools/multipass-cloud-init.yml.envsubst -> dev-tools/multipass-cloud-init.tpl
	deleted:    dev-tools/run_with_go_ver
	modified:   docs/developers-guide.md
	modified:   docs/docker-images.md
	modified:   go.mod
	modified:   go.sum
	modified:   internal/pkg/bulk/schema_easyjson.go
	new file:   magefile.go
	modified:   testing/e2e/README.md
	modified:   testing/e2e/agent_install_test.go
	modified:   testing/e2e/doc.go
	modified:   testing/e2e/scaffold/scaffold.go
	modified:   testing/e2e/stand_alone_test.go

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   .buildkite/pipeline.yml
	both modified:   .buildkite/scripts/common.sh
	both modified:   .buildkite/scripts/local_build.sh
	deleted by them: .buildkite/scripts/test-release.sh
	both modified:   .buildkite/scripts/unit_test.sh
	both modified:   Dockerfile.fips
	both modified:   Makefile
	both modified:   NOTICE.txt
	deleted by them: dev-tools/cloud/Makefile
	both modified:   dev-tools/cloud/terraform/main.tf
	both modified:   dev-tools/e2e/Dockerfile
	deleted by them: dev-tools/e2e/build.sh
	deleted by them: dev-tools/e2e/validatecerts.go
	deleted by us:   dev-tools/go.mod
	deleted by us:   dev-tools/go.sum
	both modified:   docs/fips.md
	deleted by them: testing/e2e/fips_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot added the conflicts There is a conflict in the backported pull request label Sep 3, 2025
@github-actions github-actions bot added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team tech debt labels Sep 3, 2025
@prodsecmachine
Copy link

prodsecmachine commented Sep 3, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@michel-laterman
Copy link
Contributor

Replaced with #5423

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

Labels

backport conflicts There is a conflict in the backported pull request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team tech debt

2 participants