-
Notifications
You must be signed in to change notification settings - Fork 356
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
WIP: Fixing the estimated saved time in the gradle wrapper upgrade #4854
base: main
Are you sure you want to change the base?
Conversation
Moving the change to the markers to a different recipe which returns 0m as the estimated saved time
999b209
to
d3ae411
Compare
String gradleWrapperVersion = getGradleWrapper(ctx).getVersion(); | ||
VersionComparator versionComparator = requireNonNull(Semver.validate(isBlank(version) ? "latest.release" : version, null).getValue()); | ||
int compare = versionComparator.compare(null, currentMarker.getVersion(), currentMarker.withVersion(gradleWrapperVersion).getVersion()); | ||
if (compare > 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both the UpdateGradleWrapperFiles and UpdateGradleWrapperMarkers class have to run this check to avoid doing duplicate work. I'd prefer to move this into the UpdateGradleWrapper, but I'm uncertain if we can do that
} | ||
|
||
@Override | ||
public String getDescription() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the name and description of this class, I'm not certain how to different it in a meaningful way to users you aren't familiar with the implementation. Is there a way we can add the recipes to the jar but not have the available to be executed directly?
} | ||
}; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} |
} | ||
}; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} |
} | ||
}; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My inclination is to try and make a more general fix for time estimates. Rather than refactor every marker-update into a zero-estimate recipe have the effort calculation omit marker-only changes.
* @return Zero estimated time. | ||
*/ | ||
@Override | ||
public Duration getEstimatedEffortPerOccurrence() { | ||
return Duration.ofMinutes(10); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment says 0, code says 10 minutes
What's changed?
Do not take into consideration changes which are made is association with updating the markers.
What's your motivation?
Currently the saved time in the Gradle wrapper recipe much larger than it should be