Skip to content

Test building archetypes #2796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 1, 2025
Merged

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
@@ -72,7 +72,7 @@ func buildCommandAction(cmd *cobra.Command, args []string) error {
}
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants