Project

General

Profile

Actions

Task #2674

closed

Review 0000-ruby-client-config branch

Added by Tom Clegg about 10 years ago. Updated about 10 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:

Related issues

Blocks Arvados - Idea #2039: New user sees a list of completed pipeline instances on Workbench dashboard, and can inspect the pipelines and data.  (Permissions/presentation)ClosedTom Clegg12/02/2013Actions
Actions #1

Updated by Ward Vandewege about 10 years ago

  • Assigned To changed from Ward Vandewege to Tom Clegg
Actions #2

Updated by Ward Vandewege about 10 years ago

  • Assigned To changed from Tom Clegg to Ward Vandewege

Notes:

1. By completely skipping the reading of the config file when ARVADOS_API_HOST and ARVADOS_API_TOKEN are set in the environment, you're creating a potentially confusing situation, especially if we add future settings to that configuration file.

I think what you want to do here is not allowing the overriding of ARVADOS_API_HOST_INSECURE in the config file if ARVADOS_API_HOST is set via the environment. But everything else should still apply. And it should not matter if ARVADOS_API_TOKEN is set via the environment or via the config file or not at all.

2. this isn't quite perfect yet:

- if var and val
+ if val

Apparently it is possible to assign values to a hash key that is empty. So with this in the config file

=value

that is what would happen. I suggest

if not var.empty? and val

instead.

Actions #3

Updated by Ward Vandewege about 10 years ago

  • Assigned To changed from Ward Vandewege to Tom Clegg
Actions #4

Updated by Ward Vandewege about 10 years ago

  • Status changed from New to In Progress
  • Start date set to 04/29/2014
Actions #5

Updated by Tom Clegg about 10 years ago

Ward Vandewege wrote:

Notes:

1. By completely skipping the reading of the config file when ARVADOS_API_HOST and ARVADOS_API_TOKEN are set in the environment, you're creating a potentially confusing situation, especially if we add future settings to that configuration file.

Added a comment. (Currently all other settings are ignored anyway.)

I think what you want to do here is not allowing the overriding of ARVADOS_API_HOST_INSECURE in the config file if ARVADOS_API_HOST is set via the environment. But everything else should still apply. And it should not matter if ARVADOS_API_TOKEN is set via the environment or via the config file or not at all.

Also wanted to avoid uselessly reading the file, since it can have no effect at this point other than spitting errors (e.g., file is unreadable, HOME is not set).

Looking at this again I noticed a "catch all exceptions, assume/report that $HOME is unset, and continue running" pattern. Kept the logic, but reported the actual error instead of the expected error.

(Also fixed NoMethodError: undefined method `debuglog' for #<Arvados:0x007f8861dd8b00>)

2. this isn't quite perfect yet:

- if var and val
+ if val

Apparently it is possible to assign values to a hash key that is empty. So with this in the config file

=value

that is what would happen. I suggest

if not var.empty? and val

instead.

Fixed.

Actions #6

Updated by Tom Clegg about 10 years ago

  • Assigned To changed from Tom Clegg to Ward Vandewege
Actions #7

Updated by Ward Vandewege about 10 years ago

Tom Clegg wrote:

Added a comment. (Currently all other settings are ignored anyway.)

I think what you want to do here is not allowing the overriding of ARVADOS_API_HOST_INSECURE in the config file if ARVADOS_API_HOST is set via the environment. But everything else should still apply. And it should not matter if ARVADOS_API_TOKEN is set via the environment or via the config file or not at all.

Also wanted to avoid uselessly reading the file, since it can have no effect at this point other than spitting errors (e.g., file is unreadable, HOME is not set).

As written, yeah.

Looking at this again I noticed a "catch all exceptions, assume/report that $HOME is unset, and continue running" pattern. Kept the logic, but reported the actual error instead of the expected error.

(Also fixed NoMethodError: undefined method `debuglog' for #<Arvados:0x007f8861dd8b00>)

Cool.

2. this isn't quite perfect yet:

- if var and val
+ if val

Apparently it is possible to assign values to a hash key that is empty. So with this in the config file

=value

that is what would happen. I suggest

if not var.empty? and val

instead.

Fixed.

Thanks, ready to merge.

Actions #8

Updated by Ward Vandewege about 10 years ago

  • Status changed from In Progress to Resolved
  • Remaining (hours) changed from 0.5 to 0.0
Actions

Also available in: Atom PDF