Giter Site home page Giter Site logo

integrity's Introduction

integrity's People

Contributors

atmos avatar balinterdi avatar bishop avatar bjeanes avatar byroot avatar copiousfreetime avatar defunkt avatar foca avatar garethr avatar grahamc avatar jalada avatar jamesgolick avatar jangosteve avatar lukaszx0 avatar mfrost avatar mileszs avatar mislav avatar mrtazz avatar p avatar pd avatar ph avatar qrush avatar roberto avatar ryanhouston avatar seawolf avatar simonask avatar sr avatar technicalpickles avatar will avatar wilson 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  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

Watchers

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

integrity's Issues

Removing c.push line in init.rb causes app to fail at startup

If you comment (or remove) the line in init.rb for c.push, like this...

c.push :github, "SECRET"

then Integrity fails to start with this error message...
Unknown push service

In retrospect I've learned that this is the endpoint for the post-receive hook. However I'm not using github, and would like to remove the reference to github (:github, "SECRET") but this is apparently not possible.

sr asked me to open this issue. Below is the IRC snippet...

[15:46:09] mhoydis | if i comment/remove the poller line from init.d (because i'm not using the poller, right? definitely my project isn't on github...)

[15:46:15] mhoydis | # c.push :github, "SECRET"

[15:46:38] mhoydis | ttthhaatts when this "Unknown push service" business happens

[15:46:53] mhoydis | regardless of which builder i choose

[15:47:00] sr | mhoydis, its not a poller but a endpoint for github's post-receive hook.

[15:47:07] sr | mhoydis, but thats definitely a bug

[15:47:24] sr | mind to open an issue on http://github.com/integrity/integrity/issues?

[15:47:34] mhoydis | sr: should i just leave that line as is, or can i remove part that refers to github?

[15:47:50] mhoydis | sr: i will open that issue

[15:48:17] sr | mhoydis, left it as is for now

[15:48:31] mhoydis | okie doke

Invalid multibyte char

Building for the first time a project give this error:

/home/david/.rvm/gems/ruby-1.9.1-p378/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load': /home/david/integrity/test/unit/commit_test.rb:15: invalid multibyte char (US-ASCII) (SyntaxError)
/home/david/integrity/test/unit/commit_test.rb:15: invalid multibyte char (US-ASCII)
/home/david/integrity/test/unit/commit_test.rb:15: syntax error, unexpected $end, expecting ')'
:author => "Nicolás Sanguinetti <contacto@nicol...

Solved with this little patch:

diff --git a/test/unit/commit_test.rb b/test/unit/commit_test.rb
index c776634..e31c89d 100644
--- a/test/unit/commit_test.rb
+++ b/test/unit/commit_test.rb
@@ -1,3 +1,4 @@
+# encoding: UTF-8
require "helper"

class CommitTest < IntegrityTest

Prevent builds from running in parallel

