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

Enable leveraging Maven Session to stage Habushu-type dependency source files to the module directory #146

Closed
5 tasks done
Cho-William opened this issue Jun 14, 2024 · 3 comments

Comments

@Cho-William
Copy link
Contributor

Cho-William commented Jun 14, 2024

Overview

Currently, Habushu supports retrieving wheels from a custom cache to enable modules to stage locally developed wheels. However, this approach is brittle (when handling path-based dependencies) and requires the user to list the dependencies twice in their module (once for the retrieve wheels goal, and once as a maven dependency).

Instead, by emulating the maven-dependency-plugin:unpack-dependencies goal, Habushu would be able to retrieve monorepo dependency source code AND retrieve any transitive path-based dependencies. This will remove significant burden from the user, and enable a more resilient pattern for making locally developed monorepo dependencies available to other modules in the monorepo.

Definition of Done

  • Implement test code for the BDD scenarios (below)
  • Implement the scenarios
  • Add documentation for the new goal
  • Update the release notes (via PR blurb)
  • Deprecate cache-wheels and retrieve-wheels goals

Implementation Details

  • Check the pom for any Habushu-type dependencies and recognize them as needed monorepo dependencies
  • Leverage the Maven session to copy monorepo dependency source files to the docker build context
  • Examine any transitive path-based monorepo dependencies and also stage those source files (while maintaining the existing relative structure)
    • Identifying any transitive path-based dependencies will be facilitated by looking the pom/maven session (as in NOT examining the pyproject.toml files)

BDD Scenarios

# to be implemented for this issue
Scenario: One Habushu-type dependency is specified with the default configuration
  Given a single Habushu-type dependency
  When the stage-dependencies goal is executed
  Then the source code for the dependency is staged in the build directory
  And all transitive Habushu-type dependencies are staged in the build directory 
  And the relative directory structure is preserved

# future scenarios
Scenario: Multiple Habushu-type dependencies are specified with the aggregate configuration

Scenario: Multiple Habushu-type dependencies are specified with the default configuration

Test Steps

  • OTS Only:
    • Pull this forked branch and run mvn clean install
  • Final Test Only:
    • Pull the latest dev branch of the technology brewery habushu repo
    • run the following in the root mvn clean install -Pbootstrap -Dmaven.build.cache.enabled=false
  • Download the attached
    example-monorepo.zip
    and unzip it.
  • Run mvn clean install at the root of the unzipped project
  • Verify the directory extensions/extensions-monorepo-dep-consuming-application/target/containerize-support/example-monorepo/extensions/extensions-python-dep-X/ contains the same contents as extensions/extensions-python-dep-X/ excluding the .venv/ and dist/ folders
  • Verify the directory extensions/extensions-monorepo-dep-consuming-application/target/containerize-support/example-monorepo/foundation/foundation-python-dep-Y/ contains the same contents as foundation/foundation-python-dep-Y/ excluding the .venv/ and dist/ folders
@Cho-William Cho-William changed the title Enable leveraging Maven Session to stage Habushu-type dependency source files to the build directory Enable leveraging Maven Session to stage Habushu-type dependency source files to the module directory Jun 14, 2024
@Cho-William
Copy link
Contributor Author

DOD completed with @ewilkins-csi

Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 17, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 17, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 18, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 18, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 18, 2024
Cho-William pushed a commit to Cho-William/habushu that referenced this issue Jun 21, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 21, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 21, 2024
@Cho-William
Copy link
Contributor Author

OTS completed with @carter-cundiff

Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 21, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 21, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 21, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 21, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 21, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 23, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 23, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 23, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
d-ryan-ashcraft added a commit that referenced this issue Jun 24, 2024
#146 copying transitive dependencies functionality for containerize-d…
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
Cho-William added a commit to Cho-William/habushu that referenced this issue Jun 24, 2024
@carter-cundiff
Copy link
Contributor

Testing passed:
image

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

No branches or pull requests

2 participants