Squash’s front-end and API host.

Related tags

web
Overview

Squash: A squarish bug spray

An open-source project from Square

Squash is a collection of tools that help engineers find and kill bugs in their code by automatically collecting, collating and analyzing run time exceptions. Squash consists of the following components:

  • Client libraries: Client libraries for different systems (Ruby, Ruby on Rails, Cocoa with Objective-C, etc.) catch and record errors when they occur, then send them to the API endpoint. Client libraries can be found under the SquareSquash organization.
  • Front-end: This website displays Bug information and helps the engineer find the root cause for a Bug, and fix it. It also lets engineers manage, assign, and comment on Bugs, as well as view statistics about the Bug.
  • API endpoints: These routes (part of the front-end app) receive exception notifications from the client libraries and process them.

This project is the front-end and the API.

Pull requests are more than welcome; please check out CONTRIBUTING.md for details.

How to Install

To get started, run the bin/setup file. This script will ask you a series of questions and generate a preliminary configuration for your site install. When the script is completed, you can run git status to see what files it changed, and refine your configuration from there.

Once the script is complete, Squash should run for most typical development environments. Simply run rails s and visit the site in your Web browser. You should be able to start using it immediately. You can also verify correctness by running rspec spec.

Configuring and deploying the production instance is entirely up to you and your particular production environment.

Additional configuration options can be found in the following locations:

  • config/application.rb
  • config/environments/*.rb
  • config/environments/*/*.yml

If you don't see what you're looking for in any of those files, you'll probably have to change the code to make it work. Don't be afraid -- the code is thoroughly documented and should (hopefully) be very accessible.

Requirements

Squash requires the following:

  • Ruby 1.9.2 or newer (JRuby with --1.9 is supported)
  • Multithreading support (see the next section)
  • PostgreSQL 9.1 or newer
  • The Bundler gem
  • Git 1.7 or newer

Notes on some of the gem and library choices

Why do you specifically require PostgreSQL? Squash uses a lot of PostgreSQL-specific features to make efficient use of the database and maintain referential integrity, such as:

  • foreign key constraints,
  • triggered cached counters,
  • check constraints, and
  • semantic indexes for text-based search.

If PostgreSQL is out of the question, some of these features can be ported to other RDBMSes; simply edit the InitialSchema migration and update the SQL as necessary. If portability is required, a lot of these features can be reimplemented in the Rails layer (e.g., cached counters), at the risk of degraded referential integrity. (If you are reimplementing the cached counters in Ruby, be sure to modify the config/initializers/active_record.rb file as appropriate.)

If you do successfully port Squash to another RDBMS, let me know. I'd be happy to take your changes.

Why do you bundle an edge version of Rails? The 3-2-stable branch of Ruby on Rails includes some changes to Active Record that are required by Squash's multithreaded concurrency model (see next question). In particular, that version of Active Record includes crucial changes to the connection pool and connection reopening logic. If you set the background_runner option in the concurrency.yml file to something other than Multithread, the Gemfile will automatically drop Rails back down to the latest release version.

Why don't you use my favorite backgrounding library? Squash was originally built for Square, which runs all its services on JRuby. Using threads is very efficient in JRuby, and avoids the overhead of having to deploy both a website and workers.

If you are running Squash in a non-thread-safe (or multithreading-unfriendly) environment, you can use Sidekiq or Resque instead. If you want to use some other backgrounding library, you can easily write your own adapter. All threaded code is invoked using {BackgroundRunner.run}, which then uses the settings in the concurrency.yml Configoro file to invoke the correct module under lib/background_runner. The default is to use {BackgroundRunner::Multithread}, which uses the {Multithread} module to execute the task in its own thread. You can edit the YAML file and switch the background runner to Resque, or implement your own BackgroundRunner module. See the {BackgroundRunner} documentation for more details.

If you do this successfully and wish to save future Squash users the effort, feel free to turn your changes into a pull request.

Why aren't you using RedCarpet? As mentioned above, Squash was originally built to run under JRuby. RedCarpet has compiled C extensions; Kramdown is pure Ruby.

Why do you require a recent version of Git? Squash uses the git clone --mirror command to create local mirrors of client projects' Git repositories.

Why don't you have integration tests or acceptance tests? To be 100% honest, lack of familiarity on these things in Ruby/Rails. Happy for any help people want to extend towards this goal.

Why are you using Erector? I like Erector.

Documentation

Comprehensive documentation is written in YARD- and Markdown-formatted comments throughout the source. To view this documentation as an HTML site, run rake yard.

CoffeeScript libraries are documented using the YARD format as well, but YARD does not as yet recognize them as documentable files. A .codoopts file is included in case you wish to use Codo to generate the CoffeeScript docs, but as of now Codo does not recognize the ERb files, and does not use the full set of Markdown syntax features used in the documentation.

Project Overview

Views

