You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/08/26 15:28:55 UTC
[GitHub] [maven-build-cache-extension] eltsovalex opened a new pull request, #24: added possibility to skip cache lookup per project or globally
eltsovalex opened a new pull request, #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24
added possibility to skip generated sources restore on per-project level
added some logging
Following this checklist to help us incorporate your
contribution quickly and easily:
- [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/MNG) filed
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line and body.
- [ ] Format the pull request title like `[MNG-XXX] - Fixes bug in ApproximateQuantiles`,
where you replace `MNG-XXX` with the appropriate JIRA issue. Best practice
is to use the JIRA issue title in the pull request title and in the first line of the
commit message.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
be performed on your pull request automatically.
- [ ] You have run the [Core IT][core-its] successfully.
If your pull request is about ~20 lines of code you don't need to sign an
[Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
you have to acknowledge this by using the following check-box.
- [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
- [ ] In any other case, please file an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
[core-its]: https://maven.apache.org/core-its/core-it-suite/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r963450942
##########
src/main/java/org/apache/maven/buildcache/xml/CacheConfigImpl.java:
##########
@@ -87,6 +87,16 @@ public class CacheConfigImpl implements org.apache.maven.buildcache.xml.CacheCon
public static final String RESTORE_GENERATED_SOURCES_PROPERTY_NAME = "maven.build.cache.restoreGeneratedSources";
public static final String ALWAYS_RUN_PLUGINS = "maven.build.cache.alwaysRunPlugins";
+ /**
+ * Flag to control if we should skip lookup for cached artifacts globally r for a particular project even if
Review Comment:
fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970801687
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -104,9 +106,9 @@ public void execute( List<MojoExecution> mojoExecutions,
mojoExecutionRunner.run( mojoExecution );
}
cacheState = cacheConfig.initialize();
- if ( cacheState == INITIALIZED )
+ if ( cacheState == INITIALIZED || skipCacheLookup )
{
- result = cacheController.findCachedBuild( session, project, mojoExecutions );
+ result = cacheController.findCachedBuild( session, project, mojoExecutions, skipCacheLookup );
Review Comment:
if (skipLookup) lookup :-)
I expected config just to return `DISABLED` state for this module
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972084891
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -180,9 +182,21 @@ public MavenProjectInput( MavenProject project,
{
if ( propertyName.startsWith( CACHE_EXCLUDE_NAME ) )
{
+ String propertyValue = properties.getProperty( propertyName );
+ Path path = Paths.get( propertyValue );
+ filteredOutPaths.add( path );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Adding an excludePath from property '{}', values is '{}', path is '{}' ",
+ propertyName, propertyValue, path );
+ }
+
filteredOutPaths.add( Paths.get( properties.getProperty( propertyName ) ) );
Review Comment:
@AlexanderAshitkin thanks, fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970801687
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -104,9 +106,9 @@ public void execute( List<MojoExecution> mojoExecutions,
mojoExecutionRunner.run( mojoExecution );
}
cacheState = cacheConfig.initialize();
- if ( cacheState == INITIALIZED )
+ if ( cacheState == INITIALIZED || skipCacheLookup )
{
- result = cacheController.findCachedBuild( session, project, mojoExecutions );
+ result = cacheController.findCachedBuild( session, project, mojoExecutions, skipCacheLookup );
Review Comment:
right now cache could be accessed when no initialized (it seems). not sure if it could cause any issues but in terms of naming and contract clarity it is not so clear . `skipCache` should work better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] hboutemy commented on pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
hboutemy commented on PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#issuecomment-1236595784
is it possible to add a note in documentation about this feature and how to use it, please?
https://github.com/apache/maven-build-cache-extension/tree/master/src/site/markdown
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970815746
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -96,6 +97,7 @@ public void execute( List<MojoExecution> mojoExecutions,
// execute clean bound goals before restoring to not interfere/slowdown clean
CacheState cacheState = DISABLED;
CacheResult result = CacheResult.empty();
+ boolean skipCacheLookup = cacheConfig.isSkipLookup() || MavenProjectInput.shouldSkipCacheLookup( project );
Review Comment:
regarding the naming - lets call it skipCache. Gradle has similar parameter to force rebuild named `--no-build-cache`. from command line and pom perspective -DskipBuildCache is more descriptive
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -96,6 +97,7 @@ public void execute( List<MojoExecution> mojoExecutions,
// execute clean bound goals before restoring to not interfere/slowdown clean
CacheState cacheState = DISABLED;
CacheResult result = CacheResult.empty();
+ boolean skipCacheLookup = cacheConfig.isSkipLookup() || MavenProjectInput.shouldSkipCacheLookup( project );
Review Comment:
regarding the naming - lets call it skipCache. Gradle has similar parameter to force rebuild named `--no-build-cache`. from command line and pom perspective `-DskipBuildCache` is more descriptive
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970801687
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -104,9 +106,9 @@ public void execute( List<MojoExecution> mojoExecutions,
mojoExecutionRunner.run( mojoExecution );
}
cacheState = cacheConfig.initialize();
- if ( cacheState == INITIALIZED )
+ if ( cacheState == INITIALIZED || skipCacheLookup )
{
- result = cacheController.findCachedBuild( session, project, mojoExecutions );
+ result = cacheController.findCachedBuild( session, project, mojoExecutions, skipCacheLookup );
Review Comment:
right now cache could be accessed when no initialized it seems. not sure if it could cause any issues but in terms of naming looks like
cache will be used
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970826571
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -180,9 +182,21 @@ public MavenProjectInput( MavenProject project,
{
if ( propertyName.startsWith( CACHE_EXCLUDE_NAME ) )
{
+ String propertyValue = properties.getProperty( propertyName );
+ Path path = Paths.get( propertyValue );
+ filteredOutPaths.add( path );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Adding an excludePath from property '{}', values is '{}', path is '{}' ",
+ propertyName, propertyValue, path );
+ }
+
filteredOutPaths.add( Paths.get( properties.getProperty( propertyName ) ) );
}
}
+ CacheUtils.debugPrintCollection( LOGGER, filteredOutPaths,
+ "List of excluded paths (checked either by fileName or by startsWith prefix)",
+ "Pah entry" );
Review Comment:
`Pah` entry is a medical term likely :-)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970826571
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -180,9 +182,21 @@ public MavenProjectInput( MavenProject project,
{
if ( propertyName.startsWith( CACHE_EXCLUDE_NAME ) )
{
+ String propertyValue = properties.getProperty( propertyName );
+ Path path = Paths.get( propertyValue );
+ filteredOutPaths.add( path );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Adding an excludePath from property '{}', values is '{}', path is '{}' ",
+ propertyName, propertyValue, path );
+ }
+
filteredOutPaths.add( Paths.get( properties.getProperty( propertyName ) ) );
}
}
+ CacheUtils.debugPrintCollection( LOGGER, filteredOutPaths,
+ "List of excluded paths (checked either by fileName or by startsWith prefix)",
+ "Pah entry" );
Review Comment:
'Pah' entry is a medical term likely :-)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added flag to force rebuild per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972151400
##########
src/site/markdown/parameters.md:
##########
@@ -32,7 +32,7 @@ This documents contains various configuration parameters supported by cache engi
| `-Dmaven.build.cache.lazyRestore=(true/false)` | Restore artifacts from remote cache lazily | Performance optimization |
| `-Dmaven.build.cache.restoreGeneratedSources=(true/false)` | Do not restore generated sources and directly attached files | Performance optimization |
| `-Dmaven.build.cache.alwaysRunPlugins=<list of plugins>` | Comma seprated list of plugins to always run regardless of cache state. An example: `maven-deploy-plugin:*,maven-install-plugin:install` | Remote cache setup/tuning/troubleshooting |
-| `-Dmaven.build.cache.skipLookup=(true/false)` | Skip looking up artifacts in caches. Does not affect writing artifacts to caches, disables only reading when set to `true` | May be used to trigger a forced rebuild when maching artifatcs do exist in caches|
+| `-Dmaven.build.cache.skip=(true/false)` | Skip looking up artifacts in caches. Does not affect writing artifacts to caches, disables only reading when set to `true` | May be used to trigger a forced rebuild when maching artifatcs do exist in caches|
Review Comment:
@AlexanderAshitkin - thx, fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] maximilian-novikov-db commented on pull request #24: [MBUILDCACHE-22] added flag to force rebuild per project or globally
Posted by GitBox <gi...@apache.org>.
maximilian-novikov-db commented on PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#issuecomment-1278729912
@gnodet please merge
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#issuecomment-1237868527
Typos fixed in javadoc + new parameters described in documentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970829043
##########
src/site/markdown/parameters.md:
##########
@@ -32,6 +32,7 @@ This documents contains various configuration parameters supported by cache engi
| `-Dmaven.build.cache.lazyRestore=(true/false)` | Restore artifacts from remote cache lazily | Performance optimization |
| `-Dmaven.build.cache.restoreGeneratedSources=(true/false)` | Do not restore generated sources and directly attached files | Performance optimization |
| `-Dmaven.build.cache.alwaysRunPlugins=<list of plugins>` | Comma seprated list of plugins to always run regardless of cache state. An example: `maven-deploy-plugin:*,maven-install-plugin:install` | Remote cache setup/tuning/troubleshooting |
+| `-Dmaven.build.cache.skipLookup=(true/false)` | Skip looking up artifacts in caches. Does not affect writing artifacts to caches, disables only reading when set to `true` | May be used to trigger a forced rebuild when maching artifatcs do exist in caches|
Review Comment:
👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970832404
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -180,9 +182,21 @@ public MavenProjectInput( MavenProject project,
{
if ( propertyName.startsWith( CACHE_EXCLUDE_NAME ) )
{
+ String propertyValue = properties.getProperty( propertyName );
+ Path path = Paths.get( propertyValue );
+ filteredOutPaths.add( path );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Adding an excludePath from property '{}', values is '{}', path is '{}' ",
+ propertyName, propertyValue, path );
+ }
+
filteredOutPaths.add( Paths.get( properties.getProperty( propertyName ) ) );
Review Comment:
to be removed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972086104
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -96,6 +97,7 @@ public void execute( List<MojoExecution> mojoExecutions,
// execute clean bound goals before restoring to not interfere/slowdown clean
CacheState cacheState = DISABLED;
CacheResult result = CacheResult.empty();
+ boolean skipCacheLookup = cacheConfig.isSkipLookup() || MavenProjectInput.shouldSkipCacheLookup( project );
Review Comment:
@AlexanderAshitkin renamed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972132304
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -180,9 +182,21 @@ public MavenProjectInput( MavenProject project,
{
if ( propertyName.startsWith( CACHE_EXCLUDE_NAME ) )
{
+ String propertyValue = properties.getProperty( propertyName );
+ Path path = Paths.get( propertyValue );
+ filteredOutPaths.add( path );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Adding an excludePath from property '{}', values is '{}', path is '{}' ",
+ propertyName, propertyValue, path );
+ }
+
filteredOutPaths.add( Paths.get( properties.getProperty( propertyName ) ) );
}
}
+ CacheUtils.debugPrintCollection( LOGGER, filteredOutPaths,
+ "List of excluded paths (checked either by fileName or by startsWith prefix)",
+ "Pah entry" );
Review Comment:
@AlexanderAshitkin fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972089001
##########
src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java:
##########
@@ -153,37 +154,50 @@ public CacheControllerImpl(
@Override
@Nonnull
public CacheResult findCachedBuild( MavenSession session, MavenProject project,
- List<MojoExecution> mojoExecutions )
+ List<MojoExecution> mojoExecutions, boolean skipLookup )
{
final String highestRequestPhase = CacheUtils.getLast( mojoExecutions ).getLifecyclePhase();
if ( !lifecyclePhasesHelper.isLaterPhaseThanClean( highestRequestPhase ) )
{
return empty();
}
- LOGGER.info( "Attempting to restore project from build cache" );
+ String projectName = getVersionlessProjectKey( project );
ProjectsInputInfo inputInfo = projectInputCalculator.calculateInput( project );
final CacheContext context = new CacheContext( project, inputInfo, session );
- // remote build first
- CacheResult result = findCachedBuild( mojoExecutions, context );
- if ( !result.isSuccess() && result.getContext() != null )
+ CacheResult result = empty( context );
+ if ( !skipLookup )
{
- LOGGER.debug( "Remote cache is incomplete or missing, trying local build" );
- CacheResult localBuild = findLocalBuild( mojoExecutions, context );
+ LOGGER.info( "Attempting to restore project {} from build cache", projectName );
- if ( localBuild.isSuccess() || ( localBuild.isPartialSuccess() && !result.isPartialSuccess() ) )
- {
- result = localBuild;
- }
- else
+ // remote build first
Review Comment:
This is not my comment - just part of code by @gnodet that I've moved inside a block
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972087439
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -104,9 +106,9 @@ public void execute( List<MojoExecution> mojoExecutions,
mojoExecutionRunner.run( mojoExecution );
}
cacheState = cacheConfig.initialize();
- if ( cacheState == INITIALIZED )
+ if ( cacheState == INITIALIZED || skipCacheLookup )
{
- result = cacheController.findCachedBuild( session, project, mojoExecutions );
+ result = cacheController.findCachedBuild( session, project, mojoExecutions, skipCacheLookup );
Review Comment:
@AlexanderAshitkin renamed to skipCache
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970826571
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -180,9 +182,21 @@ public MavenProjectInput( MavenProject project,
{
if ( propertyName.startsWith( CACHE_EXCLUDE_NAME ) )
{
+ String propertyValue = properties.getProperty( propertyName );
+ Path path = Paths.get( propertyValue );
+ filteredOutPaths.add( path );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Adding an excludePath from property '{}', values is '{}', path is '{}' ",
+ propertyName, propertyValue, path );
+ }
+
filteredOutPaths.add( Paths.get( properties.getProperty( propertyName ) ) );
}
}
+ CacheUtils.debugPrintCollection( LOGGER, filteredOutPaths,
+ "List of excluded paths (checked either by fileName or by startsWith prefix)",
+ "Pah entry" );
Review Comment:
`Pah` entry is a medical term likely
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#issuecomment-1246813034
I would rename this pr into "flag to force rebuild" which better describes new functionality
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970824769
##########
src/main/java/org/apache/maven/buildcache/DefaultNormalizedModelProvider.java:
##########
@@ -123,10 +127,16 @@ private List<Plugin> normalizePlugins( List<Plugin> plugins )
{
Plugin copy = plugin.clone();
List<String> excludeProperties = cacheConfig.getEffectivePomExcludeProperties( copy );
- removeBlacklistedAttributes( copy.getConfiguration(), excludeProperties );
Review Comment:
where is it now?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970801687
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -104,9 +106,9 @@ public void execute( List<MojoExecution> mojoExecutions,
mojoExecutionRunner.run( mojoExecution );
}
cacheState = cacheConfig.initialize();
- if ( cacheState == INITIALIZED )
+ if ( cacheState == INITIALIZED || skipCacheLookup )
{
- result = cacheController.findCachedBuild( session, project, mojoExecutions );
+ result = cacheController.findCachedBuild( session, project, mojoExecutions, skipCacheLookup );
Review Comment:
right now cache could be accessed when no initialized it seems. not sure if it could cause any issues but in terms of naming and contract clarity it looks like cache could be used. `skipCache` should work better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970839594
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -819,4 +833,22 @@ public int compare( Path f1, Path f2 )
}
}
+ public static boolean shouldSkipCacheLookup( MavenProject project )
Review Comment:
`skipCache` or `isSkipCache` will be better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972138664
##########
src/site/markdown/parameters.md:
##########
@@ -32,6 +32,7 @@ This documents contains various configuration parameters supported by cache engi
| `-Dmaven.build.cache.lazyRestore=(true/false)` | Restore artifacts from remote cache lazily | Performance optimization |
| `-Dmaven.build.cache.restoreGeneratedSources=(true/false)` | Do not restore generated sources and directly attached files | Performance optimization |
| `-Dmaven.build.cache.alwaysRunPlugins=<list of plugins>` | Comma seprated list of plugins to always run regardless of cache state. An example: `maven-deploy-plugin:*,maven-install-plugin:install` | Remote cache setup/tuning/troubleshooting |
+| `-Dmaven.build.cache.skipLookup=(true/false)` | Skip looking up artifacts in caches. Does not affect writing artifacts to caches, disables only reading when set to `true` | May be used to trigger a forced rebuild when maching artifatcs do exist in caches|
Review Comment:
@AlexanderAshitkin renamed to -Dorg.maven.build.cache.skipCache
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970832404
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -180,9 +182,21 @@ public MavenProjectInput( MavenProject project,
{
if ( propertyName.startsWith( CACHE_EXCLUDE_NAME ) )
{
+ String propertyValue = properties.getProperty( propertyName );
+ Path path = Paths.get( propertyValue );
+ filteredOutPaths.add( path );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Adding an excludePath from property '{}', values is '{}', path is '{}' ",
+ propertyName, propertyValue, path );
+ }
+
filteredOutPaths.add( Paths.get( properties.getProperty( propertyName ) ) );
Review Comment:
no longer need this line, to be removed?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970822683
##########
src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java:
##########
@@ -153,37 +154,50 @@ public CacheControllerImpl(
@Override
@Nonnull
public CacheResult findCachedBuild( MavenSession session, MavenProject project,
- List<MojoExecution> mojoExecutions )
+ List<MojoExecution> mojoExecutions, boolean skipLookup )
{
final String highestRequestPhase = CacheUtils.getLast( mojoExecutions ).getLifecyclePhase();
if ( !lifecyclePhasesHelper.isLaterPhaseThanClean( highestRequestPhase ) )
{
return empty();
}
- LOGGER.info( "Attempting to restore project from build cache" );
+ String projectName = getVersionlessProjectKey( project );
ProjectsInputInfo inputInfo = projectInputCalculator.calculateInput( project );
final CacheContext context = new CacheContext( project, inputInfo, session );
- // remote build first
- CacheResult result = findCachedBuild( mojoExecutions, context );
- if ( !result.isSuccess() && result.getContext() != null )
+ CacheResult result = empty( context );
+ if ( !skipLookup )
{
- LOGGER.debug( "Remote cache is incomplete or missing, trying local build" );
- CacheResult localBuild = findLocalBuild( mojoExecutions, context );
+ LOGGER.info( "Attempting to restore project {} from build cache", projectName );
- if ( localBuild.isSuccess() || ( localBuild.isPartialSuccess() && !result.isPartialSuccess() ) )
- {
- result = localBuild;
- }
- else
+ // remote build first
Review Comment:
could you please change this comment to something like `Central repository build first`
remote and local notation is confusing here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970839594
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -819,4 +833,22 @@ public int compare( Path f1, Path f2 )
}
}
+ public static boolean shouldSkipCacheLookup( MavenProject project )
Review Comment:
`skipCacheLookup` or `isSkipCacheLookup` will be better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970829043
##########
src/site/markdown/parameters.md:
##########
@@ -32,6 +32,7 @@ This documents contains various configuration parameters supported by cache engi
| `-Dmaven.build.cache.lazyRestore=(true/false)` | Restore artifacts from remote cache lazily | Performance optimization |
| `-Dmaven.build.cache.restoreGeneratedSources=(true/false)` | Do not restore generated sources and directly attached files | Performance optimization |
| `-Dmaven.build.cache.alwaysRunPlugins=<list of plugins>` | Comma seprated list of plugins to always run regardless of cache state. An example: `maven-deploy-plugin:*,maven-install-plugin:install` | Remote cache setup/tuning/troubleshooting |
+| `-Dmaven.build.cache.skipLookup=(true/false)` | Skip looking up artifacts in caches. Does not affect writing artifacts to caches, disables only reading when set to `true` | May be used to trigger a forced rebuild when maching artifatcs do exist in caches|
Review Comment:
PS from command line and pom perspective `-Dorg.maven.build.cache.rebuild` is more descriptive. skip lookup or just skip semantically similar to disable and could be confusing without documentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970829043
##########
src/site/markdown/parameters.md:
##########
@@ -32,6 +32,7 @@ This documents contains various configuration parameters supported by cache engi
| `-Dmaven.build.cache.lazyRestore=(true/false)` | Restore artifacts from remote cache lazily | Performance optimization |
| `-Dmaven.build.cache.restoreGeneratedSources=(true/false)` | Do not restore generated sources and directly attached files | Performance optimization |
| `-Dmaven.build.cache.alwaysRunPlugins=<list of plugins>` | Comma seprated list of plugins to always run regardless of cache state. An example: `maven-deploy-plugin:*,maven-install-plugin:install` | Remote cache setup/tuning/troubleshooting |
+| `-Dmaven.build.cache.skipLookup=(true/false)` | Skip looking up artifacts in caches. Does not affect writing artifacts to caches, disables only reading when set to `true` | May be used to trigger a forced rebuild when maching artifatcs do exist in caches|
Review Comment:
From command line and pom perspective `-Dorg.maven.build.cache.skipCache` is more expressive. Another option is `-Dorg.maven.build.cache.rerun` which is also expressive
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] maximilian-novikov-db commented on pull request #24: added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
maximilian-novikov-db commented on PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#issuecomment-1229906093
@eltsovalex https://issues.apache.org/jira/projects/MBUILDCACHE for this project
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972112153
##########
src/site/markdown/parameters.md:
##########
@@ -32,7 +32,7 @@ This documents contains various configuration parameters supported by cache engi
| `-Dmaven.build.cache.lazyRestore=(true/false)` | Restore artifacts from remote cache lazily | Performance optimization |
| `-Dmaven.build.cache.restoreGeneratedSources=(true/false)` | Do not restore generated sources and directly attached files | Performance optimization |
| `-Dmaven.build.cache.alwaysRunPlugins=<list of plugins>` | Comma seprated list of plugins to always run regardless of cache state. An example: `maven-deploy-plugin:*,maven-install-plugin:install` | Remote cache setup/tuning/troubleshooting |
-| `-Dmaven.build.cache.skipLookup=(true/false)` | Skip looking up artifacts in caches. Does not affect writing artifacts to caches, disables only reading when set to `true` | May be used to trigger a forced rebuild when maching artifatcs do exist in caches|
+| `-Dmaven.build.cache.skip=(true/false)` | Skip looking up artifacts in caches. Does not affect writing artifacts to caches, disables only reading when set to `true` | May be used to trigger a forced rebuild when maching artifatcs do exist in caches|
Review Comment:
small typo. maching -> matching
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on pull request #24: added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#issuecomment-1228645084
Sorry, I do not have an MNG number yet to add as a proper commit comment
But basically this PR is about adding 2 new features which are required to use this extension in yet another complex multi-module project in Deutsche Bank
1) ability to skip cache lookup for a particular module or whole project (required to get some modules always built e.g. via a profile - e.g. I have some additional artifacts published by CI). Alternatively it allows an easy "force" rebuild of a whole project
The difference with not using cache is that results are put into cache, just current matching versions are not taken from caches
2) ability to disable generated source restoration on a per-module level. This is required to overcome issues with some weird Maven plugins which go nuts when cached generated sources are present and produce incorrect build result
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970815746
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -96,6 +97,7 @@ public void execute( List<MojoExecution> mojoExecutions,
// execute clean bound goals before restoring to not interfere/slowdown clean
CacheState cacheState = DISABLED;
CacheResult result = CacheResult.empty();
+ boolean skipCacheLookup = cacheConfig.isSkipLookup() || MavenProjectInput.shouldSkipCacheLookup( project );
Review Comment:
regarding the naming - lets call it `skipCache`. Gradle has similar parameter to force rebuild named `--no-build-cache`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970801687
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -104,9 +106,9 @@ public void execute( List<MojoExecution> mojoExecutions,
mojoExecutionRunner.run( mojoExecution );
}
cacheState = cacheConfig.initialize();
- if ( cacheState == INITIALIZED )
+ if ( cacheState == INITIALIZED || skipCacheLookup )
{
- result = cacheController.findCachedBuild( session, project, mojoExecutions );
+ result = cacheController.findCachedBuild( session, project, mojoExecutions, skipCacheLookup );
Review Comment:
if (skipLookup) lookup :-)
I expected config just to return `DISABLED` state for this module
right now cache could be accessed when no initialized it seems
looks confusing to me
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970826571
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -180,9 +182,21 @@ public MavenProjectInput( MavenProject project,
{
if ( propertyName.startsWith( CACHE_EXCLUDE_NAME ) )
{
+ String propertyValue = properties.getProperty( propertyName );
+ Path path = Paths.get( propertyValue );
+ filteredOutPaths.add( path );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Adding an excludePath from property '{}', values is '{}', path is '{}' ",
+ propertyName, propertyValue, path );
+ }
+
filteredOutPaths.add( Paths.get( properties.getProperty( propertyName ) ) );
}
}
+ CacheUtils.debugPrintCollection( LOGGER, filteredOutPaths,
+ "List of excluded paths (checked either by fileName or by startsWith prefix)",
+ "Pah entry" );
Review Comment:
`Pah entry` is a medical term likely ¯\_(ツ)_/¯
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970829043
##########
src/site/markdown/parameters.md:
##########
@@ -32,6 +32,7 @@ This documents contains various configuration parameters supported by cache engi
| `-Dmaven.build.cache.lazyRestore=(true/false)` | Restore artifacts from remote cache lazily | Performance optimization |
| `-Dmaven.build.cache.restoreGeneratedSources=(true/false)` | Do not restore generated sources and directly attached files | Performance optimization |
| `-Dmaven.build.cache.alwaysRunPlugins=<list of plugins>` | Comma seprated list of plugins to always run regardless of cache state. An example: `maven-deploy-plugin:*,maven-install-plugin:install` | Remote cache setup/tuning/troubleshooting |
+| `-Dmaven.build.cache.skipLookup=(true/false)` | Skip looking up artifacts in caches. Does not affect writing artifacts to caches, disables only reading when set to `true` | May be used to trigger a forced rebuild when maching artifatcs do exist in caches|
Review Comment:
From command line and pom perspective `-Dorg.maven.build.cache.rerun` is more expressive because it assumes that cache will be invalidated and rebuilt. Another option is which is also look better is -`Dorg.maven.build.cache.skipCache` just seems more expressive to me
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970801687
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -104,9 +106,9 @@ public void execute( List<MojoExecution> mojoExecutions,
mojoExecutionRunner.run( mojoExecution );
}
cacheState = cacheConfig.initialize();
- if ( cacheState == INITIALIZED )
+ if ( cacheState == INITIALIZED || skipCacheLookup )
{
- result = cacheController.findCachedBuild( session, project, mojoExecutions );
+ result = cacheController.findCachedBuild( session, project, mojoExecutions, skipCacheLookup );
Review Comment:
right now cache could be accessed when no initialized it seems. not sure if it could cause any issues but in terms of naming and contract clarity it is not so clear `skipCache` should work better
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972089001
##########
src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java:
##########
@@ -153,37 +154,50 @@ public CacheControllerImpl(
@Override
@Nonnull
public CacheResult findCachedBuild( MavenSession session, MavenProject project,
- List<MojoExecution> mojoExecutions )
+ List<MojoExecution> mojoExecutions, boolean skipLookup )
{
final String highestRequestPhase = CacheUtils.getLast( mojoExecutions ).getLifecyclePhase();
if ( !lifecyclePhasesHelper.isLaterPhaseThanClean( highestRequestPhase ) )
{
return empty();
}
- LOGGER.info( "Attempting to restore project from build cache" );
+ String projectName = getVersionlessProjectKey( project );
ProjectsInputInfo inputInfo = projectInputCalculator.calculateInput( project );
final CacheContext context = new CacheContext( project, inputInfo, session );
- // remote build first
- CacheResult result = findCachedBuild( mojoExecutions, context );
- if ( !result.isSuccess() && result.getContext() != null )
+ CacheResult result = empty( context );
+ if ( !skipLookup )
{
- LOGGER.debug( "Remote cache is incomplete or missing, trying local build" );
- CacheResult localBuild = findLocalBuild( mojoExecutions, context );
+ LOGGER.info( "Attempting to restore project {} from build cache", projectName );
- if ( localBuild.isSuccess() || ( localBuild.isPartialSuccess() && !result.isPartialSuccess() ) )
- {
- result = localBuild;
- }
- else
+ // remote build first
Review Comment:
Thus is not my comment - just part of code by @gnodet that I've moved inside a block
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] maximilian-novikov-db commented on a diff in pull request #24: added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
maximilian-novikov-db commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r957636674
##########
src/main/java/org/apache/maven/buildcache/xml/CacheConfigImpl.java:
##########
@@ -87,6 +87,16 @@ public class CacheConfigImpl implements org.apache.maven.buildcache.xml.CacheCon
public static final String RESTORE_GENERATED_SOURCES_PROPERTY_NAME = "maven.build.cache.restoreGeneratedSources";
public static final String ALWAYS_RUN_PLUGINS = "maven.build.cache.alwaysRunPlugins";
+ /**
+ * Flag to control if we should skip lookup for cached artifacts globally r for a particular project even if
Review Comment:
a typo
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970826571
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -180,9 +182,21 @@ public MavenProjectInput( MavenProject project,
{
if ( propertyName.startsWith( CACHE_EXCLUDE_NAME ) )
{
+ String propertyValue = properties.getProperty( propertyName );
+ Path path = Paths.get( propertyValue );
+ filteredOutPaths.add( path );
+ if ( LOGGER.isDebugEnabled() )
+ {
+ LOGGER.debug( "Adding an excludePath from property '{}', values is '{}', path is '{}' ",
+ propertyName, propertyValue, path );
+ }
+
filteredOutPaths.add( Paths.get( properties.getProperty( propertyName ) ) );
}
}
+ CacheUtils.debugPrintCollection( LOGGER, filteredOutPaths,
+ "List of excluded paths (checked either by fileName or by startsWith prefix)",
+ "Pah entry" );
Review Comment:
typo. `Pah entry` is a medical term likely ¯\_(ツ)_/¯
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970801687
##########
src/main/java/org/apache/maven/buildcache/BuildCacheMojosExecutionStrategy.java:
##########
@@ -104,9 +106,9 @@ public void execute( List<MojoExecution> mojoExecutions,
mojoExecutionRunner.run( mojoExecution );
}
cacheState = cacheConfig.initialize();
- if ( cacheState == INITIALIZED )
+ if ( cacheState == INITIALIZED || skipCacheLookup )
{
- result = cacheController.findCachedBuild( session, project, mojoExecutions );
+ result = cacheController.findCachedBuild( session, project, mojoExecutions, skipCacheLookup );
Review Comment:
right now cache could be accessed when no initialized it seems
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] AlexanderAshitkin commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
AlexanderAshitkin commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r970822683
##########
src/main/java/org/apache/maven/buildcache/CacheControllerImpl.java:
##########
@@ -153,37 +154,50 @@ public CacheControllerImpl(
@Override
@Nonnull
public CacheResult findCachedBuild( MavenSession session, MavenProject project,
- List<MojoExecution> mojoExecutions )
+ List<MojoExecution> mojoExecutions, boolean skipLookup )
{
final String highestRequestPhase = CacheUtils.getLast( mojoExecutions ).getLifecyclePhase();
if ( !lifecyclePhasesHelper.isLaterPhaseThanClean( highestRequestPhase ) )
{
return empty();
}
- LOGGER.info( "Attempting to restore project from build cache" );
+ String projectName = getVersionlessProjectKey( project );
ProjectsInputInfo inputInfo = projectInputCalculator.calculateInput( project );
final CacheContext context = new CacheContext( project, inputInfo, session );
- // remote build first
- CacheResult result = findCachedBuild( mojoExecutions, context );
- if ( !result.isSuccess() && result.getContext() != null )
+ CacheResult result = empty( context );
+ if ( !skipLookup )
{
- LOGGER.debug( "Remote cache is incomplete or missing, trying local build" );
- CacheResult localBuild = findLocalBuild( mojoExecutions, context );
+ LOGGER.info( "Attempting to restore project {} from build cache", projectName );
- if ( localBuild.isSuccess() || ( localBuild.isPartialSuccess() && !result.isPartialSuccess() ) )
- {
- result = localBuild;
- }
- else
+ // remote build first
Review Comment:
could you please change this comment to something like `Published to central repository build first`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972094842
##########
src/main/java/org/apache/maven/buildcache/DefaultNormalizedModelProvider.java:
##########
@@ -123,10 +127,16 @@ private List<Plugin> normalizePlugins( List<Plugin> plugins )
{
Plugin copy = plugin.clone();
List<String> excludeProperties = cacheConfig.getEffectivePomExcludeProperties( copy );
- removeBlacklistedAttributes( copy.getConfiguration(), excludeProperties );
Review Comment:
@AlexanderAshitkin the code is still there - just after debug output
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] eltsovalex commented on a diff in pull request #24: [MBUILDCACHE-22] added possibility to skip cache lookup per project or globally
Posted by GitBox <gi...@apache.org>.
eltsovalex commented on code in PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24#discussion_r972139469
##########
src/main/java/org/apache/maven/buildcache/checksum/MavenProjectInput.java:
##########
@@ -819,4 +833,22 @@ public int compare( Path f1, Path f2 )
}
}
+ public static boolean shouldSkipCacheLookup( MavenProject project )
Review Comment:
@AlexanderAshitkin fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [maven-build-cache-extension] gnodet merged pull request #24: [MBUILDCACHE-22] added flag to force rebuild per project or globally
Posted by GitBox <gi...@apache.org>.
gnodet merged PR #24:
URL: https://github.com/apache/maven-build-cache-extension/pull/24
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org