Skip to content

Do not create an empty commit when generating report #527

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

Closed
timtebeek opened this issue Nov 4, 2022 · 4 comments
Closed

Do not create an empty commit when generating report #527

timtebeek opened this issue Nov 4, 2022 · 4 comments

Comments

@timtebeek
Copy link
Contributor

Describe the bug
When I create a report to inform myself of the steps needed for a migration, an empty commit is created and added to the git history. As a user this is quite surprising; I would not expect a report generation that does not yet make any code changes to add anything to my git history. Perhaps that's intentional, but I'd thought to mildly challenge that here, as it makes the report generation more widely applicable if it does not create any git changes (yet).

To Reproduce
Steps to reproduce the behavior:

  1. git clone [email protected]:spring-projects-experimental/spring-boot-migrator.git, currently at 21fce4d
  2. cd spring-boot-migrator
  3. ./mvnw install -DskipTests
  4. java -jar applications/spring-shell/target/spring-boot-migrator.jar
  5. scan ../any-other-project
  6. apply --recipeName boot-2.7-3.0-upgrade-report2

Expected behavior
Only a generated report; no new commits added to the repository.

Instead I see a new commit:

SBM: applied recipe 'boot-2.7-3.0-upgrade-report2'

Desktop (please complete the following information):

  • OS: Ubuntu 2022.04
  • Version 21fce4d
@fabapp2
Copy link
Contributor

fabapp2 commented Nov 8, 2022

@timtebeek Hm... I agree that an empty commit is useless and should be fixed. Not sure if I agree that no commit at all should be created. But I'm Interested in your reasoning.

@timtebeek
Copy link
Contributor Author

In my view report generation is purely an informative step, to better judge any follow up code charging steps to take after that. The reports do not yet make code changes, and it's unlike that you'd want the report to be added to the repository. Hence why I would not yet expect a commit on the active branch, much less an empty commit at that.

Perhaps there'd be some value if the report commit is on a separate branch. But when users have the main branch checked out and generate a report, they could be surprised to find a new empty commit on the main branch, which typically can not be pushed directly for protected branches.

ashakirin added a commit to sanagaraj-pivotal/spring-boot-migrator that referenced this issue Nov 15, 2022
fabapp2 added a commit that referenced this issue Nov 15, 2022
* Verify commits are only done with actual changes, Closes #527
* Fix wring recipe name in report
* Fix condition for action in paging and sorting recipe

Co-authored-by: Fabian Krüger <[email protected]>
Co-authored-by: Sandeep Nagaraj <[email protected]>
@fabapp2
Copy link
Contributor

fabapp2 commented Nov 16, 2022

Hi @timtebeek
we reworked the Spring Boot Report from ground up. The shell is history for report generation (recipes and report generation should still work though) and will be (see branch webapp-demo) replaced with the HTML report that allows applying recipes from the report. the empty commit problem has been fixed in this branch. Using the Shell will currently still create a commit but when using the new report capability there are no commits for the generated report.
I like the new approach a lot and could see this replacing the shell completely over time.

@timtebeek
Copy link
Contributor Author

Sounds promising! Glad to hear the issue is resolved on a branch. Feel free to already close this issue. I'll have no way to check until January. :)

fabapp2 added a commit that referenced this issue Nov 22, 2022
fabapp2 added a commit that referenced this issue Jan 31, 2023
* Spring Boot 3 Upgrade Report Web App
* Section gets removed when running recipe succeeds, closes #551
* Move report generation into runner
* Add button and change Controller to accept all applicable recipes
* Commented out all code related to "run all recipes" button
* Section fades out before being removed
* Related section in sidebar fades out and gets removed
* page scrolls to the next section
* Moved add milestone repository for dependencies and plugins to dedicated recipe
* Moved dependency version updates to dedicated recipe
* Moved dependency version updates to dedicated recipe
* Moved recipe for javax to jakarta package change to dedicated recipe
* Moved recipe migration of spring.data properties to dedicated recipe
* Moved recipe for PagingAndSoprtingRepository to dedicated recipe
* Moved new Spring Boot 3.0 upgrade recipes to dedicated dir
* Renamed Helper to something meaningful and fixed condition
* Added missing properties to applicaiton.properties to enable git support
* Replaced tags with pinned sha for GH actions
* Prevent empty commits, closes #527
* Move ImprovedConstructorBinding into dedicated recipe and fix condition
* Fix condition for PagingAndSorting migration
* Fix condition for migrate jakarta packages migration
* Adjust replace button in SpringBootUpgradeReportTestSupport
* Rename report recipe
* Fix conditoon for PagingAndSortingHelper and use in migration
* Add withBootParentOf to TestProjectContext
* TestProjectContext supports creating pom.xml with spring*boot*parent of given version
* removed unused variable
* Fixed recipes names (#555)
* Fixing PagingAndSortingHelperTest conforming to new finder (#556)
* Add recipe to remove image banner, closes #558
* Fixing TestProjectContext when used to create a multi*module project
* Enhance PomBuilder to throw exception on API misuse
* Enhance RecipeTestSupport to use with declarative rewrite recipe
* Fix type check in ConditionDeserializer
* Moved recipes for Boot 2.7 to 3.0 upgrade to respective dirs
* Add report section and recipe to bump boot version to 3.0
* Add a flag to not re*generate report on first request
* Enhanced DependencyHelper and TestProjectContext to allow adding managed dependencies without given version
* Add upgrade dependencies report and migration
* Fix typo
* Renamed rest*service to spring*boot*upgrade
* Fix BannerSupportReportSectionTest
* Remove freemarker markup from expected output fixes SpringMvcAndWebFluxMatchinChnagesReportSectionTest
* Replace ST parsing with string replace
* rework rendering the list of authors
* Add demo for new Spring Boot Upgrade report
* Set triggermesh flag to false on test teardown
* Moved report recipe to report package (again)
* Delete obsolete file

Co*authored*by: ashakirin <[email protected]>
Co*authored*by: Sandeep Nagaraj <59915704+sanagaraj*[email protected]>
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