Project Summary @GSoC'20
StarFix: Simplifying The Devflow
(the developer,that’s me)
@Max Rydahl Andersen
GSoC is more than just an open source program. It gives wings to your ideas and let you bring them to reality. It’s focussed around ideation and innovation. You’ve found a real life problem and want to solve it?GSoC is the best place to make it happen OR you’ve got ideas to improve the existing technologies? Simply propose your ideas,convince the organizations that you can make it happen and then get yourselves funded by Google and mentored by the most esteemed organizations of this world. Yeah thats one of the best parts of GSoC other being the exposure you receive while working with such experienced and senior developers.(Offcourse the handsome stipend you receive is an awesome part as well).
The Awesome Mentor
I never even dreamt of being mentored by a Distinguished Engineer at Redhat. And the way he mentored me was more than I ever expected. As an undergrad I was quite a newbie to Software Developement(I knew some but here I felt like a noob) and little did I know about SDLC. But Max never let that thing affect my performance and output. To bridge the gap he regularly gave me appropriate examples to refer and resources to go through. There were things I didn’t ever know before but I learnt them and implemented them in a very short period of time(I had never ever setup CI/CD from scratch before, nor I ever wrote Units Test in JUNIT5). Apart from being very friendly he is also flexible, highly intellectual and open minded. He always gave space for my thoughts and ideas,and was always open to discussion on the choice of technology and methodology I should proceeed with, thus helping me clear even the smallest of my doubts.
Max is supercool and just Awesome.
Would it not be nice if..
You could open your IDE on any file from any app?
Open a repository/file from a browser in your editor of choice?
Start a debugger locally from your web browser?
StarFix is a cross-platform client-side application that would let you open a file in Editor of your choice (vscode, eclipse, intellij, emacs, vi, etc.) and other commands locally directly from the browser or file system. This will enable an option to “Open in IDE” through browser extension on various websites like Github, Gitlab, etc similar to the one you see in this demo below.
“Open in Desktop” on Github offers a feature to open the repository in Github Desktop. Its issue is that it is Tied to one vendor and locked to a single tool. StarFix on other hand overcomes all those limitations and offers you to open up the repository in the Editor of your choice directly from the Browser on multiple sites(Github,Gitlab).
Native Executable with Quarkus
The StarFix Native Binary is built as a native executable with Quarkus. The reason for going with this is that anything other than this(like node or python bound)would require additional setup. On other hand Java or Native is something that can be shipped fairly lightweight. Furthermore we need a cross-platform application(Linux,Windows and MacOS). Thus Quarkus was the best choice.
StarFix uses a
.yaml file to store user configurations. Currently it stores the preferred editor/ide and the preferred cloning path.
Custom Protocol Handler
The operating system has to be informed how to handle protocols. By default, all of the current operating systems know that
http should be handled by the default web browser, and
mailto should be handled by the default mail client. Sometimes when applications are installed, they register with the OS and tell it to launch the applications for a specific protocol.We wanted to set up a type of link where if a user clicks on it, it will launch the StarFix application. Instead of having
http as the prefix, we need to designate a custom protocol, such as ‘ide’. Ideally we wanted a link that looks like:
ide://some/info/here. StarFix includes a custom URL Handler to handle
ide:// on the user’s machine. Whenever a URI with scheme
ide:// is encountered StarFix app is launched with arguement as the URI. As we have three target Operating Systems we had to adapt different methodology for each one of them. On Windows we have achieved that by modifying the Windows Registry. On Linux this has been achieved by using a
.desktop file . For macOS we’ve created a
.app bundle that is configured to launch our application.
To be able to add an "Open In IDE" button on Web Pages and launching the protocol handler we needed a browser extension. The extension also acts as the integration between web and desktop.The extension has been written with plain
HTML/CSS/JS and supports loading unpacked. It’d soon be published on the webstore making it easier to install for the users.
Starfix is as much a Command Line tool as much an Integrated app. To make the command
starfix ..arguments.. work on the commandline there are differnt methodologies that have been adopted.On Linux and macOS the native executable is moved to
/use/local/bin and being made an excutable it starts working as a CLI. On Windows, the file is moved to a suitable directory in user’s home and then this location is added to the environment variable:
As Quarkus supports JUIT5, we’ve used it for our unit testing
Packaging and Installation
Maven Assembly has been used for packaging. OS specific installers are generated which mainly include the script files that put the binary in place, register the protcol handler and modify system paths.
Github actions has been used for CI/CD. The reason for choosing it is that it’s the simplest and most convenient tool as it comes Integrated with Github and also provide the necessary features. The workflow are configured to trigger build on Pull Requests and Pushing to the master. The necessary artifacts are generated along with it. Creation of draft release on pushing with tags is configured. And Offcourse,on creating releases the workflow are setup to build and generate the the packages for distribution.
Merged Pull Requests
Added Starfish Description
Technology for Development
Core Starfix (The CLI) was built.
Using Fast Jackson for modifying
Tested the native binary to run with arguments successfully
Squashed and meregd by the @maxandersen.
Implements CI with Github Actions for [Starfish Project](https://github.com/maxandersen/starfish/)
Runs on all three platforms (Linux,Windows and MacOS)
Separate jobs defined for Release and Push/PR.
Installs graalvm and native image
Sets version as tag_name(in case of release) and sha (incase of a Push or PR )
Builds native executable
Uploads native executable as assets(in case of Release) and generates artifacts(incase of a Push or PR)
Launching ide on windows(incase of Vscode) had an issue on windows as it needed .
cmdextension to launch.
Now we have made a separate function that checks if the os is windows.
Based on that decision we add or don’t add
.cmd(in case of vscode).
Added tests for
Protocol handler for Linux and Windows added
ide://..scheme and launches up the StarFix application on encountering such scheme.
Added quick commands for running the project
Added reference to command mode in Quarkus
moved mvn/quarkus project to cli folder
updated github workflows
setup workflow that on git tag v* (i.e. git tag v0.0.1) builds and creates a draft release.
Added Relevant Description and a temporary Icon
Help and Troubleshooting: Added Link to HELP Page which will assist user with features and usage of Starfish along with Troubleshooting
Renamed Starfish → Starfix
Windows Installer improved
Tested to run on Ubuntu-20 and Windows-10
README.adocon project source directory for Documentations.
Added Demos,Table of Content, Contribution guide along with other parts of user docs.
moved starfix.cmd to Starfix sub-directory which would then be moved to the user’s home directory.
Tested to work on win-64