Giter Club home page Giter Club logo

gz-fuel-tools's People

Contributors

adlarkin avatar ahcorde avatar azeey avatar blast545 avatar caguero avatar chapulina avatar crola1702 avatar iche033 avatar j-rivero avatar jennuine avatar lobotuerk avatar mabelzhang avatar maryab-osr avatar methyldragon avatar mjcarroll avatar nkoenig avatar scpeters avatar shameekganguly avatar sloretz avatar traversaro avatar voldivh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gz-fuel-tools's Issues

[Fuel backend] FuelClient cannot list models by owner or name from REST

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


FuelClient::Models(ModelIdentifier id) Is supposed to list models which match a partial identifier. if id.SourceURL() is set to one server, it should only return a ModelIter through models on that server. Same for id.Owner() and id.Name(). LocalCache supports this partial matching, so it will work if the REST API fails and the LocalCache is used instead.

It means ign fuel list --owner bob only works if the fuel server is unreachable.

What's needed to make this feature work is two apis on the fuel server: one that gets all models owned by a user, and one that gets all models with a name regardless of the user. Then FuelClient can pick the right API based on which parts of the identifier are set.

[Fuel backend] ModelIdentifier::UniqueName() shouldn't allow slashes between url and owner

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


The method ModelIdentifier::UniqueName() returns a string that has the SourceURL, owner, and name concatinated with slashes. If the sourceURL ends in a slash, then UniqueName will return a name that has two slashes at that point. The same model might be seen as two different models by the tool depending on if SourceURL was given with a trailing slash http://myserver.com/company/car and http://myserver.com//company/car

UniqueName() should remove this extra slash, or SourceURL should strip slashes from the url when it's set, or something.

Consider checking for the existence of files at time of download

Original report (archived issue) by Nate Koenig (Bitbucket: Nathan Koenig).


Summary

Potentially check if a file exists during the model:// to file:// conversion in LocalCache.cc::FixPaths. See https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-fuel-tools/pull-requests/82/ready-integration-with-ign-gazebo/activity#comment-89120270

Describe alternatives you've considered

We could report an error message, leave the model:// tag in it's original state, leave the file://, or do nothing.

Things to consider:

  1. Should ign-fuel-tools take on the role of check for the existence of files, or is that the job of a downstream application?

  2. Error messages of this type tend to clutter the console, and are not useful for downstream applications. Returning error codes are better.

  3. There could be dependencies on other resources. So, a model that is converted from "model://" to "file://" may rely on addtional resources that will be downloaded in the future.

4 unit tests fail: UNIT_FuelClient_TEST, UNIT_ign_src_TEST, UNIT_ModelIdentifier_TEST, UNIT_ign_TEST

Original report (archived issue) by yurivict (Bitbucket: yurivict).


The following tests FAILED:
	  3 - UNIT_FuelClient_TEST (Failed)
	  5 - UNIT_ign_src_TEST (Failed)
	 13 - UNIT_ModelIdentifier_TEST (Failed)
	 25 - UNIT_ign_TEST (Failed)
