Isn’t the end, it’s just the beginning – Google Summer of Code 2016

Well, in October of 2015, I meet KDE in Latinoware. Latinoware is one of the big events about free software in latin america. Since them I had the opportunity to join KDE, to meet the Brazilian and international community and this crazy guy called Tomaz Canabrava.

Tomaz hassled me into submitting a project to Google Summer of Code, a project that until then I had never heard of in my life. KDE was chosen to be one of the communities to be able to host students and projects for KDE entire environment be improved.

I was thinking in what kind of project submit. At the time I was working on a new version of Br-Print3D, that is my project related to 3D printing, and if you keep reading my posts, in the near future some news related to the project is coming.

But I got scared, I wasn’t sure if I would have the balls to learn QML and others Qt tools to be able to do what I was thinking.

However, a few weeks before this I started to use Umbrello, the UML Editor of KDE, and at the time I was using Fedora 23, with Plasma installed, but didn’t realize that the installation of Plasma and the previous installation of Gnome was in conflict. And Umbrello base colors was messed up, difficulting to use. So I downloaded the source code, to try to fix that. But them I realized that the issue was with the installation of the above desktops, and one week later I changed distro to use ArchLinux, that is my current distro. Installed only plasma, and all bugs that I was having in Fedora wasn’t happening with me anymore.

In that first look at Umbrello source code, I saw a lot of things that could be improved, so I wrote my first patch to send to some updates related to the use of signals and slots that were deprecated. A few weeks later was the week to submit projects to Google and the communities, was March 14.

So what I should do? What KDE project I could help? Well, since I had some history with Umbrello, why not? So I reached out the current maintainer, said to him what I was thinking to do, what could be good for the project, and in 2 days I was able to build this project: Umbrello New Breath

Well, I submitted and need it to wait until April 22 to the result, and them…

Screenshot_20160816_175636
I was selected! \o/

And that was a good day, when I saw my name there, I started to jump, celebrating this opportunity.

The currently maintained is Ralf Habacker, and I got the lucky to have Jonathan Riddell like mentor too. Jonathan was the guy the second maintainer when Umbrello started, and I felt honor in be chosen for him.

My project has 4 tasks, that now I will show to you, each one with my summary of the task, difficulty, and experience. One point: Forget the timeline that I set up on the project xD

Remove Deprecated Code

On this activity, my goal was to remove all the deprecated code related to using of Qt 4 and KDE Libs 4 in Umbrello.

This task took me 2 days to do it. And you can see the commits here.

MsWindows build – Fix issues

The only motive that Umbrello still use Qt4 and KF4, is because of MsWindows. So one of my goals was to use this clean branch that I removed the deprecated code, and compile on MSWindows and discover the issues.

To be honest with you, Ralf, said to me that if I wanted to remove the deprecated code I need it to handle some of the MsWindows bugs. But the few bugs reported on bugs.kde.org, don’t have enough information to see if the bugs are caused by a KDE API, or Qt, or of Umbrello itself.

And, I’m a programmer for almost one year, I still need to learn where to look. Ralf said to me to start work with this task, not the others ones that could be easier. And I like to follow directions. Today, I know that I was wrong. How to fix problems, if you don’t know where to look? If you don’t know the code?

I spent more than two weeks to set up the MsWindows cloud machine, that Riddell gave me access to work. You can find a previous post mine about that task here.

Emerge is a nice tool, but all KF5 needs to be compiled, and that, even with a cloud machine, spent more than a day, some errors happened, but I was able to correct them or move on with small changes on the configurations. You can check this post for more info on how to build KF5 for MsWindows.

In the end, I was able to compile the branch frameworks of Umbrello, that is the work branch for Qt5 and KF5 API’s. In my mind at the time that Ralf said to me that was having issues with the build on MsWindows environment, I thought that was compile errors, not further errors. So after that, I didn’t work on this task anymore. Again: I didn’t know where to look (Newbie here o/).

Work on Wishlist

For this task, I choose 2 bugs, on Umbrello wishlist, that I though that could bring some new features and improvements to the old code. This bugs also had big votes to be implemented.

Bug 60452 ­ – Missing keywords for declaring operations and variables

This bug is related to some missing keywords on the datatypes for Umbrello, and others C++ Modifiers and Qualifiers. It’s a bug from 2003, and I had a lot of work to implement it. I think that this task took me a month and a half to fix it.

You can see the diff of the new cpp keywords here and my Review Request on this link.

Also, some of the keywords, are registered like Type Qualifiers, types that give a new plus to the variable. Like: Mutable, Const, Volatile and Const Volatile. You can check this qualifier and what they do here.

This Type Qualifiers, can’t be considered a type, so I needed to implement a new widget to handle them. The issue at the time was that most of the Dialogs in Umbrello are made by code, being very restricted and hard to add new things. Like add a new widget in the layout, see if the layout would break or not, adjust the size and all sort of problems related to layout issues.

So, was a good decision transform this dialog, that was build in time of execution, to UI files that are compiled with the code. In that part I made a mistake, instead of focus only on the Attribute Dialog, that needs it to change to receive a new widget, I started to update the dialogs of: Operation, Template and Entity Attribute. I felt that was the right thing to do, but my mentor didn’t like too much. This part you can check in this blog post, where I do my review about that part of the work.

Also, was a good idea to add one more C++ type, the Type Modifiers, that are the ‘*’ and ‘&’ chars that modify the variable to a pointer or reference. If you search, the real Type Modifiers are the keywords: signed, unsigned, long and short. But in the case of Umbrello, they are listed in the DataType.  And ‘*’ and ‘&’ modify the way that the variable is handled, so it’s considered like type modifiers.

