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

WIP: Fixing the estimated saved time in the gradle wrapper upgrade #4854

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

lkerford
Copy link
Contributor

@lkerford lkerford commented Jan 6, 2025

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

Moving the change to the markers to a different recipe which returns 0m as the estimated saved time
@lkerford lkerford force-pushed the fixing-saved-time-gradle-wrapper branch from 999b209 to d3ae411 Compare January 6, 2025 21:56
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) {
Copy link
Contributor Author

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() {
Copy link
Contributor Author

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?

}
};
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

}
};
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

}
};
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}

Copy link
Member

@sambsnyd sambsnyd left a 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.

Comment on lines +116 to +120
* @return Zero estimated time.
*/
@Override
public Duration getEstimatedEffortPerOccurrence() {
return Duration.ofMinutes(10);
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants