Skip to content

Conversation

@jsoriano
Copy link
Member

@jsoriano jsoriano commented Aug 1, 2025

After creating packages from archetypes, they may contain errors that are only discovered on update or build time. Perform a full build of the created packages to detect these issues.

This would have detected a missing function in a template in #2707.

This change also allows to build packages in a target build directory.

cmd/build.go Outdated
logger.Debugf("Use build directory: %s", buildDir)

targets, err := docs.UpdateReadmes(packageRoot)
targets, err := docs.UpdateReadmes(packageRoot, "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could buildDir be used here as that folder has been created above?

Suggested change
targets, err := docs.UpdateReadmes(packageRoot, "")
targets, err := docs.UpdateReadmes(packageRoot, buildDir)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Umm, seeing that actually maybe we don't need all the magic below to create the build dir, as is being created explicitly here. Maybe I can remove some more code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried to make the build dir always explicit, but there are many things that end up using a builder and would need to be refactored to receive also a build dir. For example the installers, and resources.FleetPackage.

Though I have also found that the value returned by BuildPackagesDirectory is expected to have the packages part, so I have fixed that, and then we can use buildDir here.

Changed in ead911b.

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @jsoriano

@jsoriano jsoriano merged commit c047891 into elastic:main Aug 1, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants