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

move cacheWheels configuration implementation from package phase to install phase #77

Closed
JeffreyRoss opened this issue Jan 5, 2024 · 1 comment

Comments

@JeffreyRoss
Copy link
Collaborator

JeffreyRoss commented Jan 5, 2024

As a Habushu user, I want to be able to have my wheels installed to the local cache separately from the package step, so I have more control over the build lifecycle.

Goal

To add more control over the new cacheWheels habushu-maven-plugin configuration.

Testing Approach

Configure the Habushu-Mixology project to use the cacheWheels configuration and confirm the wheel is cached as expected during the Install lifecycle phase.

Solution details

Creating a new cacheWheelsMojo that will execute during the install phase.

Testing Steps

Test 1: Confirm Habushu-Mixology builds as expected when cacheWheels is set to true.

  1. Clone Habushu
mkdir habushu
git clone https://github.com/TechnologyBrewery/habushu.git habushu
  1. In order to test this change we will need to invoke the new configuration: cacheWheels:boolean. Testing this change against the habushu/habushu-mixology/pom.xml's implementation of the habushu-maven-plugin.

Set cacheWheels to TRUE : Expect the wheel file to be added to the poetry cache location; post build.

<plugins> 
  <plugin> 
    <groupId>org.technologybrewery.habushu</groupId> 
    <artifactId>habushu-maven-plugin</artifactId> 
      <configuration> 
         <cacheWheels>true</cacheWheels> 
      </configuration> 
  </plugin> 
</plugins>
  1. Run/Build Habushu
mvn clean install -Pbootstrap 
mvn clean install -pl :habushu-mixology -Dmaven.build.cache.enabled=false
  1. Confirm the habushu-mixology wheel file is in the poetry cache directory
    expected directory location: ${poetry-cache-dir}/cache/repositories/${artifact-id}/
    the follow command finds your local cache directory.

poetry config cache-dir
Test 2: Confirm Habushu-Mixology builds as expected with no configuration set.

  1. Clear poetry cache
    (this clears out previous run's cache results)

poetry cache clear --all .

  1. Testing no configuration to confirm default behavior; expect no caching of wheel

Remove configuration completely : Expect the wheel file NOT to be added to the poetry cache location post build.

<plugins> 
  <plugin> 
    <groupId>org.technologybrewery.habushu</groupId> 
    <artifactId>habushu-maven-plugin</artifactId>
  </plugin> 
</plugins>
  1. Run/Build Habushu to test the new configuration.

mvn clean install -pl :habushu-mixology -Dmaven.build.cache.enabled=false
4. Expect the wheel file NOT to be added to the poetry cache location post build.

Test 3: Confirm Habushu-Mixology builds as expected when cacheWheels is set to false.

  1. Testing the configuration false setting

Set cacheWheels to FALSE : Expect the wheel file NOT to be added to the poetry cache location post build.

<plugins> 
  <plugin> 
    <groupId>org.technologybrewery.habushu</groupId> 
    <artifactId>habushu-maven-plugin</artifactId> 
      <configuration> 
         <cacheWheels>false</cacheWheels> 
      </configuration> 
  </plugin> 
</plugins>
  1. Clear poetry cache
    (this clears out previous run's cache results)

poetry cache clear --all .
3. Run/Build Habushu to test the new configuration.

mvn clean install -pl :habushu-mixology -Dmaven.build.cache.enabled=false
4. Confirm the habushu-mixology wheel file is NOT in the poetry cache directory
expected directory location: ${poetry-cache-dir}/cache/repositories/${artifact-id}/
the follow command finds your local cache directory.

poetry config cache-dir

@JeffreyRoss JeffreyRoss changed the title move <cacheWheels> configuration implementation from <package> phase to <install> phase move cacheWheels configuration implementation from package phase to install phase Jan 5, 2024
JeffreyRoss added a commit that referenced this issue Jan 5, 2024
* HAB-77 - Moving cacheWheels config implementation from PACKAGE phase to INSTALL phase

* Adding details to lifecycle phase documentation

---------

Co-authored-by: Jeff Ross <[email protected]>
@JeffreyRoss
Copy link
Collaborator Author

PR merged into DEV

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

1 participant