[I entered this in lighthouse before at http://integrity.lighthouseapp.com/projects/14308/tickets/200-prevent-builds-from-running-in-parallel because I've overlooked that integrity apparently only uses the github issue tracker, so I'm copying it over here now]

When I push while there is still a previous build running then a new build will be started and apparently they run in parallel. With rails specs that operate on the same test database this creates all kinds of conflicts.

Ideally I would want that all older builds are aborted and only one build runs at once, which should be for the latest commit.

Is this possible somehow?

I also tried to remove the line
c.build_all!
from the config but that does not have the desired effect.

Remove build output from the view where it is not available

It seems pointless to display the build output section on build views when it is not available yet.

This commit fixes this by only displaying the section when a build has completed
http://github.com/econsultancy/integrity/commit/3d9da48864f9a2504b3d3b70be7020256cc6d840

Of course it would need tweaking slightly if the patch to show build output when they are in progress as outlined here http://github.com/integrity/integrity/issues#issue/20

[PATCH] Allow using github-like web hooks payload not only for Github

Hi guys!

I'm a developer from Beanstalk (http://beanstalkapp.com), a Subversion/Git hosting platform. We've been trying to get Integrity working with Beanstalk repos, but had problems with web hooks format.

Our dilemma was that we wanted to keep our web hooks as much like github's as possible, because github guys set a good standard of what should be there.

We really hoped that our github-like payload will work right away with Integrity, but unfortunately it turned out that you guys hard coded the Github URL in the source, which left us with no other way other than patching Integrity or changing our payload to more generic and less useful Git payload format that you support.

We decided that we would really love to give our users ease way to integrate with Integrity so we decided to try the patch route.

The patch is really simple - we just added another attribute to payload, called "uri" that stores a complete Git URI. If it's present, we use it, if it's not we use the old way. Github doesn't supply this attribute, so there's no overlap.

Now the question is, is this something you guys want to include in official Integrity or will we have to maintain the fork? If there's anything I should do to make this pulled, please let me know. This is a high priority for us Beanstalkers.

The single commit that resolves the issue is: http://github.com/railsmonk/integrity/commit/9d62ab4ff8b5e252d89860b0d273ef4e1dde5ab5

Anyway, thanks for the great work on Integrity!

Best regards,
Dima Sabanin
http://railsmonk.com

Using Integrity from a non-subdomain breaks Cucumber/WebRat features for Rails

From the original ticket on LightHouse http://integrity.lighthouseapp.com/projects/14308/tickets/191
I have Integrity set up as a subdirectory, instead of a subdomain (i.e. dev.mydomain.com/integrity) and it is breaking my Cucumber/WebRat steps for a Rails application. Most features pass fine, but a few of them gives errors like this:

No route matches "/integrity/" with {:method=>:get} (ActionView::TemplateError)
features/sign_out.feature:8:in `When I sign in as "[email protected]/password"'

No route matches "/integrity/" with {:method=>:get} (ActionView::TemplateError)
features/sign_out.feature:16:in `When I sign in with "remember me" as "[email protected]/password"'

No route matches "/integrity/" with {:method=>:get} (ActionView::TemplateError)
features/dashboard.feature:8:in `When I go to the homepage'

Since all features run fine on my machine, and they all mention /integrity/, which is part of my base URI for Integrity, I assumed it was a problem with Integrity. And sure enough, setting up and using ci.mydomain.com makes all the features pass.

But I want to keep the dev-subdomain, and have /integrity/ instead.

subversion don't support non-english environment and multi-line comments.

I read the source code of the bob(0.5.0) and found that it supports svn as the scm.
So I updated the projects table scm to svn.
However, I found that the head method can not run on non-english environment. I modified the code so that it can run.

def head
  `LANG=en_US.UTF-8 && svn info #{uri}`.split("\n").detect { |l| l =~ /^Revision: (\d+)/ }
  $1.to_s
end

Secondly, I found that it can not read multi-line svn comments, that is my modified the code:

def metadata(rev)
  dump = `svn log --non-interactive --revision #{rev} #{uri}`.split("\n")
  meta = dump[1].split(" | ")

  { "id"        => rev,
    "message"   => dump[3, dump.length - 4].join(";\n"),
    "author"    => meta[1],
    "timestamp" => Time.parse(meta[2]) }
end

But it seems the current integrity (0.2.2) does not support multi-line comments display on web page.

If build output is longer than 64Kb then the build appears to be left in the "... is building" state forever

If build output is longer than 64Kb then when integrity attempts to save the the build to the SQLLite database the save will fail (because the output column is limited to 64Kb).

In the web interface the build will appear to be left in the "... is building" state, and the output will be blank even though the build has been completed.

This can be fixed by expanding the output column to have a maximum length of 1Mb say, which is far less likely to be exceeeded. See http://github.com/econsultancy/integrity/commit/f00b57d881282170ffc49b0c3f091b96aabce668 for an implementation of this.

The behaviour of the app can also be improved by logging the failure to save the build when validation fails. See http://github.com/econsultancy/integrity/commit/0ad6db41350964feee3783ce01122a6024ad44c9

DOC setting up build environment

There are environment variables set that cause Rails applications to fail, at least when deployed with Passenger. Specifically, RUBYOPT and RACK_ENV needs to be unset before trying to test a Rails application.

Error running `bundle install` when building Integrity

~/integrity$ bundle install
/Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/installer.rb:84:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
Updating git://github.com/qrush/nap.git
Updating git://github.com/Manfred/broach.git
Updating git://github.com/tobi/delayed_job.git
Fetching source index from http://gemcutter.org
/Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/source.rb:59:in `main_specs': rubygems repository at http://gemcutter.org is not a valid source: Errno::EHOSTDOWN: Host is down - connect(2) (http://gemcutter.org/specs.4.8.gz) (ArgumentError)
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/source.rb:47:in `fetch_specs'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/source.rb:23:in `specs'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/installer.rb:107:in `index'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/installer.rb:106:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/installer.rb:106:in `index'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/installer.rb:71:in `resolve_remotely'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/installer.rb:41:in `specs'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/installer.rb:18:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/installer.rb:6:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/cli.rb:59:in `install'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/vendor/thor/task.rb:33:in `send'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/vendor/thor/task.rb:33:in `run'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/vendor/thor/invocation.rb:109:in `invoke'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/vendor/thor/invocation.rb:116:in `call'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/vendor/thor/invocation.rb:116:in `invoke'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/vendor/thor.rb:137:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/vendor/thor/base.rb:378:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/lib/bundler/vendor/thor.rb:124:in `start'
from /Library/Ruby/Gems/1.8/gems/bundler-0.9.7/bin/bundle:11
from /usr/bin/bundle:19:in `load'
from /usr/bin/bundle:19

~/integrity$ ruby --version
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
~/integrity$ gem --version
1.3.6
~/integrity$ git --version
git version 1.6.5.2
~/integrity$ gem list bundle --local

*** LOCAL GEMS ***

bundler (0.9.7)
~/integrity$ gem list gemcutter --local

*** LOCAL GEMS ***

gemcutter (0.4.1)

Sometimes builds do not complete when using threaded builder

I'm using Integrity to run a test suite in Selenium.
The suite is quite large (117 scenarios, 626 steps) and takes about an hour to complete.

The test suite completes successfully when run by hand on the server where Integrity is installed, that is, typing "cucumber" or "rake cucumber" in the builds/NNN folder.

The tests also runs smoothly using the Delayed::Job builder.

If using Ruby's threaded builder, though, the test suite sometimes do not complete.
That is, the status of the build is stuck to "Building" and does not finish.

Looking at the list of active processes, I see that no cucumber is running; as if Cucumber had ended before it should have, without updating the status of the build to "completed" in the Integrity database.

Looking at the Selenium Log, the last executed line say:
INFO - Command request: testComplete[, ] on session 0156a226da0...
INFO - Killing Firefox...


So it looks like Selenium has correctly ended… the only problem is that it ended BEFORE running all the tests.

This "bug" does not happen constantly, and the number of scenarios executed before suddenly stopping changes (they may be 50 or 60 out of the 117 scenarios I have).

Finally… I can run everything correctly using Delayed::Job as a builder, but I just wanted to point out that Ruby's threaded method can bring to this error.

I have also tried to increase the pool in init.rb, setting c.builder :threaded, 50 but without success.

Encoding of output prevents save in postgresql

Saving the output failed when using postgres with the following error message

ERROR -- : Exception occured during build: ERROR: invalid byte sequence for encoding "UTF8": 0xc32e
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".

Our build output contains a lot of non-ascii characters which are correctly displayed when running the build from a command line. I did not find out how to reliably teach IO.popen to produce correct UTF-8, so I ended up using iconv to save to the database. I hope someone knows a better way to fix this.

Here's the diff of the iconv fix: http://gist.github.com/329015

(and a require 'iconv' in init.rb)

Problem with rake

This is what I get when I run a build.

I, [2009-11-17T10:18:28.837130 #984]  INFO -- : Completed build 3c8aeb1b4884028b8da278cc1e5a4bb9f01e0960. Exited with false, got:
 /opt/railsapps/applications/integrity-master/vendor/gems/gems/rake-0.8.7/lib/rake: Is a directory - /opt/railsapps/applications/integrity-master/vendor/gems/gems/rake-0.8.7/lib/rake (Errno::EISDIR)
    from /opt/ruby-enterprise/bin/rake:19:in `load'
    from /opt/ruby-enterprise/bin/rake:19

Way to clean out old builds

Integrity's disk usage is pretty high right now over time (each project, each build, is a complete clone of the repository). Given that all build information is saved in the database, could Integrity get an action to clean all but the last 5 builds from the system, or even make this automatic?

Branch/ref parsing not git compliant

This line prevents valid git branch names from working with the github endpoint.
http://github.com/integrity/integrity/blob/master/lib/integrity/helpers/push.rb#L31

Specifically, branches are allowed to include slashes / for hierarchical grouping such as refs/heads/releases/2010/15, but the github endpoint looks for a project with a branch of "15" instead of "releases/2010/15".

The git refname rules are documented under git-check-ref-format.
http://www.kernel.org/pub//software/scm/git/docs/git-check-ref-format.html

Heroku compatibility is broken

I was unable to get Integrity working on Heroku using the directions and config prescribed.

The primary issue I ran into was Integrity via Sass attempted to write to the public folder which is read-only on Heroku. I was able to get it working using commits from the following fork.
http://github.com/glennr/integrity

git submodules

When a project uses git submodules, Integrity does not initialize them before running the build command. Integrity should do this recursively to ensure that if any submodule project itself uses submodules, that they are all initialized.

Problem with Rack 1.0.1 and Rails 2.3.5

I started a new project with Rails 2.3.4 and when I built I ended up with this error:

rake aborted!
can't activate rack (~> 1.0.1, runtime) for [], already activated rack-1.0.0 for []

Repo URI without .git extension for github service hook

In "Edit Project" the Repo URI should not end with ".git" to get the github service hook working.
SR's comment from IRC log:
"18:47 sr: nah. i just remembered that the code that grab the find the project based on the repository url provided in github's post-receive hook is...
18:48 sr: kinda retarded. so basically you have to use "[email protected]:user/project" as your project uri otherwise it won't find it
18:48 sr: lemme know if that works and if thats the issue, please open up a ticket so i don't forgot about it this time"

Support multiple tests for single projects

I have a somewhat "weird" request. I am working on a project, where I have two sets of tests, that test several aspects of the application (and are invoked via "rake testset1" and "rake testset2"). And while I can set up both tests in parallel, running the tests actually fails (usually).

I think the reason for that is that both tests run at the same time in the same directory. At times even the second checkout into the working dir fails.

A solution might be to assign a private namespace for each project, i.e. building the dir name not only from the revision id, but from the project ID as well.

Ruby 1.9 compat

I'm using integrity with ruby 1.9. bundle install went ok, but the builds fails with:

(in /home/david/integrity)
DataMapper::Sweatshop::Unique - ParseTree could not be loaded, anonymous uniques will not be allowed
Loaded suite /home/david/.rvm/gems/ruby-1.9.1-p378/gems/rake-0.8.7/lib/rake/rake_test_loader

And some test fails:

  1. Error:
    test_provides_a_build_url(BaseNotifierTest):
    RuntimeError: You need to install ParseTree to use anonymous an anonymous unique (gem install ParseTree). In the mean time, explicitly declare a key: unique(:my_key) { ... }

Integrity::Build#update! cannot be called on a dirty resource

I get this error when I am trying to a run a build. Here is the given stacktrace:

D, [2010-02-26T13:27:29.023079 #8952] DEBUG -- : (cd builds/1 && git fetch origin > /dev/null 2>&1)
D, [2010-02-26T13:27:34.084817 #8952] DEBUG -- : (cd builds/1 && git checkout origin/master > /dev/null 2>&1)
D, [2010-02-26T13:27:34.618099 #8952] DEBUG -- : (cd builds/1 && git reset --hard 15abc4820f69e54ae52dee8c0e6a6b7af60aaca7 > /dev/null 2>&1)
I, [2010-02-26T13:27:35.048231 #8952]  INFO -- : Build 15abc4820f69e54ae52dee8c0e6a6b7af60aaca7 exited with false got:
 Missing the Rails 2.3.5 gem. Please `gem install -v=2.3.5 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
(in /var/www/ci/builds/1)

E, [2010-02-26T13:27:35.070119 #8952] ERROR -- : /var/www/.bundle/ruby/1.8/gems/dm-core-0.10.2/lib/dm-core/resource.rb:1042:in `assert_update_clean_only'
/var/www/.bundle/ruby/1.8/gems/dm-core-0.10.2/lib/dm-core/resource.rb:338:in `update!'
./lib/integrity/builder.rb:41:in `complete'
./lib/integrity/builder.rb:16:in `build'
./lib/integrity/builder.rb:4:in `build'
./lib/integrity/builder/threaded.rb:14:in `call'
./lib/integrity/builder/threaded.rb:127:in `spawn'
./lib/integrity/builder/threaded.rb:120:in `initialize'
./lib/integrity/builder/threaded.rb:120:in `new'
./lib/integrity/builder/threaded.rb:120:in `spawn'
./lib/integrity/builder/threaded.rb:91:in `initialize'
./lib/integrity/builder/threaded.rb:91:in `new'
./lib/integrity/builder/threaded.rb:91:in `initialize'
./lib/integrity/builder/threaded.rb:9:in `new'
./lib/integrity/builder/threaded.rb:9:in `initialize'
./lib/integrity/configurator.rb:27:in `new'
./lib/integrity/configurator.rb:27:in `builder'
./init.rb:21
./lib/integrity.rb:50:in `call'
./lib/integrity.rb:50:in `configure'
./lib/integrity/core_ext/object.rb:3:in `tap'
./lib/integrity.rb:50:in `configure'
./init.rb:14
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
config.ru:1
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
config.ru:1:in `new'
config.ru:1
E, [2010-02-26T13:27:35.070235 #8952] ERROR -- : Exception occured during build: Integrity::Build#update! cannot be called on a dirty resource

I have altered the code to try to save the @build object but that does not appear to fix it. I should not have to alter the code.

Couldn't run clone

When attempting to run a build through integrity (running through Passenger) the git clone fails because the apache user (_www) does not have the correct (or any for that matter) SSH keys set up. There is NO indication at all that the build has even BEGUN to be processed and this I feel is misleading. Could you perhaps show the output of the git clone in the build output and set the build status to "cloning" or "building" at least before the git clone even runs? This would be most helpful!

update instead of full repository clone on each build

we recently upgraded to the most recent version of integrity and realized integrity is doing a full repository clone for each build now. This has been different in previous versions and slows down our build times significantly (our repository is about 150MB and we're using rails as a submodule).

What's the advantage of this approach? Is it to be able to do concurrent builds of multiple commits? Any chance of getting the old way of building back? If you'd point me to the point where this was introduced, I'd take a look myself.

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.