OBOFoundry / OBO-Dashboard

Summary Dashboard for Open Biological and Biomedical Ontologies
http://dashboard.obofoundry.org/
18 stars 3 forks source link

Add contributor guide #90

Open cthoyt opened 1 year ago

cthoyt commented 1 year ago

Related to https://github.com/OBOFoundry/OBOFoundry.github.io/pull/2392/files, I would like there to be some documentation on how I can add new checks to the dashboard. Right now, the layout of this repository is really hard to understand, with minimal documentation and code quality standards. These make it harder to contribute.

This comes back to https://github.com/OBOFoundry/OBO-Dashboard/issues/54 as well. I am happy to take care of this, assuming I can figure out what's going on in this repo, but that's not a given from how it looks to me now

matentzn commented 1 year ago

Thanks @cthoyt I agree we should do this;

@anitacaron

This is what I think we should do:

The steps to achieve the custom check section should roughly be this:

The one thing I do not want to happen (so we need to find a more smart solution for this) is to parse the ontology with ROBOT again during the "custom checks".

@cthoyt do you just want to be passed a ROBOT JNI instance and work of that in that section?

  1. Add a module to the dashboard for custom checks (separate custom_checks.py file)
  2. All the current code remains as is and should not be touched by external contributors
  3. during dashboard.py, you add a new section, that basically iterates through all tests in the custom_checks.py file.
  4. On the table, you add a new column with Other
  5. You loop through the checks generated by the custom_checks section, and add generate a respective page with the results
  6. (use the "robot template" column as a solution).
cthoyt commented 1 year ago

I have zero interest in learning how to use java tooling or spending my time with python wrapped Java objects. If you can produce an OBO Graph JSON I can work with that is available throughout testing, this is great. Otherwise, I will make one myself.

Also, I really don't want to touch any code that already exists in this repo. I can help produce a "registry pattern" that automatically discovers code and applies it in an elegant way to enable this.

Not really sure about steps 3-6. I guess you will have to give examples

matentzn commented 1 year ago

I can help produce a "registry pattern" that automatically discovers code and applies it in an elegant way to enable this.

Ok, but dont code anything yet - just say how it would roughly work first, so we can think of an folding it in.

cthoyt commented 1 year ago

I can do this after I understand how the repo works, which I will be able to do after someone writes an explanation

matentzn commented 1 year ago

It is a bit complicated to explain how it works, because of the deployment.. If you want a comprehensive explanation, it will take weeks, if not months, because we have too much of a backlog right now;

The key part is:

https://github.com/OBOFoundry/OBO-Dashboard/blob/master/util/dashboard/dashboard.py#L207

Every check is a method that "runs the check", and the results are written to some dictionary afterwards. We need to create something like this that is easily extensible for custom checks.