A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

WikiRate

Facilitates research and analysis on complex topics in collaboration with partners, to make ESG data open, comparable and useful for all.
https://github.com/wikirate/wikirate

Category: Sustainable Development
Sub Category: Sustainable Investment

Keywords from Contributors

archiving transforms measur generic optimize observation compose conversion projection animals

Last synced: about 18 hours ago
JSON representation

Repository metadata

README.md

Build Status
Maintainability
License: GPL v3

Decko application code used at Wikirate.org

Code Organization

WikiRate is a website built with Decko, or a "deck."

Decko code is primarily written in Ruby, and ruby code is typically distributed in
libraries called "gems." Decko code has a few main core gems (decko, card,
and cardname), and then everything else is organized into mods, which you can
think of as short for "modules" or "modifications".

Repositories

WikiRate developers work with mods in three different main GitHub repositories:

  1. wikirate/wikirate – this repo.
  2. decko-commons/decko, which contains code
    for core gems and the mods that are included by default in new decks. It is included as a
    submodule of this repo at vendor/decko.
  3. decko-commons/card-mods, which contains
    other mod gems developed by Decko Commons. It's included here at vendor/card-mods

Directories

A quick overview of the purpose of each directory in this repo:

  • .semaphore configures our continuous integration testing with Semaphore.
  • config is for configuration settings, many of which will vary between installations.
  • cypress is one of our integration testing tools.
  • db is for database seed data and migrations (may soon be moved into mods).
  • files is where uploaded images and other files are stored.
  • lib contains a few rake tasks and deployment scripts (will soon be moved into mods).
  • log stores logs from web requests, tests, etc.
  • mod is where we keep mods, the main WikiRate code. More details below.
  • public files are exposed to the web. (It's mostly symbolic links to the public
    directories in mods.)
  • script contains lots of one-off scripts, eg for data transformations.
  • spec contains configuration for rspec tests. (The tests themselves are in mods.)
  • tmp holds caches and other temporary data.
  • vendor contains git submodules, including decko and card-mods.

Mods

Inside the mod directory there are many mod directories and a file named Modfile.
When a deck has a Modfile, it means we've specified a load order for the mods.

WikiRate's Modfile is more involved than most, but it's reasonably well commented.
The mods can be grouped into four main groups:

  1. mods prefixed with deckorate_. DeckoRate is an abstraction of WikiRate; it has
    metrics, answers, sources, datasets, etc, but the subject might be something other
    than companies – could be governments, geographical areas, or whatever else. It's
    more of an idea than a reality thus far, but we're trying to organizing code to help
    us approach that reality, and these mods are moving us in that direction. The idea is
    that some day these would all be made into gems and shared.
  2. mods prefixed with wikirate_. This code is very narrowly
    WikiRate-specific and is unlikely to be very useful to others, so we're not likely to
    share it.
  3. more broadly useful mods. Mods like guides and posts are likely to be useful
    to other decko users, and not just those creatings sites that follow the DeckoRate
    pattern. We will soon move them to card-mods.
  4. todos. other mods don't really fit neatly into any of these categories and need to
    refactored until they do.

The mod page on docs.decko.org has details about mods' subdirectory structure
and is a good place to start if you're learning to be a Decko monkey.

Setting up a Development Environment

The following will help set up a functioning wikirate site with a small subset of
(mostly fake, largely silly) WikiRate data.

1. Install basic dependencies

First, you will need to install
Decko dependencies,
including ruby, bundler, ImageMagick, MySQL, and a JavaScript runtime.

2. Get code from GitHub

Then you will need to make your own fork of the
WikiRate GitHub repository. Each WikiRate
developer maintains their own fork so they can make pull requests from that fork. For
example, Ethan's fork is at https://github.com/ethn/wikirate.

If you don't already have a GitHub account, start by signing up. If you're logged in,
you can fork by clicking the "Fork" button in the upper right hand corner of the
repo page.