This is a pretty typical Rails website, save for the views, which are written using Erector. The views forgo the traditional Rails concepts of partials and templates in favor of analogous OOP concepts more familiar to software developers: methods and inheritance. All views inherit from an abstract Erector widget which provides layout; and all views have their content split into multiple private methods.

In addition to the usual helpers (in app/helpers), there are view mixins under app/views/additions that simplify view coding.

Embedded code snippets are all rendered using the {CommitsController#context} action. This action loads the appropriate file and revision from the Git repository and returns a snippet plus the name of the SyntaxHighlighter brush to use. The brush is determined from the file name/extension; the mapping can be found in data/brushes.yml.

This view behavior is provided from a JavaScript library file in lib/assets/javascripts. There are many similar helper classes in there; they are documented but the documentation is not recognized by YARD and so is not included in this documentation set.

JavaScript files are organized into four possible locations:

  • Third-party JavaScript libraries are in vendor/assets/javascripts and loaded in the application.js manifest.
  • JavaScript modules or helpers that are not specific to a particular page or site area are in lib/assets/javascripts and also loaded in application.js.
  • JavaScript modules or helpers specific to a particular area of the site are in app/assets/javascripts and also loaded in application.js.
  • Small JavaScript snippets, glue code, or other code intended to add dynamic behavior to a specific page is in a .js file named the same as, and placed alongside, the .html.rb view file. For example, if app/views/projects/new.html.rb needed a bit of JS glue code, it would be placed in app/views/projects/new.js. This code is placed in a <SCRIPT> tag at the end of the view by the {Views::Layouts::Application#inline_javascript} method.

CSS files are similarly organized:

  • Third-party CSS files are in vendor/assets/stylesheets and loaded in the application.css manifest.
  • CSS styles or helpers global to the entire website are in lib/assets/stylesheets and also loaded in application.css.
  • CSS styles specific to a single page or a related group of pages are placed in app/assets/stylesheets and also loaded in application.css. Each <BODY> tag is given a class name equal to the controller name, and an ID equal to the controller and action name separated with a dash. For instance, the projects/new action's body would be <body class=projects id=projects-new>.

Controllers

For information about requests and responses, see {ApplicationController}.

Models

Models make extensive use of advanced PostgreSQL features for efficiency and convenience. Cached counters are updated using triggers and rules, foreign key constraints and hooks are enforced at the database level, and validations are backed up by corresponding CHECK triggers. This helps ensure referential and data integrity even in situations where Rails fails, or outside of the Rails stack. See the various migrations to learn more about the triggers, rules, and constraints being used.

Observers are used for more high-level triggers, such as creating {Event Events} at the appropriate times, or sending emails. See the classes in app/models/observers for more.

Models also use the HasMetadataColumn gem to reduce their width and incorporate schemaless data. Most models have a JSON-formatted metadata column to which new information can be added or removed without having to create new migrations.

Tasks

Various Rake tasks are available under lib/tasks. These include tasks for pruning and maintaining the database, development tasks, and configuring the workers.

Workers

Workers are found in the lib/workers directory. Along with OccurrencesWorker, which stores and categorizes Occurrences, there are other workers for managing Deploys and other minor tasks. These workers are run asynchronously using {Multithread}.

Mailers

Notification mails are sent by the {NotificationMailer}. It and any other mailers live in app/mailers.

NotificationMailer conditionally delivers emails. An email will only be delivered if all of the following conditions are met:

  • The Project has a mailing list email configured (for the critical-bugs and all-bugs mailing lists),
  • the Environment's sends_emails attribute is true, and
  • the User has enabled receipt of that category of emails (typically specified in the Membership).

Authentication and Authorization

Authentication is done using either password verification or LDAP; see {AuthenticationHelpers} and related controller mixins, as well as the model mixins under app/models/additions for more information.

There are four permissions levels that a User can have, specific to an individual Project:

Non-members do not have a {Membership} record with a Project. They can view Bugs and Occurrences, view the Project's API key, view the list of other Project members, watch Bugs, and comment on Bugs.

Members can do everything non-members can do, and can also assign Bugs, be assigned Bugs, and modify/delete Bugs.

Administrators can do everything members can do, and can also modify Project and Environment settings, regenerate the API key, promote and demote members to administrator status, and modify/delete others' Comments.

Owners (each Project has only one) can do everything administrators can do, and can also delete the Project and reassign ownership.

Recording and Categorizing Occurrences

Client-Specific Information

The client library identifiers used throughout the website determine how a Bug reported from that library is presented in the view. The {OccurrencesController::INDEX_FIELDS} constant maps a client library identifier to the relevant summary fields to display in the list view.

Each occurrence is transmitted with the name of the client library; the {Occurrence} records this to the client field. The {Bug}'s client field is set from the first Occurrence's; in general, one should expect that all Occurrences of a Bug share the same client value.

Regardless of the Occurrence's client value, all fields for which there is data are displayed in the Occurrence view.

If a client library is updated to add new information fields, all that is needed is to update the has_metadata hash in Occurrence with the new fields, and to update the occurrences#show view as necessary. (The INDEX_FIELDS hash can also be updated as appropriate.)

If a new client library is added, in addition to doing the above for any new fields unique to the new client, the INDEX_FIELDS hash will need to be expanded to include the new client.

Queue Consumer

For information about the background worker that converts incoming exception information into Occurrence and Bug records (including doing "best guess" commit blaming, determining which Occurrences share the same root Bug, etc.), see the documentation for the {OccurrencesWorker} module. See also Static Analysis below.

Deploys and Releases

Squash can handle both deployed projects (hosted projects for which typically only one version is live at a time) and released projects (distributed apps for which many versions may exist "in the wild").

If you are developing a released project, you must associate your {Deploy} objects with a unique version identifier (such as a build number). You must also send the correct build identifier with every occurrence report. See the client library and API controller documentation for more information.

Once this is done, Squash's behavior is changed slightly: Bugs that are fixed in an older release, but recur, are not reopened. Bugs that are fixed in an older release but then recur in newer releases are treated as completely separate Bugs.

This app exposes an API endpoint for notifying Squash of new releases/deploys of your Project. You should notify Squash whenever you deploy your Project (or release a new version) so that it can properly manage Bugs (automatically mark fixed Bugs as deployed, associate new Bugs with the new Deploy, etc.).

Most client libraries include an easy means to add this feature to your deploy or release process.

Static Analysis

Message Normalization

When an Occurrence is grouped into a Bug, its message is stripped of any non-relevant or situational information. (Note that since the message is not used as a dimension in grouping Occurrences, two Occurrences of the same Bug could have completely different messages. A Bug gets its message from its first Occurrence.) This is done by subclasses of {Blamer::Base}.

For most messages, this is done using simple regex subsitution. Squash can also normalize an exception's message using a list of known message templates. Such templates are stored in the data/message_templates.yml file. The file contains a hash mapping exception class names to an array of arrays. Each inner array contains two elements: the regexp to match the exception message on, and the replacement message should it match.

These templates are evaluated in the order they appear in the array. Scripts that regenerate the templates for MySQL and PostgreSQL error strings can be found under the script directory.

Version Control Systems

As of now, Squash is only compatible with projects that are version-controlled using Git. However, in the interest of remaining as VCS-agnostic as possible, commit identifiers are never called "SHA1s," but instead "IDs."

Unsymbolicated, Obfuscated, or Minified Stack Traces

Client libraries of compiled, obfuscated, or minified applications will need to convert their stack traces in order for them to be of use for static analysis. Because release builds are typically not distributed with embedded decompilation information, a mapping or table must be given to Squash, so that when Squash receives an unconverted stack trace, it can perform lookups and convert it to a more usable format.

Currently, the supported conversions are:

  • symbolication of iOS exceptions (see {Symbolication}),
  • deobfuscation of Java exceptions (see {ObfuscationMap}),
  • and source-mapping of JavaScript exceptions (see {SourceMap}).

Client libraries are responsible for delivering the raw stack trace data to Squash when an exception occurs, and for delivering lookup tables to Squash upon each new release. {Api::V1Controller} has endpoints for these purposes in various languages.

Unconverted stack traces are stored in a particular format; see {Occurrence} for more information. When a new exception with a stack trace in this format is received, Squash immediately attempts to convert it using an existing matching lookup table. If no such table is found, the stack trace is left unconverted. It can still be viewed on the front end. When, later, a new lookup table is added, Squash automatically finds and converts any matching stack traces.

Because every new Occurrence must be assigned a Bug (including unconverted Occurrences), it is possible that the "blamed" file and line fields of the Bug could themselves be unconverted. The {Bug} class has provisions to support this; see in particular bugs.special_file.

Specs

All models, controllers, and library files are unit-tested with RSpec specs under the spec directory. Run unit tests with the rspec spec command. Views and JavaScript files are not specced. No integration or acceptance tests are written. Almost all unit tests use factories rather than mocks, putting them somewhat closer to integration tests.

In general, the test environment is identical to the development/production environment, save for the usual Rails allowances, and the config/initializers/active_record_observer_hooks.rb file. This file adds after-commit hooks to observers (identical to those available to models). However, specs are transactionalized, meaning that these hooks wouldn't run until after the spec is completed, resulting in multiple spec failures.

To remedy this, the file introspects on the environment, and instead links the observer hooks to the after_save model hooks in the test environment. This differentiates the test and live environments, but allows specs to pass.

If you wish to bring your test environment closer to production, you can set the use_transactional_fixtures RSpec setting to false. The hooks file will automatically detect the change and use the correct after_commit hooks. Currently, all specs pass with and without transactionalized fixtures.

Third-Party Integrations

Squash supports integration with a handful of popular other developer tools.

PagerDuty

When Squash is integrated with PagerDuty, it will begin sending exceptions to PagerDuty once the Occurrence count for a given Bug exceeds the Project's critical threshold. Thereafter, every Occurrence is sent to PagerDuty as a trigger. The triggers are grouped into alerts by Bug, so users will only be paged once per new error.

In addition, marking a Bug fixed will also automatically resolve its associated PagerDuty alert (if any), and assigning a Bug or marking it irrelevant automatically acknowledges any associated PagerDuty alert.

In order to integrate Squash with PagerDuty, you must

  1. generate an API key that Squash can use for PagerDuty access (you must be a PagerDuty admin to do this),
  2. update the config/environments/common/pagerduty.yml file to enable PagerDuty integration and provide the API key,
  3. configure Generic API services for each escalation policy you wish to use, and
  4. set the PagerDuty-related options in your Project's configuration page.

JIRA

When Squash is integrated with JIRA, users have the option of associating a JIRA issue with any Bug. The Management tab will then display a link allowing the user to quickly view the associated issue.

In addition, the user can have Squash watch the JIRA issue for status updates. Once the JIRA issue is resolved (or is changed to someother specified status), the Bug can be automatically marked as fixed. By associating multiple Bugs with one JIRA issue in such a manner, a user can quickly fix a large number of Bugs by closing just one JIRA issue.

Finally, a "Create JIRA Issue" button is provided on the Management tab allowing users to easily create new JIRA issues for any Bug.

In order to integrate Squash with JIRA, you must

  1. configure the config/environments/common/jira.yml file with your JIRA authentication credentials and installation location, and
  2. add a cron job or other periodic task that runs rake jira:update.

JIRA integration works out-of-the-box if you use username/password authentication. OAuth authentication requires a few more steps. Because OAuth authentication requires user actions, you will need to obtain an access token and secret which the JIRA client can use without needing to prompt the user. You can do this by running the jira_oauth.rb script:

rails runner script/jira_oauth.rb

Follow the instructions to set up your JIRA integration.

Issues
  • Squash doesn't process exception sent by clients

    Squash doesn't process exception sent by clients

    I've a Rails client setup and it could communicates with Squash web properly.

    When I mannually notify_squash, the log in the web application records the data correctly. However, squash doesn't update about the bug. In the log, it records

    [Multithread] Dropping operation : at capacity
    

    Is there something I am missing? Or how could I zero in on the problem?

    bug 
    opened by yangchenyun 24
  • Ability to create issue on Github from Squash bug

    Ability to create issue on Github from Squash bug

    Hey there-

    We're moving from Airbrake to Squash and one thing we really miss is the ability to create Github issues directly from the web interface (or email). Happy to dig in and submit a PR if this is something that seems interesting to y'all. Would just need some details on where you'd like the link to live in UI. Screen Shot 2013-01-25 at 11 03 27 AM

    Thanks!

    feature 
    opened by davegoldberg 18
  • LDAP Authentication Failure: Connection reset by peer

    LDAP Authentication Failure: Connection reset by peer

    I'm setting up Squash to use LDAP authentication. I've been able to get all the way to the point where the LDAP auth helper is binding a second time (after locating successfully my user) with my user DN and the password.

    Calling ldap.bind on line 46 is issuing a Connection reset by peer error. This causes the auth process to explode.

    # app/controllers/additions/ldap_authentication_helpers.rb:43
    if (entry = locate_ldap_user(ldap, username))
      ldap.auth entry[:dn], password
      unless ldap.bind
        logger.tagged('AuthenticationHelpers') { logger.info "Denying login to #{username}: LDAP authentication failed." }
        return false
      end
    else
    ...
    

    I've put a binding.pry in just after the entry var is assigned, and it's :dn appears to be valid, and the password var does contain the appropriate password.

    The following log is from when I rescued the exception and printed it's message, the ldap.get_operation_result, and the backtrace:

    [LDAP Bind Failure] Connection reset by peer
    [LDAP Bind Failure] #<OpenStruct code=0, message="Success">
    [LDAP Bind Failure] /home/jamhead/.rvm/gems/[email protected]/gems/net-ldap-0.3.1/lib/net/ber/ber_parser.rb:157:in `getbyte'
    /home/jamhead/.rvm/gems/[email protected]/gems/net-ldap-0.3.1/lib/net/ber/ber_parser.rb:157:in `read_ber'
    /home/jamhead/.rvm/gems/[email protected]/gems/net-ldap-0.3.1/lib/net/ldap.rb:1238:in `bind_simple'
    /home/jamhead/.rvm/gems/[email protected]/gems/net-ldap-0.3.1/lib/net/ldap.rb:1209:in `bind'
    /home/jamhead/.rvm/gems/[email protected]/gems/net-ldap-0.3.1/lib/net/ldap.rb:718:in `bind'
    /srv/squash/releases/20130121000001/app/controllers/additions/ldap_authentication_helpers.rb:48:in `log_in'
    /srv/squash/releases/20130121000001/app/controllers/sessions_controller.rb:70:in `create'
    

    I'm open to this being an LDAP issue or a misconfiguration on my side, but wondering if you have any ideas where I could go from here. If the LDAP library is to blame, we should probably be accounting for the fact that ldap.bind may blow up.

    Part of me thinks that doing multiple bind calls on a single LDAP object may not be supported, but it's just a guess. Thoughts?

    opened by localshred 12
  • Disable registration when authorization.strategy is password

    Disable registration when authorization.strategy is password

    Hey there,

    when running squash web I'd like to disable registration since everybody who registers can join an existing project.

    This functionality could be integrated fairly easy by adding a new setting to the authorization.yml and some changes to the routes and the sessions/new view, but I wanted to ask first if this feature whould be acccepted upstream.

    I'd like to know if you would consider the authorization.yml the correct place to add such a feature. I'd argue that introducing a second authorization level (eg admin, user) and adding a settings page for admins where such things can be changed without having to restart the app would be a good addition.

    Any suggestions/ feedback? I'd be more than happy to provide a pull request later on!

    Cheers, Raphael

    feature 
    opened by nicolai86 10
  • Asset precompilation woes

    Asset precompilation woes

    Currently config.assets.initialize_on_precompile is set to true (the default). This means, if you want to precompile assets prior to a deployment (e.g. creating a war file, deploying to Heroku, or just doing the work once before sending out to many servers), you need to have access to the production DB.

    Usually, to counter this, one can set RAILS_ENV=development before running the precompilation rake task. However, in the case of Squash, "flot/excanvas.js" is added to config.assets.precompile only in config/environments/production.rb resulting in a ActionView::Template::Error (flot/excanvas.js isn't precompiled) error at runtime in production.

    So, there are two ways out of this that I see. I'm happy to issue a pull request for either direction, I just wanted some input first in case there is a preferred route:

    1. Move config.assets.precompile << 'flot/excanvas.js from production.rb to application.rb so it is effective in all compilation environments (i.e. allowing precompilation with RAILS_ENV=development)
    2. Set config.assets.initialize_on_precompile = false so that a DB connection is not formed. This has other issues if any of the assets access certain classes or constants at compile time (e.g. ERB assets).

    For option 2, one error that already pops up is uninitialized constant Ping due to a lot of assumed requires not happening. Things like this would need to be resolved.

    opened by bjeanes 9
  • Use Rack::Cors in other environments

    Use Rack::Cors in other environments

    Currently it is only configured for development, but that won't do any good for people trying to collect JS errors in production/uat/staging environments.

    My suggestion would be to add something like the following to application.rb:

    config.middleware.use Rack::Cors do
      allow do
        origins *Squash::Configuration.squash_javascript.allowed_domains
        resource '/api/1.0/notify', headers: :any, methods: [:post]
      end
    end
    

    And config/environments/common/squash_javascript.yml:

    
    ---
    disabled: false
    # allowed_domains: * # to allow all domains
    allowed_domains: [] # to explicitly list domains
    

    We could also by default add either Squash::Configuration.javascript_dogfood[:APIHost] and/or Squash::Configuration.dogfood.api_host but I think often enough they could be different than the public hostname of Squash itself (at least, I know they are in my setup), so it may just be easier to ask people to list them explicitly.

    I'm about to experiment with this shortly, but if you have no objections to the general idea, I'll prepare a pull request.

    (This is related to SquareSquash/javascript#2)

    feature 
    opened by bjeanes 9
  • Private Github repos

    Private Github repos

    Anyway to add a private repo on Github?

    question 
    opened by gregwinn 9
  • Support building a deployable and self-executable WAR file of Squash

    Support building a deployable and self-executable WAR file of Squash

    Work:

    • [x] Create (optionally) self-executable WAR file
    • [x] Bundle assets into WAR file (relies on #53)
    • [x] Make repo clone path (currently hardcoded to tmp/repos) configurable since this path is inside the WAR and doesn't accommodate multiple instances running simultaneously (awaiting merge in #61).
    • [x] Currently only rake sub-task works, get all bundler bin stubs executable from the WAR (see jruby/warbler#136 and jruby/warbler#141)
    • [ ] warbler gem should only be in :development group only. See comment in Gemfile for why it currently is not. Tracked as jruby/warbler#142.
    • [x] Allow for configuration to be provided post-compilation so that production config details are not needed on developer/deployer machines or CI. This could be done a few ways (looking for input):
      • Adding an initializer that provides Configoro with an additional directory of configs to load (though this doesn't account for config/database.yml)
      • Adjusting Configoro's YAML loading to do ERB-interpolation (like Rails does) to provide config with Java properties or ENV vars
      • Teach Configoro how to be overridden by Java properties or ENV
      • Put an interface between config setting and config usage and have different adapters (ENV adapter, for example — useful for Heroku deployers)
      • Whatever comes out of #36
      • Something much simpler that I am yet to think of, since known of the above solutions are silver bullets or clearly improvements.
    feature 
    opened by bjeanes 8
  • Git fetch fails with 'not a git repository'

    Git fetch fails with 'not a git repository'

    I noticed that posting to api/1.0/notify never resulted in any Occurrences being created. After tailing the production log, it seems that either Squash or ruby-git is confused:

    E, [2014-01-06T23:37:29.061445 #29438] ERROR -- : -- ERROR IN OccurrencesWorker 47798820 --
    E, [2014-01-06T23:37:29.061694 #29438] ERROR -- : git fetch "origin"  2>&1:fatal: Not a git repository: '/home/squash/web/tmp/repos/af27dac12eff9b6caf58bd0a0aff05d90524b25e.git'
    
    E, [2014-01-06T23:37:29.061820 #29438] ERROR -- : /home/squash/.rvm/gems/[email protected]/bundler/gems/ruby-git-4aae92a0dee4/lib/git/lib.rb:742:in `command'
    /home/squash/.rvm/gems/[email protected]/bundler/gems/ruby-git-4aae92a0dee4/lib/git/lib.rb:594:in `fetch'
    /home/squash/.rvm/gems/[email protected]/bundler/gems/ruby-git-4aae92a0dee4/lib/git/base.rb:345:in `fetch'
    /home/squash/web/app/models/project.rb:195:in `block in repo'
    /home/squash/web/lib/file_mutex.rb:51:in `block (2 levels) in lock!'
    /home/squash/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/timeout.rb:69:in `timeout'
    /home/squash/web/lib/file_mutex.rb:49:in `block in lock!'
    /home/squash/web/lib/file_mutex.rb:46:in `open'
    /home/squash/web/lib/file_mutex.rb:46:in `lock!'
    /home/squash/web/app/models/project.rb:195:in `repo'
    /home/squash/web/lib/blamer/recency.rb:63:in `resolve_revision'
    /home/squash/web/lib/workers/occurrences_worker.rb:179:in `set_deploy_and_commit'
    /home/squash/web/lib/workers/occurrences_worker.rb:77:in `perform'
    /home/squash/web/lib/workers/occurrences_worker.rb:45:in `perform'
    /home/squash/web/lib/background_runner/multithread.rb:31:in `block in run'
    /home/squash/web/lib/multithread.rb:64:in `spinoff'
    /home/squash/web/lib/background_runner/multithread.rb:31:in `run'
    /home/squash/web/lib/background_runner.rb:38:in `run'
    /home/squash/web/app/controllers/api/v1_controller.rb:63:in `notify'
    ...
    

    I've attempted to track down why this is failing, but without much success. I can manually git fetch "origin", using the Passenger user. In the rails console, Git.open("/path/to/tmp/repo").fetch("origin") succeeds by returning the empty string. As far as my middling git knowledge can tell, the repository is intact and accessible. Any idea what could be going wrong?

    Using Ubuntu 12.04, nginx, and Passenger on MRI 1.9.3-p484, FWIW.

    opened by benjamin-bader 7
  • Optional Resque Integration

    Optional Resque Integration

    For MRI Ruby use, allow an optional config parameter to determine whether or not Resque should override default use of Multithread for handling workers.

    feature 
    opened by openmailbox 7
  • Updated LICENSE.txt

    Updated LICENSE.txt

    opened by cs-sohan 0
  • improved docs

    improved docs

    opened by san0808 0
  • Update README.md

    Update README.md

    opened by iamabdulahad 0
  • Make changes in readme .

    Make changes in readme .

    Make some best attractive changes in Readme.

    opened by HarshKumar2001 0
  • HelloNew

    HelloNew

    Open Source practice

    opened by ag66129 0
  • Update contributing link in README

    Update contributing link in README

    opened by nickhammond 0
  • Bug reporting fails when git repo has not been fetched

    Bug reporting fails when git repo has not been fetched

    project.repo.object(revision) throws when it can't find the commit (the commit happened after the last time the repo was fetched).

    E, [2017-03-13T09:01:24.885656 #27338] ERROR -- : -- ERROR IN OccurrencesWorker 49810320 --
    E, [2017-03-13T09:01:24.885739 #27338] ERROR -- : git cat-file "-t" "6e96b806e7ba214246c08bf2c32618af2b261df3"  2>&1:error: unable to find 6e96b806e7ba214246c08bf2c32618af2b261df3
    fatal: git cat-file 6e96b806e7ba214246c08bf2c32618af2b261df3: bad file
    E, [2017-03-13T09:01:24.886029 #27338] ERROR -- : /home/web/.rvm/gems/[email protected]/bundler/gems/ruby-git-eeab421f5ca7/lib/git/lib.rb:724:in `command'
    /home/web/.rvm/gems/[email protected]/bundler/gems/ruby-git-eeab421f5ca7/lib/git/lib.rb:136:in `object_type'
    /home/web/.rvm/gems/[email protected]/bundler/gems/ruby-git-eeab421f5ca7/lib/git/object.rb:262:in `new'
    /home/web/.rvm/gems/[email protected]/bundler/gems/ruby-git-eeab421f5ca7/lib/git/base.rb:153:in `object'
    /var/www/apps/squash_20170319/lib/blamer/recency.rb:61:in `resolve_revision'
    /var/www/apps/squash_20170319/lib/workers/occurrences_worker.rb:189:in `set_deploy_and_commit'
    /var/www/apps/squash_20170319/lib/workers/occurrences_worker.rb:77:in `perform'
    /var/www/apps/squash_20170319/lib/workers/occurrences_worker.rb:45:in `perform'
    /var/www/apps/squash_20170319/lib/background_runner/multithread.rb:31:in `block in run'
    /var/www/apps/squash_20170319/lib/multithread.rb:64:in `spinoff'
    /var/www/apps/squash_20170319/lib/background_runner/multithread.rb:31:in `run'
    /var/www/apps/squash_20170319/lib/background_runner.rb:38:in `run'
    /var/www/apps/squash_20170319/app/controllers/api/v1_controller.rb:63:in `notify'
    

    The code seems to expect it to return nil, when in fact it raises an exception. The fix:

    diff --git a/lib/blamer/recency.rb b/lib/blamer/recency.rb
    index 23a211f..d5ef0e4 100644
    --- a/lib/blamer/recency.rb
    +++ b/lib/blamer/recency.rb
    @@ -58,7 +58,12 @@ module Blamer
       class Recency < Base
     
         def self.resolve_revision(project, revision)
    -      commit   = project.repo.object(revision)
    +      begin
    +        commit   = project.repo.object(revision)
    +      rescue Git::GitExecuteError
    +        # Try fetching
    +        commit = nil
    +      end
           if commit.nil?
             project.repo(&:fetch)
             commit = project.repo.object(revision)
    
    opened by JasonBarnabe 0
  • "fatal: Not a git repository" loading bug

    git '--git-dir=/var/www/apps/squash_new/tmp/repos/9e3c81a890dc2672a028f90882720f25a92a7423.git' cat-file '-t' '1bb6d3d3e401638d133ebb79798729dfb3092bf8'  2>&1:fatal: Not a git repository: '/var/www/apps/squash_new/tmp/repos/9e3c81a890dc2672a028f90882720f25a92a7423.git'
    

    The git-dir option is supposed to point to the .git directory.

    diff --git a/app/models/project.rb b/app/models/project.rb
    index 625f852..adf06f0 100644
    --- a/app/models/project.rb
    +++ b/app/models/project.rb
    @@ -196,7 +196,7 @@ class Project < ActiveRecord::Base
         repo_mutex.synchronize do
           @repo ||= begin
             exists = File.exist?(repo_path) || clone_repo
    -        exists ? Git.bare(repo_path) : nil
    +        exists ? Git.bare("#{repo_path}/.git") : nil
           end
         end
    
    opened by JasonBarnabe 0
  • ActionView::Template::Error in signup form

    ActionView::Template::Error in signup form

    ActionView::Template::Error (wrong number of arguments (given 4, expected 5)):
        62:       def signup_form
        63:         div(class: 'row') do
        64:           div(class: 'two columns') { text! '&nbsp;' }
        65:           form_for(@user || User.new, url: signup_url, html: {class: 'eight columns whitewashed'}) do |f|
        66:             h3 "Don’t have an account yet?"
        67: 
        68:             input type: 'hidden', name: 'next', value: params[:next]
      app/views/sessions/new.html.rb:65:in `block in signup_form'
      app/views/sessions/new.html.rb:63:in `signup_form'
      app/views/sessions/new.html.rb:35:in `block (2 levels) in body_content'
      app/views/sessions/new.html.rb:32:in `block in body_content'
      app/views/layouts/application.html.rb:81:in `block (4 levels) in modal_section'
      app/views/layouts/application.html.rb:81:in `block (3 levels) in modal_section'
      app/views/layouts/application.html.rb:79:in `block (2 levels) in modal_section'
      app/views/layouts/application.html.rb:78:in `block in modal_section'
      app/views/layouts/application.html.rb:77:in `modal_section'
      app/views/sessions/new.html.rb:30:in `body_content'
      app/views/layouts/application.html.rb:161:in `block in body_portion'
      app/views/layouts/application.html.rb:148:in `body_portion'
      app/views/layouts/application.html.rb:27:in `block in content'
      app/views/layouts/application.html.rb:25:in `content'
      app/views/sessions/new.html.rb:1:in `_app_views_sessions_new_html_rb__159209451951245326_27606700'
      app/middleware/ping.rb:29:in `call'
    
    opened by JasonBarnabe 1
  • Duplicates are not resolved when the duplicate_of is

    Duplicates are not resolved when the duplicate_of is

    How are duplicates supposed to work? Shouldn't a duplicate be resolved when its connected bug is resolved? Currently when resolving a bug its duplicates still show up in the unresolved list.

    opened by koffeinfrei 0
RGB lighting management front-end application for GNU/Linux. Powered by OpenRazer (but soon to be vendor agnostic)

An open source RGB lighting management front-end application to customise OpenRazer peripherals on GNU/Linux. Soon to be vendor agnostic! The next gen

Polychromatic 695 Sep 23, 2021
Open source API management platform

About Fusio is an open source API management platform which helps to build and manage REST APIs. Fusio provides all tools to quickly build an API from

Apioo 997 Sep 15, 2021
Self-hosted VirusTotal / MetaDefender wannabe with API, demo UI and Scanners running in Docker.

MalwareMultiScan Self-hosted VirusTotal / OPSWAT MetaDefender wannabe API for scanning URLs and files by multiple antivirus solutions. IMPORTANT: vers

Volodymyr Smirnov 237 Sep 14, 2021
Open source back-end server for web, mobile and IoT. The backend for busy developers. (self-hosted or hosted)

A scalable, multitenant backend for the cloud. Para is a scalable, multitenant backend server/framework for object persistence and retrieval. It helps

Erudika 408 Sep 20, 2021
Personal CRM. Remember everything about your friends, family and business relationships.

Personal Relationship Manager Monica is a great open source personal relationship management system. Introduction Purpose Features Who is it for? What

Monica 13.3k Sep 24, 2021
Sharetribe Go is a source available marketplace software, also available as a hosted, no-code SaaS product. For a headless, API-first marketplace solution, check out Sharetribe Flex: https://www.sharetribe.com/flex.

Sharetribe Sharetribe develops advanced marketplace software for every business life cycle stage. Sharetribe Go gives you the complete feature set to

Sharetribe 2.2k Sep 24, 2021
A platform for community discussion. Free, open, simple.

Discourse is the 100% open source discussion platform built for the next decade of the Internet. Use it as a: mailing list discussion forum long-form

Discourse 34.1k Sep 24, 2021
⚓️ Anchr provides you with a toolbox for tiny tasks on the internet, especially bookmark collections

Anchr - Image uploads, bookmarks and shortlink service Anchr is a useful little helper or toolbox or the like for common tasks on the internet. It com

Ferdinand Mütsch 87 Sep 5, 2021
TMSU lets you tags your files and then access them through a nifty virtual filesystem from any other application.

Overview TMSU is a tool for tagging your files. It provides a simple command-line utility for applying tags and a virtual filesystem to give you a tag

Paul Ruane 1.6k Sep 24, 2021
🔥 Open source static (serverless) status page. Uses hyperfast Go & Hugo, minimal HTML/CSS/JS, customizable, outstanding browser support (IE8+), preloaded CMS, read-only API, badges & more.

Über fast, backwards compatible (IE8+), tiny, and simple status page built with Hugo. Completely free with Netlify. Comes with Netlify CMS, read-only

cState 1.4k Sep 17, 2021
The Rails application that powers OpenStreetMap

"The Rails Port" This is The Rails Port, the Ruby on Rails application that powers the OpenStreetMap website and API. The software is also known as "o

OpenStreetMap on GitHub 1.4k Sep 20, 2021
An agile project planning tool

Fulcrum Fulcrum is an application to provide a user story based backlog management system for agile development teams. See the project page for more d

null 1.5k Aug 13, 2021
Send browser notifications from your terminal. No installation. No registration.

Notica Send browser notifications from your terminal. No installation. No registration. https://notica.us/ Usage Notica is a Bash function / alias tha

Tanner Collin 250 Sep 17, 2021
📻 Webserver for downloading youtube videos. Ready for docker.

?? ytdl-webserver Webserver for downloading youtube videos. Ready for docker. Demo If you have questions, read the blog post. Installation As a server

null 1.3k Sep 15, 2021
Self hosted identity verification layer with GraphQL.

graph-vl Self hosted identity verification layer with GraphQL. Introduction graph-vl is the verification layer of verifid developed with GraphQL. It's

VerifID 20 Jul 21, 2021
Mobile Shell

Mosh: the mobile shell Mosh is a remote terminal application that supports intermittent connectivity, allows roaming, and provides speculative local e

Mosh (mobile shell) 10.3k Sep 17, 2021
A Hassle-Free Way to Self-Host Google Fonts. Get eot, ttf, svg, woff and woff2 files + CSS snippets

google-webfonts-helper A Hassle-Free Way to Self-Host Google Fonts This service might be handy if you want to directly download all .eot, .woff, .woff

Mario Ranftl 8.5k Sep 23, 2021