$ ./work/.build/bin/UNIT_FuelClient_TEST
[==========] Running 11 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 11 tests from FuelClient
[ RUN      ] FuelClient.ParseModelURL
[Wrn] [Filesystem.cc:275] Failed to open file [/usr/local/share/ignition/fuel_tools1/config.yaml]: No such file or directory
[Err] [ClientConfig.cc:291] Error copying default configuration file from [/usr/local/share/ignition/fuel_tools1//config.yaml] to [/home/yuri/.ignition/fuel/config.yaml]
[Wrn] [Filesystem.cc:275] Failed to open file [/usr/local/share/ignition/fuel_tools1/config.yaml]: No such file or directory
[Err] [ClientConfig.cc:291] Error copying default configuration file from [/usr/local/share/ignition/fuel_tools1//config.yaml] to [/home/yuri/.ignition/fuel/config.yaml]
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:154: Failure
Value of: "1.0"
Expected: id.Server().Version()
Which is: "5.0"
[Wrn] [FuelClient.cc:388] Server configuration is incomplete:
URL: https://api.ignitionfuel.org
Version: 
API key: 
[Wrn] [Filesystem.cc:275] Failed to open file [/usr/local/share/ignition/fuel_tools1/config.yaml]: No such file or directory
[Err] [ClientConfig.cc:291] Error copying default configuration file from [/usr/local/share/ignition/fuel_tools1//config.yaml] to [/home/yuri/.ignition/fuel/config.yaml]
[Wrn] [FuelClient.cc:388] Server configuration is incomplete:
URL: https://api.ignitionfuel.org
Version: 
API key: 
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:193: Failure
Value of: "1.0"
Expected: id.Server().Version()
Which is: ""
[Err] [FuelClient.cc:363] Invalid URL [http://bad.url]
[Wrn] [URI.cc:580] Unable to parse URI [bad url]. Ignoring.
[Err] [FuelClient.cc:363] Invalid URL [ba://url]
[Err] [FuelClient.cc:363] Invalid URL [https://api.ignitionfuel.org/german/models/Cardboard Box/banana]
[Err] [FuelClient.cc:363] Invalid URL [https://api.ignitionfuel.org/banana/german/models/Cardboard Box]
[Err] [FuelClient.cc:363] Invalid URL [https://api.ignitionfuel.org/99/german/models/Cardboard Box]
[Err] [FuelClient.cc:363] Invalid URL [https://api.ignitionfuel.org/2/2/german/models/Cardboard Box/banana]
[  FAILED  ] FuelClient.ParseModelURL (15 ms)
[ RUN      ] FuelClient.ParseModelFileURL
[Wrn] [Filesystem.cc:275] Failed to open file [/usr/local/share/ignition/fuel_tools1/config.yaml]: No such file or directory
[Err] [ClientConfig.cc:291] Error copying default configuration file from [/usr/local/share/ignition/fuel_tools1//config.yaml] to [/home/yuri/.ignition/fuel/config.yaml]
[Wrn] [Filesystem.cc:275] Failed to open file [/usr/local/share/ignition/fuel_tools1/config.yaml]: No such file or directory
[Err] [ClientConfig.cc:291] Error copying default configuration file from [/usr/local/share/ignition/fuel_tools1//config.yaml] to [/home/yuri/.ignition/fuel/config.yaml]
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:310: Failure
Value of: "1.0"
Expected: id.Server().Version()
Which is: "5.0"
[Wrn] [FuelClient.cc:457] Server configuration is incomplete:
URL: https://api.ignitionfuel.org
Version: 
API key: 
[Wrn] [Filesystem.cc:275] Failed to open file [/usr/local/share/ignition/fuel_tools1/config.yaml]: No such file or directory
[Err] [ClientConfig.cc:291] Error copying default configuration file from [/usr/local/share/ignition/fuel_tools1//config.yaml] to [/home/yuri/.ignition/fuel/config.yaml]
[Wrn] [FuelClient.cc:457] Server configuration is incomplete:
URL: https://api.ignitionfuel.org
Version: 
API key: 
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:347: Failure
Value of: "1.0"
Expected: id.Server().Version()
Which is: ""
[Err] [FuelClient.cc:432] Invalid URL [http://bad.url]
[Wrn] [URI.cc:580] Unable to parse URI [bad_url]. Ignoring.
[  FAILED  ] FuelClient.ParseModelFileURL (2 ms)
[ RUN      ] FuelClient.DownloadModel
[Wrn] [Filesystem.cc:275] Failed to open file [/usr/local/share/ignition/fuel_tools1/config.yaml]: No such file or directory
[Err] [ClientConfig.cc:291] Error copying default configuration file from [/usr/local/share/ignition/fuel_tools1//config.yaml] to [/home/yuri/.ignition/fuel/config.yaml]
[Msg] Saved model at:
  /usr/ports/misc/ignition-fuel-tools/work/.build/test_cache/api.ignitionfuel.org/chapulina/models/Test box/2
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:407: Failure
Value of: common::cwd() + "/test_cache/api.ignitionfuel.org/chapulina/models/Test box/1"
  Actual: "/usr/ports/misc/ignition-fuel-tools/work/.build/test_cache/api.ignitionfuel.org/chapulina/models/Test box/1"
Expected: path
Which is: "/usr/ports/misc/ignition-fuel-tools/work/.build/test_cache/api.ignitionfuel.org/chapulina/models/Test box/tip"
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:409: Failure
Value of: common::exists( "test_cache/api.ignitionfuel.org/chapulina/models/Test box/1")
  Actual: false
Expected: true
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:412: Failure
Value of: common::exists( "test_cache/api.ignitionfuel.org/chapulina/models/Test box/1/" "model.sdf")
  Actual: false
Expected: true
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:415: Failure
Value of: common::exists( "test_cache/api.ignitionfuel.org/chapulina/models/Test box/1/" "model.config")
  Actual: false
Expected: true
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:423: Failure
Value of: res3
  Actual: false
Expected: true
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:424: Failure
Value of: res3
  Actual: 0
Expected: Result(Result::FETCH_ALREADY_EXISTS)
Which is: 1
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/FuelClient_TEST.cc:427: Failure
Value of: cachedPath
  Actual: ""
Expected: common::cwd() + "/test_cache/api.ignitionfuel.org/chapulina/models/Test box/1"
Which is: "/usr/ports/misc/ignition-fuel-tools/work/.build/test_cache/api.ignitionfuel.org/chapulina/models/Test box/1"
[Err] [FuelClient.cc:285] Failed to download model.
  Server: https://api.ignitionfuel.org
  Route: chapulina/models/Inexistent model/tip/Inexistent model.zip
  REST response code: 404
[Wrn] [URI.cc:580] Unable to parse URI [banana]. Ignoring.
[  FAILED  ] FuelClient.DownloadModel (996 ms)
[ RUN      ] FuelClient.CachedModel
[Err] [FuelClient.cc:432] Invalid URL [http://localhost:8007/1.0/alice/models/Banana/model.sdf]
[Err] [FuelClient.cc:432] Invalid URL [http://localhost:8007/1.0/alice/models/My Model]
[Wrn] [URI.cc:580] Unable to parse URI [banana]. Ignoring.
[Wrn] [URI.cc:580] Unable to parse URI []. Ignoring.
[Wrn] [URI.cc:580] Unable to parse URI [banana]. Ignoring.
[       OK ] FuelClient.CachedModel (9 ms)
[ RUN      ] FuelClient.Config
[       OK ] FuelClient.Config (0 ms)
[ RUN      ] FuelClient.ModelDownload
[Wrn] [URI.cc:580] Unable to parse URI [bad]. Ignoring.
[       OK ] FuelClient.ModelDownload (1 ms)
[ RUN      ] FuelClient.ModelDetails
[       OK ] FuelClient.ModelDetails (0 ms)
[ RUN      ] FuelClient.Models
[Msg] //models/ not found in cache, attempting download
[Msg] //models/ not found in cache, attempting download
[Wrn] [FuelClient.cc:170] Failed to fetch models from server, returning cached models.
URL: 
Version: 1.0
API key: 

[Wrn] [FuelClient.cc:170] Failed to fetch models from server, returning cached models.
URL: 
Version: 1.0
API key: 

[       OK ] FuelClient.Models (1 ms)
[ RUN      ] FuelClient.DownloadModelFail
[Err] [FuelClient.cc:268] Can't download model, server configuration incomplete: 
URL: 
Version: 1.0
API key: 

[       OK ] FuelClient.DownloadModelFail (0 ms)
[ RUN      ] FuelClient.DeleteModelFail
[       OK ] FuelClient.DeleteModelFail (0 ms)
[ RUN      ] FuelClient.UploadModelFail
[       OK ] FuelClient.UploadModelFail (0 ms)
[----------] 11 tests from FuelClient (1024 ms total)

[----------] Global test environment tear-down
[==========] 11 tests from 1 test case ran. (1024 ms total)
[  PASSED  ] 8 tests.
[  FAILED  ] 3 tests, listed below:
[  FAILED  ] FuelClient.ParseModelURL
[  FAILED  ] FuelClient.ParseModelFileURL
[  FAILED  ] FuelClient.DownloadModel

 3 FAILED TESTS
$ ./work/.build/bin/UNIT_ign_src_TEST
Running main() from gtest_main.cc
[==========] Running 7 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 7 tests from CmdLine
[ RUN      ] CmdLine.ModelListFail
[       OK ] CmdLine.ModelListFail (0 ms)
[ RUN      ] CmdLine.ModelListConfigServerUgly
[Err] [ClientConfig.cc:291] Error copying default configuration file from [/usr/local/share/ignition/fuel_tools1//config.yaml] to [/home/yuri/.ignition/fuel/config.yaml]
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_src_TEST.cc:87: Failure
Expected: (stdOutBuffer.str().find("https://api.ignitionfuel.org")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
[  FAILED  ] CmdLine.ModelListConfigServerUgly (1 ms)
[ RUN      ] CmdLine.ModelListCustomServerPretty
[       OK ] CmdLine.ModelListCustomServerPretty (7756 ms)
[ RUN      ] CmdLine.ModelListCustomServerPrettyOwner
[       OK ] CmdLine.ModelListCustomServerPrettyOwner (6641 ms)
[ RUN      ] CmdLine.ModelDownloadBadUrl
[       OK ] CmdLine.ModelDownloadBadUrl (0 ms)
[ RUN      ] CmdLine.ModelDownloadWrongUrl
[Err] [ClientConfig.cc:291] Error copying default configuration file from [/usr/local/share/ignition/fuel_tools1//config.yaml] to [/home/yuri/.ignition/fuel/config.yaml]
[Err] [FuelClient.cc:363] Invalid URL [https://site.com/1.0/ownername/modelname]
[       OK ] CmdLine.ModelDownloadWrongUrl (2 ms)
[ RUN      ] CmdLine.ModelDownloadUnversioned
[Wrn] [Filesystem.cc:140] The path [test_cache] does not refer to a directory nor to a file
[Wrn] [Filesystem.cc:275] Failed to open file [/usr/local/share/ignition/fuel_tools1/config.yaml]: No such file or directory
[Err] [ClientConfig.cc:291] Error copying default configuration file from [/usr/local/share/ignition/fuel_tools1//config.yaml] to [/home/yuri/.ignition/fuel/config.yaml]
[Msg] Saved model at:
  test_cache/api.ignitionfuel.org/chapulina/models/Test box/2
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_src_TEST.cc:213: Failure
Value of: ignition::common::isDirectory( "test_cache/api.ignitionfuel.org/chapulina/models/Test box/1")
  Actual: false
Expected: true
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_src_TEST.cc:215: Failure
Value of: ignition::common::isFile( "test_cache/api.ignitionfuel.org/chapulina/models/Test box/1/model.sdf")
  Actual: false
Expected: true
[  FAILED  ] CmdLine.ModelDownloadUnversioned (607 ms)
[----------] 7 tests from CmdLine (15047 ms total)

[----------] Global test environment tear-down
[==========] 7 tests from 1 test case ran. (15047 ms total)
[  PASSED  ] 5 tests.
[  FAILED  ] 2 tests, listed below:
[  FAILED  ] CmdLine.ModelListConfigServerUgly
[  FAILED  ] CmdLine.ModelDownloadUnversioned

 2 FAILED TESTS
$ ./work/.build/bin/UNIT_ModelIdentifier_TEST
[==========] Running 6 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 6 tests from ModelIdentifier
[ RUN      ] ModelIdentifier.SetFields
[       OK ] ModelIdentifier.SetFields (0 ms)
[ RUN      ] ModelIdentifier.UniqueName
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ModelIdentifier_TEST.cc:77: Failure
Value of: id.UniqueName()
  Actual: "https://localhost:8002/alice/models/hello"
Expected: "https://localhost:8003/alice/models/hello"
[  FAILED  ] ModelIdentifier.UniqueName (0 ms)
[ RUN      ] ModelIdentifier.CopyConstructorDeepCopy
[       OK ] ModelIdentifier.CopyConstructorDeepCopy (0 ms)
[ RUN      ] ModelIdentifier.AssignmentOperatorDeepCopy
[       OK ] ModelIdentifier.AssignmentOperatorDeepCopy (0 ms)
[ RUN      ] ModelIdentifier.AsString
[Dbg] [ModelIdentifier_TEST.cc:187] Name: hello
Owner: raspberry
Version: 55
Unique name: /raspberry/models/hello
Description: 
File size: 2048
Upload date: 1542744898
UUID: lllooo000ooolll
Likes: 0
Downloads: 0
License name: 
License URL: 
License image URL: 
Tags: 
Server:
  URL: 
  Version: 1.0
  API key: 

[       OK ] ModelIdentifier.AsString (1 ms)
[ RUN      ] ModelIdentifier.AsPrettyString
[Dbg] [ModelIdentifier_TEST.cc:223] Name: hello
Owner: raspberry
Version: 55
File size: 2048
Upload date: 1542744898
Server:
  Version: 1.0

[       OK ] ModelIdentifier.AsPrettyString (0 ms)
[----------] 6 tests from ModelIdentifier (1 ms total)

[----------] Global test environment tear-down
[==========] 6 tests from 1 test case ran. (12 ms total)
[  PASSED  ] 5 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] ModelIdentifier.UniqueName

 1 FAILED TEST
$ ./work/.build/bin/UNIT_ign_TEST
Running main() from gtest_main.cc
[==========] Running 5 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 5 tests from CmdLine
[ RUN      ] CmdLine.Versions
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:57: Failure
Expected: (output.find(g_version)) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

[  FAILED  ] CmdLine.Versions (177 ms)
[ RUN      ] CmdLine.Help
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:65: Failure
Expected: (output.find("list")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:68: Failure
Expected: (output.find("list")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:71: Failure
Expected: (output.find("list")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

[  FAILED  ] CmdLine.Help (564 ms)
[ RUN      ] CmdLine.ModelListFail
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:78: Failure
Expected: (output.find("Missing resource type")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:81: Failure
Expected: (output.find("Only model resources")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:84: Failure
Expected: (output.find("failed to fetch model list")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

[  FAILED  ] CmdLine.ModelListFail (647 ms)
[ RUN      ] CmdLine.ModelListConfigServerUgly
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:92: Failure
Expected: (output.find("https://api.ignitionfuel.org/1.0/")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

[  FAILED  ] CmdLine.ModelListConfigServerUgly (209 ms)
[ RUN      ] CmdLine.ModelListCustomServerPretty
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:104: Failure
Expected: (output.find("https://staging-api.ignitionfuel.org")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:105: Failure
Expected: (output.find("owners")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ign_TEST.cc:106: Failure
Expected: (output.find("models")) != (std::string::npos), actual: 18446744073709551615 vs 18446744073709551615
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  msg:           Print information about messages.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.

[  FAILED  ] CmdLine.ModelListCustomServerPretty (187 ms)
[----------] 5 tests from CmdLine (1785 ms total)

[----------] Global test environment tear-down
[==========] 5 tests from 1 test case ran. (1785 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 5 tests, listed below:
[  FAILED  ] CmdLine.Versions
[  FAILED  ] CmdLine.Help
[  FAILED  ] CmdLine.ModelListFail
[  FAILED  ] CmdLine.ModelListConfigServerUgly
[  FAILED  ] CmdLine.ModelListCustomServerPretty

 5 FAILED TESTS

FreeBSD 11.2
clang-6
rev. cc74edb

ignition-fuel_tools1 Requires.private: libcurl >= jsoncpp

Original report (archived issue) by João Britto (Bitbucket: Joao Britto).


Hi,
I am moving our project to use Gazebo9 and got a problem related to the dependencies of ignition-fuel_tools1, specifically libcurl >= jsoncpp. Is it right, or it's missing something there?

~/rock-gazebo $ cat /usr/lib/x86_64-linux-gnu/pkgconfig/ignition-fuel_tools1.pc
prefix=/usr
libdir=${prefix}/lib/x86_64-linux-gnu
includedir=${prefix}/include/ignition/fuel_tools1

Name: Ignition fuel_tools
Description: A set of fuel_tools classes for robot applications
Version: 1.0.0
Requires:
Requires.private: libcurl >=  jsoncpp yaml-0.1 libzip ignition-common1
Libs: -L${libdir} -lignition-fuel_tools1 
Libs.private:
CFlags: -I${includedir}  -std=c++11

Cached models lose server and name information

Original report (archived issue) by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


While working on issue #39, I realized that locally cached models lose some information which makes it harder to reuse them.

  1. The first one is the server information, i.e. https://api.ignitionfuel.org.

  2. The second one is the model name; while the whole web side is using names that may have capital letters and spaces, the local cache is converting to lower case and spaces into underscores.

This means that when a user requests a model from a URL, I can't check its ModelIdentifier (i.e. UniqueName) against any model on the local cache.

I have a proposal which I'm not sure would be ok to roll into the released version 1:

Structure the local cache just like the server:

  • add the server as a directory, maybe even with the version number
  • use the model's human readable name

Current cache example:

/home/louise/.ignition/fuel/
├── config.yaml
└── models
    ├── caguero
    │   ├── ambulance3
    │   └── hammer
    ├── chapulina
    │   └── turtlebot
    └── german
        ├── bowl
        └── cardboard_box

Proposed cache example:

/home/louise/.ignition/fuel/
├── config.yaml
└── api.ignitionfuel.org
    └── 1.0
        ├── caguero
        │   └── models
        │       ├── Ambulance3
        │       └── Hammer
        ├── chapulina
        │   └── models
        │       └── Turtlebot
        └── german
            └── models
                ├── Bowl
                └── Cardboard Box

Other advantages:

  • Models with same name and owner but different servers won't be overridden
  • Models with names which currently map to same path won't be overridden (for example chapulina/My Model and chapulina/my_model can both exist on the server)
  • Immediate association to a URL
  • No need to track 2 separate names and keep making sure we're using the right ones all over the code

Disadvantages:

  • Dealing with spaces in file paths, is this such a big issue?
  • Is there anything else I'm missing?

[Fuel backend] Support uploading a model

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


The tools do not currently support uploading a model. FuelClient::UploadModel() has no implementation. The command line just prints a TODO message.

$ ign fuel push --url https://staging-api.ignitionfuel.org/ --owner sloretz --name box --path ~/models/box
TODO Upload a model

The thought behind the command line args is a user would want to upload a model which they created and lives in some directory. When they want to upload it they would say which url, who the owner is (their username on the server), what the name of the model is, and where the path to the model on disk is. FuelClient should create a zip archive of the model and POST it to some api on the fuel server.

FuelClient support range-based for-loops

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


Currently FuelClient::Models(...) returns an instance ModelIter. Iterating over all models looks like

auto iter = client.Models(server);
for (; iter; ++iter)
{
  Model & model = *iter;
  // ...
}

It would be more convenient to use range based for loops

for (Model & model : client.Models(server))
{
  // ...
}

This can be done by making a function return an object with special methods begin() and end() where begin returns what FuelClient::Models(...) returns now, and end returns an iterator that compares inequal to a valid iterator.

class Models
{
    /// \brief special method to support range-based for-loops; must be lowercase
   public: ModelIter begin();

    /// \brief special method to support range-based for-loops; must be lowercase
   public: ModelIter end();
}

Since fuel-tools has already been released and a function's return type is not part of its signature, tick-tocking this requires changing the name of the function on FuelClient.

     /// old and busted
     public: IGN_DEPRECATED(2) ModelIter Models(const ServerConfig &_server);

     /// new hotness
     public: Models QueryModels(const ServerConfig &_server);

Support retrieving directory name of a model

Original report (archived issue) by Ian Chen (Bitbucket: Ian Chen, GitHub: iche033).


A model SDF usually contains URI pointing to resources or other models in the form of model://model_name/path/to/file

e.g.

model://beer/meshes/materials/scripts/beer.material

In ign-fuel, the model names are capitalized, e.g in the case above, Beer. So when parsing an SDF file and looking up resources to download from ign-fuelserver, it is not possible to identify the correct model to download unless there is a way to get the model directory path of a model

FuelClient API expects redundant possibly conflicting information

Original report (archived issue) by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


Several functions on FuelClient accept both a ServerConfig and a ModelIdentifier.

But considering that ModelIdentifier keeps its own Server config, we may need to handle the situation when these two conflict. What's the motivation for passing ServerConfig?

If there's no special need for passing ServerConfig, I suggest we stop using it in version 1, document that it has no effect, and deprecate it on version 2.

Remove hardcoded paths

Original report (archived issue) by Andrés Fortier (Bitbucket: andres_fortier).


After successfully installing ign-tools and ign-fuel-tools I'm seeing the following:

$ ign
The 'ign' command provides a command line interface to the ignition tools.

  ign <command> [options]

List of available commands:

  help:          Print this help text.
  fuel:          Manage simulation resources.

Options:

  --force-version <VERSION>  Use a specific library version.
  --versions                 Show the available versions.
Use 'ign help <command>' to print help for a command.
$ ign help fuel
Unable to find configuration file in [/home/caguero/.ignition/fuel/.sources.yaml]

[Fuel backend] LocalCache should return a vector of models rather than a ModelIter

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


The class LocalCache is not meant to be used by a user. The class ModelIter is meant to be used by a user, and so hides a lot of stuff about how models are retrieved. LocalCache::AllModels() and LocalCache::MatchingModels() should return std::vector<Model> instead of ModelIter, and FuelClient should be responsible for turning that into a ModelIter as needed.

For example, if a user types ign fuel list that list should include models from both the LocalCache and from any servers. If a LocalCache returned a vector of models it would make it easier to write code in FuelClient to include those results in a final ModelIter instance that has both.

[Fuel backend] Mock LocalCache and REST

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


The classes LocalCache and REST can be optionally provided to FuelClient. This is meant to allow these classes to be mocked for unit tests. Currently the test directory has gtest, but not gmock, so the classes cannot be mocked. gmock should be added to this repo and unit tests using mocks of these classes should be written to test edge cases that are difficult to test with a real file system or REST server.

Integrate ign-fuel-tools with Gazebo

Original report (archived issue) by Andrés Fortier (Bitbucket: andres_fortier).


Integrate gazebo with ignition fuel tools, so we can search and download models from the remote repository to the local machine running Gazebo.

@caguero I'm leaving this issue here, but maybe in the future we'll want to migrate it to Gazebo's repo?

[Fuel backend] Support pagination

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


Currently there is a ModelIter which iterates through models through a REST API call. This ModelIter only makes one call in it's constructor. It should instead make calls in IterRESTIds::Next() until there are no more pages of models.

[Fuel backend] Support downloading a model

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


Model::Fetch() has a mostly empty implementation. It should download a model from the fuel server if that model doesn't already exist on disk. Saving to disk would require implementing LocalCache::SaveModel and making sure Model has access to the FuelClient instance of LocalCache.

In order to make it possible to test the library with a mock REST class, ModelPrivate must be given an instance of REST and LocalCache classes from FuelClient, which may be difficult. The instances might have to pass through ModelIter or LocalCache when so they can be given to created Model instances.

[Fuel backend] Some stuff on ModelIdentifier should be on Model instead

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).


Some things on ModelIdentifier don't really help identify the model, and should be on the Model class instead

I think these should be moved to Model

  public: bool Description(const std::string &_desc);
  public: bool FileSize(const unsigned int _filesize);
  public: bool UploadDate(const std::time_t &_date);
  public: bool ModifyDate(const std::time_t &_date);
  public: bool Category(const std::string &_cat);

warning: moving a temporary object prevents copy elision

Original report (archived issue) by yurivict (Bitbucket: yurivict).


[10/18] /usr/bin/c++  -Dignition_fuel_tools1_EXPORTS -I/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/include -Iinclude -Icore/include -isystem /usr/local/include/ignition/common3 -isystem /usr/local/include/uuid -isystem /usr/local/include -isystem /usr/local/include/jsoncpp -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -O2 -pipe -fno-omit-frame-pointer -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer  -Wall -Wextra -Wno-long-long -Wno-unused-value -Wfloat-equal -Wshadow -Winit-self -Wswitch-default -Wmissing-include-dirs -pedantic  -fPIC   -msse -msse2 -mfpmath=sse -I/usr/local/include/uuid -I/usr/local/include -I/usr/local/include/jsoncpp -std=c++14 -MD -MT src/CMakeFiles/ignition-fuel_tools1.dir/ModelIter.cc.o -MF src/CMakeFiles/ignition-fuel_tools1.dir/ModelIter.cc.o.d -o src/CMakeFiles/ignition-fuel_tools1.dir/ModelIter.cc.o -c /usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ModelIter.cc
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ModelIter.cc:39:10: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
  return std::move(ModelIter(std::move(priv)));
         ^
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ModelIter.cc:39:10: note: remove std::move call here
  return std::move(ModelIter(std::move(priv)));
         ^~~~~~~~~~                          ~
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ModelIter.cc:46:10: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
  return std::move(ModelIter(std::move(priv)));
         ^
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ModelIter.cc:46:10: note: remove std::move call here
  return std::move(ModelIter(std::move(priv)));
         ^~~~~~~~~~                          ~
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ModelIter.cc:55:10: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
  return std::move(ModelIter(std::move(priv)));
         ^
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ModelIter.cc:55:10: note: remove std::move call here
  return std::move(ModelIter(std::move(priv)));
         ^~~~~~~~~~                          ~
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ModelIter.cc:62:10: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
  return std::move(ModelIter(std::move(priv)));
         ^
/usr/ports/misc/ignition-fuel-tools/work/ignitionrobotics-ign-fuel-tools-cc74edb0c839b613e6bbf5451852457b4dd6357c/src/ModelIter.cc:62:10: note: remove std::move call here
  return std::move(ModelIter(std::move(priv)));
         ^~~~~~~~~~                          ~
4 warnings generated.

FreeBSD 11.2
clang-6

Clean compiler warnings

Original report (archived issue) by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


Currently there are these:

/media/louise/TERA/code/ign-fuel-tools/src/FuelClient.cc: In member function ‘ignition::fuel_tools::Result ignition::fuel_tools::FuelClient::UploadModel(const string&, const ignition::fuel_tools::ModelIdentifier&)’:
/media/louise/TERA/code/ign-fuel-tools/src/FuelClient.cc:98:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
/media/louise/TERA/code/ign-fuel-tools/src/FuelClient.cc: In member function ‘ignition::fuel_tools::Result ignition::fuel_tools::FuelClient::DeleteModel(const ignition::fuel_tools::ModelIdentifier&)’:
/media/louise/TERA/code/ign-fuel-tools/src/FuelClient.cc:104:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
/media/louise/TERA/code/ign-fuel-tools/src/LocalCache.cc: In member function ‘virtual bool ignition::fuel_tools::LocalCache::SaveModel(const ignition::fuel_tools::ModelIdentifier&, const string&)’:
/media/louise/TERA/code/ign-fuel-tools/src/LocalCache.cc:176:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
In file included from /media/louise/TERA/code/ign-fuel-tools/src/ModelIter.cc:23:0:
/media/louise/TERA/code/ign-fuel-tools/include/ignition/fuel-tools/ModelIterPrivate.hh: In constructor ‘ignition::fuel_tools::IterRESTIds::IterRESTIds(ignition::fuel_tools::REST*, ignition::fuel_tools::ClientConfig*, const string&)’:
/media/louise/TERA/code/ign-fuel-tools/include/ignition/fuel-tools/ModelIterPrivate.hh:137:21: warning: ‘ignition::fuel_tools::IterRESTIds::rest’ will be initialized after [-Wreorder]
       public: REST *rest;
                     ^
/media/louise/TERA/code/ign-fuel-tools/include/ignition/fuel-tools/ModelIterPrivate.hh:134:29: warning:   ‘ignition::fuel_tools::ClientConfig* ignition::fuel_tools::IterRESTIds::config’ [-Wreorder]
       public: ClientConfig *config;
                             ^
/media/louise/TERA/code/ign-fuel-tools/src/ModelIter.cc:145:1: warning:   when initialized here [-Wreorder]
 IterRESTIds::IterRESTIds(REST *_rest, ClientConfig *_config,

[Girder frontend] Add tags to UI

Original report (archived issue) by Andrés Fortier (Bitbucket: andres_fortier).


As a first approach, tags will be handled by using the metadata field. Once that is in place we should add our custom UI module to add / remove tags to an asset instead of editing the metadata "tags" field

[Fuel backend] Create ClientConfig from yaml file

Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).

The original report had attachments: sources.yaml


ClientConfig is a class that holds config info about servers - what their URL is, the name of the folder where models from them are saved, auth info etc. Currently the creation of this config is hard coded. The ign fuel tool is hardcoded to do requests from https://staging-api.ignitionfuel.org/ using the local cache directory named staging_ignitionfuel.

There should be a method or class which populates an instance ClientConfig from a yaml file before it's given to FuelClient. This class would be used to populate the config in IgnitionFuelCMD.cc/getConfig().

Attached is a config file from @caguero

[Girder backend] Add search-by-tag plugin

Original report (archived issue) by Andrés Fortier (Bitbucket: andres_fortier).


Add search-by-tag plugin that provides a new REST endpoint. Tags should be added to the metadata of both folders and items and we should find a way to properly query them (i.e. to make proper use of limit / count parameters)

Move Ruby code to Python

Original report (archived issue) by Andrés Fortier (Bitbucket: andres_fortier).


Girder provides a client implemented in python (girder-cli) which already defines all the interactions with a Girder server. To avoid re-writing most of that we should migrate our ruby implementation of the commands to python, so it just becomes a thin wrapper around the existing libraries.

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.