Hello. My name is Stévan Le Meur, and I'm product manager for CodeReady Workspaces.
This video is a recording of an overview demo introducing Eclipse Che
or CodeReady Workspaces. To start, I am in this repository. [https://github.com/che-samples/web-java-spring-petclinic]
This is a very basic sample for a web Java Spring application.
Nothing fancy here, but if I want to set up this project in a traditional tool,
I have a bunch of stuff that I need to install. I need Maven, I need Java, and a bunch
of other things before I'm able to start to build the project,
to run it, and contribute back to the original code base.
Usually you will find all the instructions to get started in a README file.
What we did here was replace all the instructions with a button.
If you click on this button, it opens a new tab with a link
to a factory URL for Eclipse Che. And this
factory URL has all the instructions that are needed
to replicate the developer workspace. Inside the developer workspace
is all the dependencies that are needed in order to build,
code, run, debug, and test the project.
With Eclipse Che, all the runtime dependencies are packaged inside containers.
What's happening here is that the containers are being pulled
and the tools are getting started inside the containers.
This allows you to interact with the source code from the browser-based IDE.
As the IDE loads in the browser, it clones the source code
and starts the Java tooling. Now I have a terminal, I can type directly
within my container and interact with my source code directly from there.
You can see that the IDE starts to import all of the Maven dependencies that are needed for this project
based on the pom.xml file. So it will download the dependencies and resolve them.
You can see the pom file here. Once the first import is done, I can explore the source code.
I can see the different packages and the classes within them. If I double-click
on the tab, I get a bigger view of the file. I can also remove the sidebar
to focus on the code if I want. This is basically out of Che,
so the editor provides code completion, as you would expect from an IDE.
I can also navigate to the definition of a class if I want,
and of course I get refactoring, renaming,
and move capabilities as well. So now what I want to do is to build my
project. I have a build and run button that invokes a command that is defined for me
to build and run the project. Let's start that command. It starts a new process
inside the container. It does a mvn clean install and it also
takes the result of the build, the WAR, and deploys it
into the Tomcat server that is built in to my container.
Once the build and run command is complete, I can click this link
to see the application running. That's pretty cool.
Now what I want to do is make some very basic changes. As you can see, as I change a file
the filename turns blue in the Project Explorer. The IDE is integrated with git,
so you can do a commit here. I'll add a comment, "Just basic changes,"
then click the Commit button. That shows me the output of the commit.
Of course, if you are more familiar with the terminal, you can go directly into the folder of the project
and do a git status. This shows you the status of the repository.
You can do many things from here. If you want,
you can do a vi of the README file, you can open another terminal and do a
top to see the list of processes that are running, and you can even
do an mc just for fun and get Machine Commander.
So now my application is running, but I think there is a problem in the method findOwners.
Let's browse the list of all the owners. I can see that I have Betty here.
If I go back and search for Betty, nothing is found.
What I would like to do is debug this simple application. So let's go into my source code and into the
ClinicService file. Here is the findByLastName method.
But what I'm going to do is set a breakpoint in the processFindForm method in the
OwnerController class. Now I need to stop the running
application and restart it in debug mode. Clicking the Debug button lets me invoke the debug command.
Here the application is up and running, but I need to connect the debugger.
I'll go to the menu Edit Debug Configuration and click Remote Java item in the list.
The debugger connects to the running process and my breakpoint
is now activated. So let's go back to the application,
go to the Find Owners page, and search for Betty.
You can see that my application is in wait mode,
and in the editor, I can also see the application is stopped
at the breakpoint I set. From there,
I can inspect the variables, the processes, the frames,
everything I need to debug the application is here.
So those are the basic features of Eclipse Che.
At this point I have been able to run my code, and I have been able to debug it.
So now I want to contribute back to the project.
So I make a small edit to the README file and then open the Pull Request panel.
The Pull Request panel automates the flow of creating the pull request.
What I'm going to do first is create a new branch. I will name it New Pull Request Demo.
The branch has been created in the local clone of the repository,
and now I will click on the Create Pull Request button.
Che checks if I have changes in my local repository that are not committed.
If have not committed my edits inside the README file, so I will commit my changes.
What Che does next is check if I have a fork of that repository
on GitHub. Without one, it creates one, and it pushes my local branch
to my fork on GitHub. That's what happened here.
So once my branch is pushed on my fork, Che will issue the pull request.
I can open the pull request in GitHub in a browser.
As you can see in the comment of the pull request, there is a button that
allows the owner of the project to preview the changes that I just proposed with my pull request.
By clicking on that button, it will open Che, and it will allow anyone who wants to
review the pull request to not only see the changes in the source code, but
also test them in the same environment as the one that I used.
So this makes collaboration with everyone on my team much simpler
and more accessible for anyone who's working on the project.
So that's how you can streamline the flow of contributing to a project, and how you can be
much more efficient when you are collaborating with your team. Not only with the developers, but all the stakeholders
who are working with you. That wraps our tour of Eclipse Che,
I hope you enjoyed the tour, and I hope you will try Che for yourself. Thanks for watching!