So I spent one month(more or less), to update all dialogs to Ui files. To create the new widgets, and write the code necessary for them. To modify the UMLObject to receive this new type of data.

I had several of layout issues after that, I need it to modify the base widgets for the dialogs to fix them, because in one dialog the layout was broken or ugly, and on the other was fine. Also, I started to follow some guidelines of KDE VDG Group about an alignment of labels and others widgets. You can find the guide here. That is a task that I need to follow up after GSoC, I’m going to work on the others dialogs that don’t follow this guideline.

So, in the end, the Attribute Dialog ended up like this:

Screenshot_20160817_112058

 

Since I had this issue when I started to make a lot of changes, “unnecessarily“, the Review Request grow too big, my mentor Ralf, complained a lot, but there’s nothing that I could do. But in the end, the review of this work was made by Riddell, in the Umbrello mailing list, were, in the end, discovered one new bug in Umbrello, that I reported here. I remember to add some code at the time, to attempt to fix the bug, but I was waiting for the answer of Ralf, to see what was the best to do.

This part of the work, was hard, but was the part that allowed me to know Umbrello code, and helped me in the others tasks. There’re some things, like the final string with DataType + Qualifiers + Modifiers, that isn’t good. I need to put more safeguards, to don’t mess up with the string, and when to load the string again, breaking apart the 3 types, to load the specs in the right widgets.

However this problem, and like others situations that I have on Umbrello, make me worried, because I don’t know if the code that I write is good if is the best way to do it. Sometimes I felt that I’m only “making run”, not doing the good code that I think is possible to do it. Was a feeling that I talked to Riddell and he said to me:

This is how a lot of code is written 🙂

Well, this task was more that I really need it to do. But in the end, Umbrello is more flexible in some parts, the code was improved, and they’re this small issues that need my attention and some help to be fixed. But since my work, will not go to the master branch, for now, I have time to fix them. =D

Bug 123633 ­ New diagram type: Instance Diagram

This bug is related to an implementation of the Instance Diagram, officially know like Object Diagram. Is a bug from 2006, and had a lot of votes on the wishlist to be implemented.

And Object Diagram is like a snapshot of the system in a determined time, with Objects from the Classes and attributes with values, linked through associations.

I followed the directions from this site.

This is a task that I’m working on the past 4 weeks. The initial idea was based this diagram in the Class Diagram, since the two has similarities. Damn, I couldn’t be more wrong.

Well, I based all the idea to the Class Diagram, and I had my Object Diagram to be shown, and test it. But I need it to refine, to remove all the features that the Object Diagram don’t support. And was at that point that a lot of problems start to happen. Use all the classes of Class Diagram wasn’t good, some specs to the Object Diagram couldn’t be made. That made me create 3 or 4 classes to handle specifics of the Object Diagram.

Click here to see the branch of this work.

After a lot of days working, I was able to create the Diagram, with it instances and associations, also like add attributes and values, that is mandatory for this Diagram.

Snapshot of the Object Diagram
Snapshot of the Object Diagram

Today, some things don’t work. Like clicking the right button and try to edit the name of the Object. I was trying to follow the idea of the Object Class, that Umbrello implements to the Sequence Diagram, but didn’t work. I’m waiting for the review to see what I can do.

Also, the Instance object don’t resize to fit the Object + Class string, still need to figure out what method I need to call to resize the Instance.

The Review Request of this work is at this link.

This task is 90% done, I have 3 small bugs, but isn’t bugs that affect the use of the Diagram.

Following the directions of my mentor, Riddell, I merged this work in the frameworks-GSoC branch, in Umbrello official repository.

Yesterday(08/18/2016), I spent all my day fixing the save/load of XMI files in the Object Diagram, in the end, I was passing a string wrong in the parameter, load some properties in the Object Diagram wasn’t saved and load correctly. It’s hard to understand a code that in one method handle 3 or 4 things indirectly, and find that logic to fix it was hard, but I got it. Now everything is working just fine. \o/

If you want to check the XMI of the Class and Object Diagram files you can click here for the Class and here for the Object.

Conclusions

Well, during this 3 months of GSoC, I learn it a lot. I did the best that I could do with my knowledge and help from Riddell, Tomaz, Oliver and Ralf.

I don’t know how much I can be honest here. But Riddell and others people inside KDE know that I had some problems during this GSoC, and my depression didn’t help much, and that made me don’t work for a couple of weeks. In that weeks I was traveling to some events, and when I got back home, the depression put me on the ground and was hard to find strength to get up. I made a post about it, you can check here. But I found the strength, and here I am.

I can say that my work is 90% concluded. There’s still some revision to be made, some code to be clean up. And I’m doing that.

I don’t like to not deliver the results that I put for me. To don’t deliver the goals that I wrote on my project. But there some things in your life, that you depend on others persons, I don’t like it, but I can’t run from it. And that happened on my project. But thankfully, Riddell got my back and I’m delivering almost everything that I promise. And for that, I’m really thankfully to you Jonathan Riddell.

Useful Links:

Blog posts about GSoC

GitHub with my work

Google Summer of Code Project

Work on GSoC, opened many doors for me, make me think in my career and what I want for my future. GSoC changed a lot of lives, and for sure changed mine. 🙂

that_s_all_folks__by_surrimugge-d6rfav1

 

 

Advertisements

4 thoughts on “Isn’t the end, it’s just the beginning – Google Summer of Code 2016

    1. Oops, just want to clarify, I don’t mean that there’s anything wrong with you for feeling the way you did, but rather that if a process isn’t healthy for the participants in any way, I mean that’s a bug.

      Liked by 1 person

      1. Hi Michael!
        Thanks for the feedback and support! 🙂
        A lot of things in my life I can consider that is a bug, now I just need to fix them xD
        Bye!

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s