[8.14](backport #4885) [Ind Agent] Update packaging to properly package from manifest if given #5039
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 toolI have added an integration test or an E2E test
Disruptive User Impact
How to test this PR locally
Related issues
Questions to ask yourself
This is an automatic backport of pull request #4885 done by [Mergify](https://mergify.com).