Skip to content
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

[8.14](backport #4885) [Ind Agent] Update packaging to properly package from manifest if given #5039

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 2, 2024

What does this PR do?

This PR updates the packaging code to operate differently when packaging from a local build vs packaging from a manifest.

The manifest packaging relies on the items in the manifest, while the local one uses globbing to find all packages/directories that match the expected version string.

Why is it important?

For the Independent Agent Release, a manifest is created that includes opted-in projects that have a patch version one higher than the rest of the opted-out/previously-released projects. The file globbing expecting one single version is what skips the opted-in projects.

Previously, we had been packaging the incorrect opted-in projects, which is why we had verified those projects were properly packaged. But when that bug was fixed, we did not properly verify that everything was still there since the packaging still succeeded.

Checklist

  • packaging dependencies with a manifest for an Independent Agent build

  • packaging dependencies with a manifest for a Unified Release / Stack build

  • packaging dependencies pulling the latest unified release version

  • packaging dependencies pulling from a DROP_PATH

  • packaging by building beats dependencies located side by side with the agent code

  • 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

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?
  • ...

This is an automatic backport of pull request #4885 done by [Mergify](https://mergify.com).

…en (#4885)

* Download from manifest if version has +1 patch

* Try modified globExpr

* use version package

* catch err

* use panic

* Add the filepath

* better package finding

* more intermediate work

* more progress

* it seems to maybe work

* fixed bug

* Copying spec files as well

* temp test value

* fixing linting errors

* Clean up manifest code

* Cleaning up

* Cleanup 2

* removing test variable

* addressing PR comments and cleanup

* Adding manifest tests

* Update magefile.go

Co-authored-by: Craig MacKenzie <[email protected]>

* Switch to go:embed for tests.

* Build component specs from external binaries.

* Convert component to project in var names

* Return error when package not found.

Add contexts where necessary

* Filter unsupported platforms.

* Fix darwin/arm64 build.

* Several renames for consistency.

* A few more renames.

* Move code out of magefile

* mage fmt

* Fix log message.

* Fix lint warnings.

* Rename test.

* Refactor to share download from manifest logic.

---------

Co-authored-by: Craig MacKenzie <[email protected]>
Co-authored-by: Pierre HILBERT <[email protected]>
(cherry picked from commit 0e7a211)
@mergify mergify bot requested a review from a team as a code owner July 2, 2024 17:17
@mergify mergify bot added the backport label Jul 2, 2024
@mergify mergify bot requested review from blakerouse and andrzej-stencel and removed request for a team July 2, 2024 17:17
Copy link

@pierrehilbert
Copy link
Contributor

I will merge this tomorrow after the 8.14.2 release "just in case"

@pierrehilbert pierrehilbert requested review from pierrehilbert and removed request for blakerouse and andrzej-stencel July 3, 2024 06:01
@pierrehilbert pierrehilbert added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jul 3, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@pierrehilbert pierrehilbert merged commit 48a3d15 into 8.14 Jul 5, 2024
15 checks passed
@pierrehilbert pierrehilbert deleted the mergify/bp/8.14/pr-4885 branch July 5, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants