Nestling: a pijul frontend a la cgit


#1

As some of you may have noticed, I have started to work on a pijul frontend “a la cgit” a few days ago. You can found it on the Nest and I am planning to use the Nestling to browser the Nestling as soon as possible (this is so meta).

Of course, the Nestling is not an opponent of any sort of the Nest, which still is the best tool available to collaborate to write a software with pijul. The Nestling is a read-only front-end and nothing more.

Current Features

Server

The server is written in Rust using rocket.

  • ndrc.toml file for configuration
  • One server, multiple repositories
  • Several GET routes
    • one to get the list of repositories
    • one to get the list of branches of a given repo
    • one to get the list of patch hashes of a given branch of a given repo
    • one to get the patch info of a given hash

WebUI

The webUI is written in Purescript using Halogen.

  • A view to list the patches of a repository, with a branch selector
    • Rely on avatar to display a picture of an author
    • A patch can be selected to display only its dependencies

Future Work

There are still a lot of work to do. Before a first v0.1, I am planning to add a view to list the repositories and a view to visualize a patch alone. In a v0.2, I will tackle files browsering. Then, I intend to play a little with metrics of all sort.

The project is GPL3, so if you’d like to contribute, feel free to ping me on the #pijul irc channel.

Pictures

Patch Dependencies


#2

I just updated the nestling README. You now have a how-to setup a nestling instance.


#3

So I just did pijul clone laumann@nest.pijul.org:lthms/nestling (no problems there) and did:

$ make
make[1]: Entering directory `/home/tj/pijul/nestling/nestlingd'
../print.mk:3: *** commands commence before first target.  Stop.
make[1]: Leaving directory `/home/tj/pijul/nestling/nestlingd'
make: *** [daemon] Error 2

I have all dependencies (AFAICT) - what am I missing?


#4

If I uncomment the include ../print.mk line in nestlingd/Makefile it seems to work…

EDIT: Also in nestling-ui/Makefile. Maybe my problem a too old make (I’m on 3.81)?


#5

Does it work if you call make from the the root of the repository?


#6

No, that’s what didn’t work. Just removing the include ../print.mk lines made it work though (and I needed to install bower)


#7

That’s strange, I will need to investigate somehow. That being settled, you were able to make it work?


#8

My version of make may be too old (3.81). I got it running, but having some trouble with the cross-site thing - I tried Firefox and Chromium (the former with the CorsE add-on), but no luck so far.

Otherwise both the UI and backend seem to be running nicely :slight_smile:


#9

Screenshot of nestling running on my machine

I still need to figure out the XSS/CORS thing…


#10

Can you copy paste both your ndrc.toml and you api-infos.json?


#11

Sure:

nrdc.toml:

title = "My Nest"

[repos.nestling]
name = "nestling"
path = ".."

and api-infos.json:

{
  "base": "http://localhost",
  "port": 8000,
  "mount": ""
}

#12

And what does the javascript console say?


#13

The console

BranchSelector: fetching branches now
PatchesList: fetching patches now
:8001/#r/nestling/branch/master:1 XMLHttpRequest cannot load http://localhost:8000/repository/nestling/branches. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8001' is therefore not allowed access.
Uncaught Error: AJAX request failed: GET http://localhost:8000/repository/nestling/branches
    at XMLHttpRequest.xhr.onerror (nestling.js:10842)
:8001/#r/nestling/branch/master:1 XMLHttpRequest cannot load http://localhost:8000/repository/nestling/branch/master/patches. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8001' is therefore not allowed access.

#14

Sorry for the late response.

I am pretty sure you have an issue which is CORS-related. This is really annoying and I really need to dig this. For the record, I have cleaned my repository on the nest. I had some issue with duplicated patches and probably vicious unrecords but everything is fine now.

Hope I will be able to make some progress on nestling really soon.