Now we pull that code down to our computers.

git clone [email protected]:YOURNAME/wikirate.git

At this point we have the main wikirate repo, but there's a lot more code we need in
nested repositories, which git calls submodules. The following command will pull down
the latest submodules, including the decko, card-mods, and others that we don't
maintain.

cd wikirate
git submodule update -f --init --recursive

3. Install ruby gems

Nearly all ruby developers these days use a beloved gem management tool called bundler.
Bundler defines the "bundle" of gems you need for your application. "bundle install" will
install all those gems.

bundle install

Pay close attention to any error messages. Some gems may have additional dependencies
that need to be installed or identified for the bundle installation to complete
successfully.

4. Add configurations

Each copy of the Wikirate site can have different configuration options for its own
purposes. The production site, for example, is configured to store files and images
on the cloud, but by default your local test site will just store files locally.
Since the main config files are not shared (and often contain private credentials),
they are not tracked in git. However, you must have these files in place for your site to
function, so you can start by copying over a sample set:

cp -R config/sample/* config

These configurations should typically work out of the box, but at some point you may
wish to change:

  • config/database.yml for unusual database configs
  • config/application.rb to change most other configurations
  • config/environment/[environment].rb for configurations that only apply to certain
    environments (test, development, production, etc.).

5. Seed and serve

Now we seed the database with our silly data and start the server:

env RAILS_ENV=test bundle exec decko setup
bundle exec decko server

You should now be able to access a copy of your site at http://localhost:3000. You can
log into the test data with:

Updating your code

To get the latest code you will need to do the following:

git pull                             # pull the latest wikirate/wikirate code
git submodule update -f --recursive  # update the nested git repositories
bundle update                        # get the latest gems 
bundle exec decko update             # run migrations and install mods

Testing

Running Tests

All tests required a populated test database

bundle exec rake decko:seed:replant

RSpec

We use RSpec for unit and functional ruby tests.

bundle exec decko rspec                          # full syntax
bundle exec decko rs                             # shortcut
bundle exec decko rs -- /my/file/is/here_spec.rb # runs a specific test

Tests are found in the spec dir of most mods.

Cypress

Cypress is our preferred tool for integration tests. To get
it running, you will need to install node

Typically you will want two different shells active for cypress testing: one for a server

RAILS_ENV=cypress bundle exec decko server -p 5002

...and another for running the tests

yarn install
yarn run cypress run

Tests are found in the spec/cypress dir within mods.

Cucumber

We've been slowly moving away from cucumber in favor of cypress,
but we still have some cucumber tests.

bundle exec decko cucumber
bundle exec decko cc          # shortcut

Tests are found in the features dir within mods.

Deploying Changes

Requires server permissions.

TODO!

Maintenance messages

See documentation here: https://github.com/capistrano/maintenance

quick examples:

  # turn on maintenance message with defaults
  cap production maintenance:enable

  # turn on maintenance message with more info
  cap production maintenance:enable REASON="database update" UNTIL="in a minute or two"

  # turn maintenance message off
  cap production maintenance:disable


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 9 days ago

Total Commits: 11,785
Total Committers: 20
Avg Commits per committer: 589.25
Development Distribution Score (DDS): 0.405

Commits in past year: 711
Committers in past year: 3
Avg Commits per committer in past year: 237.0
Development Distribution Score (DDS) in past year: 0.073

Name Email Commits
Ethan McCutchen e****n@d****g 7017
xithan p****l@g****m 2975
chuenlok c****8@c****k 872
Srivigneshwar p****i@g****m 379
vasgat v****t@g****m 150
Christina Schweipert 4****t 128
dependabot[bot] 4****] 67
dcastroeyss d****o@e****m 61
chuenlok h****i@H****l 54
Srivigneshwar s****r@V****l 24
chuenlok h****i@h****e 18
Andrew Kostka g****t@a****m 11
henrytai h****i@g****m 10
chuenlok h****i@d****k 5
vasgat v****t@i****r 4
Philipp Kühl p****i@P****l 3
chuenlok h****i@d****k 3
chuenlok h****i@d****k 2
Srivigneshwar s****r@V****x 1
Gerry Gleason g****0@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 2 days ago

Total issues: 0
Total pull requests: 1,811
Average time to close issues: N/A
Average time to close pull requests: 4 days
Total issue authors: 0
Total pull request authors: 13
Average comments per issue: 0
Average comments per pull request: 0.13
Merged pull request: 1,654
Bot issues: 0
Bot pull requests: 84

Past year issues: 0
Past year pull requests: 203
Past year average time to close issues: N/A
Past year average time to close pull requests: 2 days
Past year issue authors: 0
Past year pull request authors: 3
Past year average comments per issue: 0
Past year average comments per pull request: 0.04
Past year merged pull request: 185
Past year bot issues: 0
Past year bot pull requests: 51

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/wikirate/wikirate

Top Issue Authors

Top Pull Request Authors

  • ethn (900)
  • xithan (429)
  • chuenlok (261)
  • dependabot[bot] (84)
  • srivig (80)
  • cschweipert (31)
  • vasgat (10)
  • dcastroeyss (7)
  • AndrewKostka (4)
  • GerryG (2)
  • gabriel-ku (1)
  • NSfsfe (1)
  • Robindhartog (1)

Top Issue Labels

Top Pull Request Labels

  • dependencies (84)
  • javascript (42)
  • ruby (23)
  • github_actions (19)

Dependencies

package.json npm
  • cypress ^4.10.0 development
  • coffeescript >=2.3.1
  • jest ^26.1.0
  • jest-coffee-preprocessor >=1.0.0
  • jest-preset-coffeescript ^1.3.0
  • wait-on ^5.1.0
yarn.lock npm
  • 612 dependencies
Gemfile rubygems
  • card-mod-monkey >= 0 development
  • dalli >= 0 development
  • decko-cap >= 0 development
  • decko-cucumber >= 0 development
  • decko-cypress >= 0 development
  • decko-profile >= 0 development
  • decko-rspec >= 0 development
  • decko-spring >= 0 development
  • pivotal-tracker >= 0 development
  • puma ~> 5.6 development
  • ruby-jmeter >= 0 development
  • wbench >= 0 development
  • addressable >= 0
  • card >= 0
  • card-mod-alias >= 0
  • card-mod-bookmarks >= 0
  • card-mod-counts >= 0
  • card-mod-csv_import >= 0
  • card-mod-deckorate_search >= 0
  • card-mod-defaults >= 0
  • card-mod-delayed_job >= 0
  • card-mod-filter >= 0
  • card-mod-flag >= 0
  • card-mod-fulltext >= 0
  • card-mod-google_analytics >= 0
  • card-mod-graphql >= 0
  • card-mod-lookup >= 0
  • card-mod-new_relic >= 0
  • card-mod-pdfjs >= 0
  • card-mod-social >= 0
  • card-mod-solid_cache >= 0
  • card-mod-thumbnail >= 0
  • cardname >= 0
  • company-mapping >= 0
  • curb >= 0
  • decko >= 0
  • descriptive_statistics >= 0
  • fog-aws >= 0
  • link_thumbnailer >= 0
  • mail != 2.8.0
  • mysql2 > 0.4
  • open_uri_redirections >= 0
  • pdfkit >= 0
  • pluck_all >= 0
  • rack-cors >= 0
  • rack-test != 2.0.0
  • roo >= 0
  • savanna-outliers >= 0
  • simplecov != 0.22.0
  • statistics2 >= 0
  • wkhtmltopdf-binary >= 0
Gemfile.lock rubygems
  • 288 dependencies
mod/deckorate_search/card-mod-deckorate_search.gemspec rubygems

Score: 5.8289456176102075