Skip to content

feat: Call copilot init feature when starting from an empty app - #18749

Merged
Artur- merged 4 commits into
mainfrom
copilot-init-app
Feb 27, 2024
Merged

Artur- merged 4 commits into
mainfrom
copilot-init-app

Conversation

@Artur-

@Artur- Artur- commented Feb 19, 2024

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Feb 19, 2024 •

Copy link
Copy Markdown
Contributor

Test Results

1 094 files  ±0  1 094 suites  ±0   1h 19m 12s ⏱️ + 2m 41s
6 932 tests ±0  6 884 ✅ ±0  48 💤 ±0  0 ❌ ±0 
7 280 runs   - 8  7 220 ✅  - 8  60 💤 ±0  0 ❌ ±0 

Results for commit 3919c3e. ± Comparison against base commit 0a82372.

♻️ This comment has been updated with latest results.

@Artur-
Artur- marked this pull request as ready for review February 22, 2024 10:50
@Artur-
Artur- requested a review from mshabarov February 22, 2024 15:42
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@mcollovati mcollovati left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I tested both Flow and Hilla view generation and got source code generated, but I noticed the following (perhaps expected?):

  • starting application from the IDEA, after creating Flow view, the server is restarted, browser page is reloaded, and I can see the new view
  • starting application from the IDEA, after creating Hilla view the server is not restarted, the browser page reloads, but still NoRoutesError_dev.html is shown. After manual restart, I can see the view.
  • starting application with mvn from terminal, server is not restarted neither for Flow nor for Hilla view. After manual restart, I can see the view

@Artur-

Artur- commented Feb 23, 2024

Copy link
Copy Markdown
Member Author

starting application from the IDEA, after creating Flow view, the server is restarted, browser page is reloaded, and I can see the new view

Sounds like this is working as it should

starting application from the IDEA, after creating Hilla view the server is not restarted, the browser page reloads, but still NoRoutesError_dev.html is shown. After manual restart, I can see the view.

There might be several cases here and I am not sure which one you had or what project you started from:

  1. If you have an empty project from start.spring.io then it does not even have spring boot dev tools and will not restart at all automatically.
  2. If you have an empty project + dev tools then it should restart automatically as a Theme annotation is added to the application class
  3. If you have a project that already has a theme, it is possible that it does not change any Java files and that Flow will not pick up frontend changes as it is running with a dev bundle(?)

starting application with mvn from terminal, server is not restarted neither for Flow nor for Hilla view. After manual restart, I can see the view

This also depends on the case. If you don't have any IDE running, then nothing will compile the files and no restart will take place.

@mcollovati

Copy link
Copy Markdown
Collaborator

I created a test project with npx @vaadin/cli init --empty my-app and removed the example view.
I'll test again, removing also the theme stuff.

@mcollovati

Copy link
Copy Markdown
Collaborator

Starting with an application without a theme and creating a Hilla view works, but it took three restarts.
After the first one, the page was reloaded showing the NoRoutesError_dev.html, then after a couple of seconds (and two restarts) I could see the "frontend build" page and eventually the Hilla view.

@Artur-

Artur- commented Feb 26, 2024

Copy link
Copy Markdown
Member Author

Indeed, it is not optimal but a start

@mcollovati

Copy link
Copy Markdown
Collaborator

It would be nice to improve NoRoutesError_dev.html telling the developer that the action make take a couple of seconds, and that the server should be manually restarted if not running from IDE (or if nothing happens after e.g. 5 seconds)

@Artur-

Artur- commented Feb 26, 2024

Copy link
Copy Markdown
Member Author

Yes, but I think those changes should go on the copilot side. Similarly to how it adds a message if you don't have spring boot dev tools in the project

@Artur-
Artur- merged commit 89b1a03 into main Feb 27, 2024
@Artur-
Artur- deleted the copilot-init-app branch February 27, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants