Git Product home page Git Product logo

modules.raku.org's Introduction

modules.raku.org

These are the scripts to generate the website on http://modules.raku.org/

TODOs

Want to help out? Check if any open Issues exist that you might be able to solve. We also have a list of TODO ideas you might be interested in.

Development

Please use the following steps to aid you in your development:

  • Create a token with access to public repositories. To run the scripts, you need a GitHub token with rights to query Perl 6 module GitHub repository information.

  • Save the token in file named github-token

  • Install prerequisites for build script:

    $ perl Build.PL
    $ ./Build installdeps
  • Run build script
    $ perl bin/build-project-list.pl --limit=<number-of-modules>

You can also create file META.list.local that contains specific URLs you may wish to fetch for debug purposes. Use the --meta-list argument to specify the location of that file. See --help for all options.

  • The build script can start the Mojolicious app that powers the front end of you pass the --restart-app option:
    $ perl bin/build-project-list.pl --restart-app

For development purposes, you can use bin/morbo to power the web app, as it will watch for changes and auto-restart the app.

Changes to database

The build script uses a caching mechanism that avoids fetching extra info for a distro if no commits to it were made. If you made a change that needs to update database information for all dists, include string [REBUILD] (including the brackets) as the first thing in your commit message title. That will clear the cache and cause full rebuild.

If you made a change to the structure of the database, specify [NEWDB] as the first thing in the commit's title, to re-deploy site's database. When testing locally, you can just delete existing database file (the tables will be created by deploy from DBIC automatically).

Browser Support

We support the current and previous major releases of Chrome, Firefox, Internet Explorer (Edge), and Safari. Please test layout changes. Lacking actual browsers to test in, you can use browsershots.org or browserstack.com.

Front-End App

This is the app that reads the database generated by the build-project-list.pl script and displays web pages. See DEPLOYMENT.md

Seeing your changes

Once committed, the production cron job will pick up your changes on the 20th and 50th minutes of every hour. The script can take up to 10 minutes to complete.

20,50   *       *       *       *       sh update-modules.raku.org > log/update.log 2>&1; cp log/update.log /var/www/modules.raku.org/public/update.log

The cron job results can be found here.

If you only made changes to the web app, you can get them live a bit faster by using [REAPP] as first thing in commit message title (including brackets), which will cause the updater to restart the app after pulling and before rebuilding the db (which takes ~1.5hr)

Note About Cache

Certain data is cached by the site and is only updated when some event (like new commits to the dist's repo) happens. This includes travis statuses, logotypes, and Koality metrics. If your changes require doing so, you can trigger a full rebuild of the database and refresh of caches by including [REBUILD] as part of the title of your commit message.

If you are adding a feature that caches something, it needs to watch for FULL_REBUILD environmental variable and refresh the caches if that variable is set to a true value.

Author

Intial version contributed by patrickas++ on #perl6

LICENSE

See LICENSE file for the details of the license of the code in this repository.

This repository also contains code authored by third parties that may be licensed under a different license. Such files indicate the copyright and license terms at the top of the file. Currently these include:

modules.raku.org's People

Contributors

azawawi avatar briandfoy avatar cbvi avatar colomon avatar froggs avatar hankache avatar jasonmay avatar jj avatar jonathanstowe avatar leto avatar lucasbuchala avatar mberends avatar moritz avatar mouq avatar nxadm avatar patrickas avatar raydiak avatar rba avatar s-h-r-i avatar snarkyboojum avatar softmoth avatar stmuk avatar szabgab avatar tbrowder avatar timo avatar titsuki avatar tony-o avatar viklund avatar zakame avatar zoffixznet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

modules.raku.org's Issues

[RESOLVED IN new-db-builder] GitHub Rate Limit of 5000/hr

GitHub has a rate limit of 5000 API queries per hour. We currently make 3 requests per dist and the updater script runs twice per hour. This means we'll hit the limit when our ecosystem reaches 833 modules, which is about 80% more modules than we currently have.

Taking care of this Issue will be easy, once the new-db-builder branch is merged. We'll just perpetually run the build script, with sufficient delays between fetching info for each dist so we don't hit the API limit. The cron job will be there just to pull updates for the repo and ensure the build script is alive.

[RESOLVED in mojo-app branch] inconvenient sort behavior

The sort direction toggle behavior is a little inconvenient.

  • The default for date-based columns should be descending sort (recent first)

  • The last-used order should be used when clicking on a non-sorted column. For example,

    1. Load modules.perl6.org, notice that it is sorted by Name ascending
    2. Click Description header, it is sorted by Description ascending
    3. Click Name header, it is sorted by Name descending

    It should only toggle the sort order when clicking on the current sort header.

Make Site Aware of Core Types

It would be neat if the site could give useful response when core types are looked up.

For example, I search for "Socket" and got a couple fo dists, but I wasn't aware the core had a few Socket modules too.

So search results could prepend results from core stuff search as well (distinguished from regular modules with some highlight maybe).

Similarly, the module links in the app version of the site could be made to work for core stuff as well, so that, e.g., http://modules.perl6.org/repo/IO::Socket::INET redirects to http://docs.perl6.org/type/IO::Socket::INET

Track `master` branch for Travis

Currently, looks like the latest build is tracked by travis, but we need to track master, which that's what I believe panda installs.

The current issue is the modules page shows, say FTP module as failing, but in reality master passes and it's only the develop branch that's failing.

Need transition plan for move to CPAN

The current ecosystem seems to have no transition path for merging with CPAN. We seem stuck with a system which clearly can be improved, yet we as a community seem unable to envision any way ahead to integrate the current system with CPAN.

add id to <td>

e.g.

[...] Acme::Meow

That would allow linking from a README.md to the module in the ecosystem if that module is a dependency or for general propaganda.

Possible Missing Modules

If we look at ecosystem list, there are currently 389 lines.

The newly added module count shows 385 modules.

And the page apparently lists only 382 modules based on running

perl -MMojo::UserAgent -wlE 'say Mojo::UserAgent->new->get("http://modules.perl6.org/")->res->dom->find(".name")->size'

The data shows there are 7 modules missing from the final list; being lost at various stages of the process.

Logotype pics fall on new line on smaller screen sizes

This should be an easy fix (just don't have the time at the moment). We have this CSS that takes care of too-long distro names on small screens. That code currently pushes the logotype pic down onto a new line.

The fix likely involves just showing the distro logo inside the <a> with the distro name.

flow

Extraneous JS FIles

Bootstrap3 plugin includes all the standard Bootstrap JS files; we need to toss all we're not actually using.

Regain Some Screen Real Estate

Now that we have more info on the page, we should look into optimizing the shown info to get more screen real estate:

  1. The badges: some of them might not be as useful. The 90-day commits badge might be misleading, since some modules now could be "finished" and not require commits. The panda badge might not need to be there.
  2. The travis badges could be shrunk down by removing the redundant "build" word.

This was the discussion on IRC: http://irclog.perlgeek.de/perl6/2015-11-03#i_11475494

Race Condition with Fetching Travis Build Info

Currently, there exists a possible race condition with the new database builder:

  1. User pushes new commits and Travis starts building
  2. While that has NOT completed, our builder fetches the dist, grabs new commit and asks the Travis postprocessor to fetch new build status
  3. We get a not yet completed status into the database
  4. When dist is built again, we don't see any new commits, so we don't run the travis postprocessor and the wrong status is stuck with us forever!

This will be especially noticable in dists that take a long time to finish travis build.

Possible solution: run travis postprocessor regardless of whether there were new commits to the dist. We'll be hitting Travis API much more often, so we'd need to check for what limits there are.

Project: Document All Modules

The Problem

There are many modules in the ecosystem that lack any useful documentation. I've actually heard someone refer to this as "Perl 6's culture of no documentation."

The Solution

We're about to have many new comers and having a simple way to contribute would be good for the growth of the community.

  1. Same as with the Most Wanted Modules Wiki, we should have one for Documentation Wanted.
  2. Those who are new to the language could study those modules, figure out how they work, document the behaviour, and submit a doc PR.

In summation, I think this can be a great entry-level task for new comers to contribute to, while at the same time eradicating the "no documentation culture".

Check Caching

On slow connections the site loads rather bare, even if you visited it recently.

It's likely our main CSS isn't getting cached properly. It might be because currently we're copying repo files to another dir, so first thing to check would be whether this issue still exists after we toss the now-deprecated output-dir option to the build script.

semi-slow

JSON output doesn't use proper booleans.

Example list of modules (with one module):

{
    "Benchmark::Plot": {
        "last_updated": "2011-04-20T13:26:41-07:00",
        "badge_has_tests": null,
        "badge_is_fresh": "",
        "name": "Benchmark::Plot",
        "badge_panda": "1",
        "badge_is_popular": "",
        "description": "Simple benchmark graphing script",
        "badge_has_readme": "http://github.com/colomon/Benchmark-Plot/blob/master/README",
        "auth": "colomon",
        "url": "https://github.com/colomon/Benchmark-Plot/",
        "home": "github",
        "repo_name": "Benchmark-Plot"
    }
}

What is the problem? Instead of booleans true and false (JSON::true and JSON::false), 1 and "" is used instead (in one case it's even null). The problem is that it's implementation detail, not every language has those values as truthy or falsy. While it isn't important in Perl or JavaScript, it is important, for example in Ruby where 0 and "" is true.

[RESOLVED in mojo-app branch] Redirect http://modules.perl6.org/repo/Foo::Bar::Baz To Repo for Docs

It would be handy if you could look up docs for a module (assuming a repo has the README) by visiting to http://modules.perl6.org/repo/Foo::Bar::Baz where Foo::Bar::Baz is the module you want to look up.

This saves going to modules site, searching for module, then clicking on repo link.

The build script can easily generate .htaccess with Apache's mod_rewrite rules for the redirects.

@moritz is mod_rewrite module enabled on the Apache that hosts the site? I could write up some code to make this feature.

Add new Dist Source for SHELTERed modules

We currently have a SHELTER in the ecosystem repo that seems to be a collection of abandoned modules, available for adoption.

We should add a different Dist Source that handles these and display them on the site slightly different, to attract the attention of potential adopters.

We likely should add a source field to the Dists model to know where dists is from and display it accordingly on the site.

P.S.: we currently do have two sheltered dists

Too many Travis badges result in 429s

@szabgab there's a problem with the current implementation of Travis badges. Travis doesn't seem to like 385+ simultaneous requests for badges and responds with 429s (HTTP Too Many Requests).

We need to amend the implementation and only show badges on request for specific modules (on-click or on-hover). Then users would be able to look up build status on a module they're interested in

trav

Refactor ->_find in Dists model

<frew> Zoffix: fwiw mangling a thing and then passing it to a resultset search method is a common dbic antipattern
<frew> Zoffix: it's much better to just use search and build up the rs you want
<Zoffix> hm
<Zoffix> I'll try to refactor that later, thanks.
<ether> resultset chaining is one of DBIx::Class's great features that is often overlooked

Show "Tips" for Site's Features

Some of the site's features aren't entirely obvious right away, but can be valuable.

We need to add "tips" that would advertize these features. For example, how GitHub uses their "ProTips" to give hints on search queries:
tip

Here are currently-implemented features to include:

As the site is fleshed out, more tips will be added.

For placement, these two locations look inviting:
tips2

[RESOLVED in mojo-app branch] Improvement to Sorting

Here are some problems / potential improvements for the current sorting plugin:

  • #21 needs custom edits to use a sprite instead of individual images. We don't actually need images there at all; we can use Unicode chars. If we do that, we likely can get rid of custom edits (just use CSS content property to display proper Unicode char)
  • We have Issues #18 (inconvenient sorting) and #17 (sort not preserved on Back button). #23 is sorta related too

@azawawi also mentioned http://datatables.net/ that provides pagination. So, instead of doing anything about the above, we should see if the datatable stuff is better.

Broken Images / Missing sprite.css

Just a note, in case anyone notices the current breakage and starts trying to fix it:

The breakage was done by the commit implementing #21 . The new code requires Mojolicious::Plugin::AssetPack (and supporting modules), which currently are not installed. Server admin @moritz will install those when they have a chance, and then the site should work fine.

To resolve the issue:

apt-get install libpng12-dev;
cpanm Imager::File::PNG Mojolicious::Plugin::AssetPack 

Cheers,
ZZ

Bitrot with Mojolicious::Plugin::AssetPack

There's a bit of bit rot in the app that powers the site. New major version of Mojolicious::Plugin::AssetPack uses a different interface and the old interface our app uses, while still works, is deprecated and will be removed in the future.


On further inspection, other stuff has bitrotted too: Bootstrap plugin and AssetPack no longer seems to support sprites

Reduce Number of HTTP Requests -> Sprites

Currently, each page load generates 51 HTTP requests to fetch images. That number is growing any time someone adds a logotype to their repo.

We can reduce all of these to a single request if we sprite the images, thereby improving load speed of the page and hammering the server less.

I can easily add this feature if the server admin ( @moritz ?) installs additional Perl modules and Debian packages needed for the module that can auto-generate sprites.

This is what's needed to be installed:

apt-get install libpng12-dev;
cpanm Mojolicious::Plugin::AssetPack Imager Imager::File::PNG Imager::File::GIF Imager::File::JPEG;

If you want to test that the spriter works, you can download and run this app:

cd $(mktemp -d);
git clone https://github.com/zoffixznet/debug.git .;
git checkout c91f35a87dd64297a43de1766330eb514251e699;
morbo app.pl;

The app will now start up on port 3000 and when visiting http://localhost:3000 you should see a page with two pics on it:
panda

Let me know whether the extra software above can be installed and I'll write this feature.

Cheers,
ZZ

Add Dists to Ecosystem from the Site

Instead of asking people to make PRs to the ecosystem to add their dists, we can make a special page on the modules.perl6.org where users can submit their dists for inclusion into the ecosystem. This will also allow much easier inclusion of dists from other Dist Sources (e.g. GitLab).

How it Works

  1. User visits, say /upload, and gives the site a link to the repo of their dist.
  2. The site normalizes the link (we could get a link to repo using git:// or https://, to META, to raw META, etc)
  3. The site looks at the repo contents to analyze for common problems (JSON errors in META or missing required fields)
  4. Potentially, the site can also make analysis and offer the dist author suggestions for improving it (adding a README and tests).
  5. The site then makes a commit to the ecosystem, adding the dist.
  6. ???
  7. PROFIT!

Benefits

  1. Automated check for problems in dists that immediately gives feedback to dist author instead of just showing up in logs
  2. Encourage people who do not like GitHub to contribute their dists using different Dist Sources
  3. Make it easier for people who are unfamiliar with git or making PRs to add dists
  4. Less work for members of Perl 6 GitHub Organization, since we won't need to check each PR for problems and manually merge it.

Graphic indicator for Travis CI status

The status column has been changed to text recently, but some kind of colourful indicator would be nice to have (eg using these images).

One could even make it into a badge, though this would mean we would lose the ability to sort by the status.

Module list ends on IO::Select

It is not good that webpage suggests that list is full while it isn't. User may think that module that provides expected functionality does not exist.

Tested in Mozilla Firefox and Internet Explorer.

Add Missing prereqs

List::UtilsBy
We also need to document the several options of getting sass for for AssetPack's Sass handler

Off by one errors / Missing Dists?

Just noticing this in the build log: we have four numbers 458, 459, and 460. Either those are off-by-one errors or we're missing a dist or two from final build for whatever reason.
Total: 460

458/460 JSON::Pretty
Updated since last check
A minimal JSON (de)serializer that produces easily readable JSON

ok - 459
nok - 0

A way to immediately see where a module lives

I'm often interested in seeing what github user is behind a given module (for example if many modules have similar names, but i'm sure i want the one by user "foo")

Sadly, the /repo/ url hides that fact from me; i'd have to open a new tab, switch to it, look at the url, close it again :(

Is there a way to make the authority visible? Is that useful for anyone besides me?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.