Giter VIP home page Giter VIP logo

redmine-code-audit's Introduction

Redmine Code Audit

Github Release Software License Build Status Github All Releases

Code Audit is a Redmine plugin that allows users to post audits on commits in repositories linked to projects.

Compatibility

This plugin version is compatible only with Redmine 3.0 and later.

Installation

  1. Download the .ZIP archive, extract files and copy the plugin directory into #{REDMINE_ROOT}/plugins.

  2. Make a backup of your database, then run the following command to update it:

    bundle exec rake redmine:plugins:migrate RAILS_ENV=production 
    
  3. Restart Redmine.

  4. Login and enable the "Audit" module on projects you want to use it.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

This code is licensed under the MIT license. Please see the license file for more information.

redmine-code-audit's People

Contributors

xel1045 avatar tomzx avatar

Stargazers

 avatar  avatar

Watchers

Martin Blanchette avatar  avatar James Cloos avatar  avatar Patricia Gagnon-Renaud avatar  avatar

redmine-code-audit's Issues

Create a seeder of a sample project with code audits

The goal of this issue is to create a seeder that will create a project that can be used to do development of the plugin with.

  • Clone repository with --bare
  • Create project
  • Add repository to project
  • Create audits
  • Create comments with various states

Sorting the status column has no defined order

The sorting is done on the string values in the status column. For now, it is not critical, but it would probably make sense that the sorted order reflect the order of the items in the select when you edit an audit.

Add status to audits

From Phabricator:

  const NONE                    = '';
  const AUDIT_NOT_REQUIRED      = 'audit-not-required';
  const AUDIT_REQUIRED          = 'audit-required';
  const CONCERNED               = 'concerned';
  const ACCEPTED                = 'accepted';
  const AUDIT_REQUESTED         = 'requested';
  const RESIGNED                = 'resigned';
  const CLOSED                  = 'closed';
  const CC                      = 'cc';

An internal error is generated when view the audits page on Redmine 3

Here's the callstack:

