Radhika Chippada [Sat, 24 Jan 2015 18:07:42 +0000 (13:07 -0500)]
3686: when a repository is manageable by a user, make repository name a link in manage_account page. In addition, do not offer Attributes tab in repository page if the user is not an admin.
Tim Pierce [Thu, 22 Jan 2015 22:05:36 +0000 (17:05 -0500)]
4889: improve error message, unit test
Per review in #4889-17:
Updated the CopyPipeToChan error message to be more descriptive, for the
benefit of anyone reading log output.
Corrected the test to confirm that the error message is received even if
the child process does not close the stderr log (which matches the usage
patterns in production).
Tim Pierce [Thu, 22 Jan 2015 20:40:46 +0000 (15:40 -0500)]
4889: added CopyPipeToChan unit test
Added TestCopyPipeToChanLongLines test to confirm that when
CopyPipeToChan attempts to read a line too long for bufio.Scanner, that
it generates an error message on the output channel.
Tim Pierce [Wed, 21 Jan 2015 20:18:16 +0000 (15:18 -0500)]
4889: close the child stderr pipe before returning
Updated CopyPipeToChan to close the child's stderr pipe before
returning, so that even if it returns for some reason other than
EOF (e.g. line too long) the child will not deadlock on writing stderr
output.
Brett Smith [Wed, 21 Jan 2015 16:38:18 +0000 (11:38 -0500)]
4967: crunch-job unmounts old Keep mounts more robustly.
The previous version looked for mounts under $JOB_WORK before
unmounting anything. We long ago started mounting under $TASK_WORK,
so unmounting hasn't been working for a while. This version unmounts
every FUSE mount with "keep" in the path, so it will be much more
flexible.
I also changed the cleanup to use bash -e, so the logs are more likely
to indicate if there was trouble during the cleanup step.
Tom Clegg [Tue, 20 Jan 2015 06:20:54 +0000 (01:20 -0500)]
3021: Use Marshal dump/load to save @old_attributes. Otherwise, hashes
in @old_attributes can contain references to objects that can be
mutated by callers, which could result in the new attributes being
logged incorrectly as old_attributes.
Brett Smith [Thu, 15 Jan 2015 22:30:28 +0000 (17:30 -0500)]
4840: Workbench selection actions are submitted by POST.
The previous implementation could get 414 Request URI Too Long
responses by stuffing a large number of selections into the link href.
This commit sidesteps that problem by POSTing the data with a hidden
form instead. It's based on rails-ujs' strategy for handling links
with data-method that we were already using for some selection
actions, so it should be minimally disruptive.
Tim Pierce [Fri, 16 Jan 2015 19:51:28 +0000 (14:51 -0500)]
4922: force google-api-python-client install
Install google-api-python-client with 'pip install -I' to fix the case
where the Docker image already has an older version of
google-api-python-client installed.
Brett Smith [Wed, 14 Jan 2015 20:22:24 +0000 (15:22 -0500)]
3835: PySDK raises NotFoundError when all Keep services report such.
Previously, we raised this error when >= 75% of services reported
such, as the most reasonable available cutoff to make the
distinction. Now that Keep exceptions include detailed information
about the error from each service, it seems useful to make this
threshold stricter, and only raise NotFoundError when we're sure
that's the problem. See further discussion from
<https://arvados.org/issues/3835#note-11>.
Brett Smith [Fri, 9 Jan 2015 18:15:07 +0000 (13:15 -0500)]
3835: Improve error reporting in PySDK Keep client.
* Create a KeepRequestError base exception to store information about
errors encountered when talking to Keep services, and include those
in the default formatting.
* Include Keep service error information in exceptions raised by the
Keep client.
Brett Smith [Wed, 14 Jan 2015 17:47:38 +0000 (12:47 -0500)]
Python packages use python-daemon<2.
It's good to see python-daemon under active development, but they're
working out so many little issues so rapidly that we're having a hard
time keeping on top of them in our builds. We're pinning the version
until things settle down a little. No issue #.
Radhika Chippada [Wed, 14 Jan 2015 16:10:27 +0000 (11:10 -0500)]
3686: Support sharing pane in repository show page.
Refactor current project sharing work into application area and reuse it for sharing repositories.
Refactor methods used by tests into helper and reuse in repository sharing tests.
Tom Clegg [Sat, 10 Jan 2015 07:55:55 +0000 (02:55 -0500)]
3021: Use Oj to encode API responses, and to decode them in tests.
* We use the Oj and multi_json gems, which makes Oj the default JSON
parser. However, Rails' ActiveRecord::Base overrides this and uses
the native JSON parser, which is slow. In our case we have two
render() calls that represent nearly all cases where we ask
ActiveRecord to serialize for us. In both cases we already have a
hash (not a model object), and we always want JSON responses. So we
can fix the performance problem simply by calling Oj.dump()
ourselves, and passing the resulting JSON (instead of the hash) to
render().
Tom Clegg [Sat, 10 Jan 2015 07:54:22 +0000 (02:54 -0500)]
3021: Do not compute etag for initial model state unless/until actually needed.
Profiling shows that making a copy of the attributes hash (which
modelinstance.attributes() does) is much faster than
md5(attrs.inspect). Given that md5(attrs_when_loaded) is never needed
in the common case where a model gets loaded but never changed or
written back to the database, it's better to just stash a copy of the
attributes hash when loading, and defer computing the md5 until
it's time to write a log entry.
Tom Clegg [Sat, 10 Jan 2015 07:18:00 +0000 (02:18 -0500)]
3021: Call Rails.application.eager_load! only once, not every single
time we use the uuid prefix cache, for two reasons:
* The reason it's here at all is to ensure that all descendant classes
of ActiveRecord::Base have been defined, so we don't miss any model
classes when building the uuid prefix cache. Therefore, it's more
robust (and clearer) to call it from the function where the cache
gets built, rather than calling it from a function that _uses_ the
cache.
* eager_load! is (evidently) not very efficient about noticing that
everything is already loaded: when called too often, it showed up
prominently in profiling results.
Tom Clegg [Sat, 10 Jan 2015 08:49:25 +0000 (03:49 -0500)]
3021: Add a performance test.
ActiveSupport doesn't seem to think its profiling code is compatible
with Ruby 2.1, but it seems to work if you patch up a version check in
activesupport:
Peter Amstutz [Mon, 12 Jan 2015 17:23:40 +0000 (12:23 -0500)]
4924: Update prints uuid from results, not the uuid originally specified.
Catch Oj::ParseError as well as JSON::ParserError. Titleize only HTTP status
messages, not every error message.