ArgumentError (wrong number of arguments (1 for 0)):
  activerecord (4.2.1) lib/active_record/scoping/named.rb:24:in `all'
  activerecord (4.2.1) lib/active_record/relation/delegation.rb:94:in `public_send'
  activerecord (4.2.1) lib/active_record/relation/delegation.rb:94:in `block in method_missing'
  activerecord (4.2.1) lib/active_record/relation.rb:302:in `scoping'
  activerecord (4.2.1) lib/active_record/relation/delegation.rb:94:in `method_missing'
  plugins/code_audit/app/models/audit_query.rb:91:in `audits'
  plugins/code_audit/app/controllers/audits_controller.rb:51:in `index'
  actionpack (4.2.1) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (4.2.1) lib/abstract_controller/base.rb:198:in `process_action'
  actionpack (4.2.1) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (4.2.1) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
  activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:117:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:555:in `block (2 levels) in compile'
  activesupport (4.2.1) lib/active_support/callbacks.rb:505:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:505:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:92:in `_run_callbacks'
  activesupport (4.2.1) lib/active_support/callbacks.rb:776:in `_run_process_action_callbacks'
  activesupport (4.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.1) lib/abstract_controller/callbacks.rb:19:in `process_action'
  actionpack (4.2.1) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (4.2.1) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
  activesupport (4.2.1) lib/active_support/notifications.rb:164:in `block in instrument'
  activesupport (4.2.1) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (4.2.1) lib/active_support/notifications.rb:164:in `instrument'
  actionpack (4.2.1) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
  actionpack (4.2.1) lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
  activerecord (4.2.1) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (4.2.1) lib/abstract_controller/base.rb:137:in `process'
  actionview (4.2.1) lib/action_view/rendering.rb:30:in `process'
  actionpack (4.2.1) lib/action_controller/metal.rb:196:in `dispatch'
  actionpack (4.2.1) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
  actionpack (4.2.1) lib/action_controller/metal.rb:237:in `block in action'
  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:74:in `call'
  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:74:in `dispatch'
  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:43:in `serve'
  actionpack (4.2.1) lib/action_dispatch/journey/router.rb:43:in `block in serve'
  actionpack (4.2.1) lib/action_dispatch/journey/router.rb:30:in `each'
  actionpack (4.2.1) lib/action_dispatch/journey/router.rb:30:in `serve'
  actionpack (4.2.1) lib/action_dispatch/routing/route_set.rb:819:in `call'
  rack-openid (1.4.2) lib/rack/openid.rb:98:in `call'
  request_store (1.0.5) lib/request_store/middleware.rb:9:in `call'
  rack (1.6.1) lib/rack/etag.rb:24:in `call'
  rack (1.6.1) lib/rack/conditionalget.rb:25:in `call'
  rack (1.6.1) lib/rack/head.rb:13:in `call'
  actionpack-xml_parser (1.0.2) lib/action_dispatch/xml_params_parser.rb:16:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/params_parser.rb:27:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/flash.rb:260:in `call'
  rack (1.6.1) lib/rack/session/abstract/id.rb:225:in `context'
  rack (1.6.1) lib/rack/session/abstract/id.rb:220:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/cookies.rb:560:in `call'
  activerecord (4.2.1) lib/active_record/query_cache.rb:36:in `call'
  activerecord (4.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:88:in `call'
  activesupport (4.2.1) lib/active_support/callbacks.rb:88:in `_run_callbacks'
  activesupport (4.2.1) lib/active_support/callbacks.rb:776:in `_run_call_callbacks'
  activesupport (4.2.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.1) lib/rails/rack/logger.rb:38:in `call_app'
  railties (4.2.1) lib/rails/rack/logger.rb:20:in `block in call'
  activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
  activesupport (4.2.1) lib/active_support/tagged_logging.rb:26:in `tagged'
  activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:in `tagged'
  railties (4.2.1) lib/rails/rack/logger.rb:20:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
  rack (1.6.1) lib/rack/methodoverride.rb:22:in `call'
  rack (1.6.1) lib/rack/runtime.rb:18:in `call'
  activesupport (4.2.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
  actionpack (4.2.1) lib/action_dispatch/middleware/static.rb:113:in `call'
  rack (1.6.1) lib/rack/sendfile.rb:113:in `call'
  railties (4.2.1) lib/rails/engine.rb:518:in `call'
  railties (4.2.1) lib/rails/application.rb:164:in `call'
  railties (4.2.1) lib/rails/railtie.rb:194:in `public_send'
  railties (4.2.1) lib/rails/railtie.rb:194:in `method_missing'
  thin (1.6.3) lib/thin/connection.rb:86:in `block in pre_process'
  thin (1.6.3) lib/thin/connection.rb:84:in `catch'
  thin (1.6.3) lib/thin/connection.rb:84:in `pre_process'
  thin (1.6.3) lib/thin/connection.rb:53:in `process'
  thin (1.6.3) lib/thin/connection.rb:39:in `receive_data'
  eventmachine (1.0.7) lib/eventmachine.rb:187:in `run_machine'
  eventmachine (1.0.7) lib/eventmachine.rb:187:in `run'
  thin (1.6.3) lib/thin/backends/base.rb:73:in `start'
  thin (1.6.3) lib/thin/server.rb:162:in `start'
  thin (1.6.3) lib/thin/controllers/controller.rb:87:in `start'
  thin (1.6.3) lib/thin/runner.rb:200:in `run_command'
  thin (1.6.3) lib/thin/runner.rb:156:in `run!'
  thin (1.6.3) bin/thin:6:in `<top (required)>'
  /usr/local/rvm/gems/ruby-2.2.1/bin/thin:23:in `load'
  /usr/local/rvm/gems/ruby-2.2.1/bin/thin:23:in `<main>'
  /usr/local/rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
  /usr/local/rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

Class patch are not correctly applied

Normally, we're suppose to include method to the existing class. Here's an example:

require_dependency 'project'

module CodeAudit
    module ProjectPatch
        def self.included(base) # :nodoc:
            base.extend(ClassMethods)
            base.send(:include, InstanceMethods)

            base.class_eval do
                unloadable

                has_many :audits
            end
        end

        module ClassMethods
        end

        module InstanceMethods
        end
    end
end

Project.send(:include, CodeAudit::ProjectPatch) unless Project.included_modules.include? CodeAudit::ProjectPatch

Edit existing comments

It is currently not possible to edit existing comments we left, if we've made a mistake for example.

Add an indicator on the menu to show unresolved audit

From the Phabricator documentation:

  • Required Audits are open audit requests that require you, a project you are a member of, or a package you own to audit a commit. An audit request is closed when you approve the associated commit.
  • Problem Commits are commits you authored which someone has raised a concern about in audit. Problem commits go away when you satisfy all the auditors and get them to "Approve" the commit.

Audit auditors backend

Add a table which links audits to users and determines whether a user is an auditor for a particular audit.

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.