Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9 ➡️ main #423

Merged
merged 28 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
32d8329
Update github action workflows (#388)
azeey Nov 13, 2023
0965ad0
Update github action workflows (#388) (#390)
azeey Nov 14, 2023
ed334c9
Disable tests that are known to fail on Windows (#387)
mjcarroll Nov 27, 2023
b80abc3
Create directories and more output on fail (#392)
mjcarroll Dec 11, 2023
931f139
🎈 4.9.1 (#398)
mjcarroll Jan 5, 2024
838f6ba
Merge 4 to 7
azeey Jan 12, 2024
9314076
Merge pull request #400 from azeey/4_to_7
azeey Jan 12, 2024
2c84439
Merge 7 into 8
azeey Jan 18, 2024
1896341
Merge pull request #401 from azeey/7_to_8
azeey Jan 22, 2024
8d1158f
Remove Ignition
caguero Feb 2, 2024
ec13d4f
Merge pull request #403 from gazebosim/8_to_9again
caguero Feb 2, 2024
8b4ead3
Prepare for 9.0.1 (#405)
azeey Mar 15, 2024
f379bd7
Fix `LocalCache` so that models/worlds downloaded via fuel.ignitionro…
azeey Mar 18, 2024
268ec7e
Prepare for 9.0.2 (#407)
azeey Mar 18, 2024
960fc05
Use relative install path for gz tool data (#409)
azeey Apr 9, 2024
c7cd3dd
Prepare for 9.0.3 (#411)
azeey Apr 9, 2024
6cbce88
Use config.yaml file from default cache location, if it exists (#410)
nkoenig Apr 9, 2024
6880aec
Add Private function to world identifier (#414)
nkoenig Apr 16, 2024
8ea43a6
Clean all ASAN reported memory problems (curl related) (#416)
j-rivero Apr 22, 2024
d14ffcd
CLI for creating config.yaml (#413)
nkoenig Apr 25, 2024
9cdec8c
Add package.xml (#408)
azeey Apr 25, 2024
3dbc344
Migrate curl_formadd from form API to mime API (deprecated in Ubuntu …
j-rivero Apr 29, 2024
91c7acb
Forward port 8 to 9
nkoenig Apr 29, 2024
52c86bc
Fix test
nkoenig Apr 29, 2024
e808b0a
Merge pull request #418 from gazebosim/forwardport/8-to-9-20240429
ahcorde May 15, 2024
62ea96f
Merge branch 'gz-fuel-tools9' into Crola1702/9_to_main-30_05_2024
Crola1702 May 30, 2024
1b42d26
Bump package.xml versions
Crola1702 May 30, 2024
c991fc2
Fix package versions
Blast545 Jun 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Ubuntu CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- 'ign-fuel-tools[0-9]'
- 'gz-fuel-tools[0-9]?'
- 'main'

jobs:
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
11 changes: 11 additions & 0 deletions .github/workflows/package_xml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Validate package.xml

on:
pull_request:

jobs:
package-xml:
runs-on: ubuntu-latest
name: Validate package.xml
steps:
- uses: gazebo-tooling/action-gz-ci/validate_package_xml@jammy
1 change: 0 additions & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ jobs:
with:
project-url: https://github.com/orgs/gazebosim/projects/7
github-token: ${{ secrets.TRIAGE_TOKEN }}

42 changes: 42 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,37 @@

## Gazebo Fuel Tools 9.x

### Gazebo Fuel Tools 9.0.3 (2024-04-09)

1. Use relative install path for gz tool data
* [Pull request #409](https://github.com/gazebosim/gz-fuel-tools/pull/409)

### Gazebo Fuel Tools 9.0.2 (2024-03-18)

1. Fix `LocalCache` so that models/worlds downloaded via fuel.ignitionrobotics.org can be found in the cache
* [Pull request #406](https://github.com/gazebosim/gz-fuel-tools/pull/406)

### Gazebo Fuel Tools 9.0.1 (2024-03-14)

1. Tidy nested namespaces
* [Pull request #396](https://github.com/gazebosim/gz-fuel-tools/pull/396)

1. Update CI badges in README
* [Pull request #393](https://github.com/gazebosim/gz-fuel-tools/pull/393)

1. Create directories and more output on fail
* [Pull request #392](https://github.com/gazebosim/gz-fuel-tools/pull/392)

1. Disable tests that are known to fail on Windows
* [Pull request #387](https://github.com/gazebosim/gz-fuel-tools/pull/387)

1. Update github action workflows
* [Pull request #388](https://github.com/gazebosim/gz-fuel-tools/pull/388)
* [Pull request #390](https://github.com/gazebosim/gz-fuel-tools/pull/390)

1. Re-enabling Windows tests
* [Pull request #376](https://github.com/gazebosim/gz-fuel-tools/pull/376)

### Gazebo Fuel Tools 9.0.0 (2023-09-29)

1. Added script to update assets to gz
Expand Down Expand Up @@ -374,6 +405,17 @@
1. Support link referral download
* [Pull request #333](https://github.com/gazebosim/gz-fuel-tools/pull/333)

### Gazebo Fuel Tools 4.9.1 (2024-01-05)

1. Create directories and more output on fail
* [Pull request #392](https://github.com/gazebosim/gz-fuel-tools/pull/392)

1. Update github action workflows
* [Pull request #388](https://github.com/gazebosim/gz-fuel-tools/pull/388)

1. Zip: use non-deprecated methods
* [Pull request #360](https://github.com/gazebosim/gz-fuel-tools/pull/360)

### Gazebo Fuel Tools 4.9.0 (2023-05-03)

1. Add bash completion
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,25 @@ Downloading model:
Download succeeded.
```

**Private access tokens**
Private models and worlds can be downloaded using access tokens.
Access tokens are generated on `app.gazebosim.org`. After logging in,
go to `Settings->Access Tokens`.

An access token can be used with CLI commands via the `--header` option:

```bash
$ gz fuel download -u https://fuel.gazebosim.org/1.0/openrobotics/models/ambulance --header 'Private-Token: <access_token>'
```

Or, an access token can be stored in a `~/.gz/fuel/config.yaml` file. The token is then
automatically used by the command line tool and API calls. Use the `configure` helper
tool create your `~/.gz/fuel/config.yaml` file.

```bash
$ gz fuel configure
```

**C++ Get List models**
```cpp
// Create a client (uses https://fuel.gazebosim.org by default)
Expand Down
6 changes: 1 addition & 5 deletions conf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,4 @@ configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/fuel${PROJECT_VERSION_MAJOR}.yaml" @ONLY)

# Install the yaml configuration files in an unversioned location.
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fuel${PROJECT_VERSION_MAJOR}.yaml DESTINATION ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gz/)

# Install config.yaml
install (FILES config.yaml DESTINATION
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/gz/${GZ_DESIGNATION}${PROJECT_VERSION_MAJOR}/)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fuel${PROJECT_VERSION_MAJOR}.yaml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/gz/)
14 changes: 0 additions & 14 deletions conf/config.yaml

This file was deleted.

10 changes: 10 additions & 0 deletions include/gz/fuel_tools/WorldIdentifier.hh
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ namespace gz::fuel_tools
/// \return World information string
public: std::string AsPrettyString(const std::string &_prefix = "") const;

/// \brief Returns the privacy setting of the world.
/// \return True if the world is private, false if the world is
/// public.
public: bool Private() const;

/// \brief Set the privacy setting of the world.
/// \param[in] _private True indicates the world is private,
/// false indicates the world is public.
public: void SetPrivate(bool _private);

/// \brief PIMPL
private: std::unique_ptr<WorldIdentifierPrivate> dataPtr;
};
Expand Down
30 changes: 30 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>gz-fuel_tools9</name>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<name>gz-fuel_tools9</name>
<name>gz-fuel_tools10</name>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed on: c991fc2

<version>10.0.0</version>
<description>Gazebo Fuel Tools: Classes and tools for interacting with Gazebo Fuel</description>
<maintainer email="[email protected]">Nate Koenig</maintainer>
<license>Apache License 2.0</license>
<url type="website">https://github.com/gazebosim/gz-fuel-tools</url>

<buildtool_depend>cmake</buildtool_depend>

<build_depend>gz-cmake4</build_depend>

<depend>gz-common6</depend>
<depend>gz-math8</depend>
<depend>gz-msgs11</depend>
<depend>gz-tools2</depend>
<depend>gz-utils2</depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<depend>gz-utils2</depend>
<depend>gz-utils3</depend>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed on: c991fc2

<depend>libcurl-dev</depend>
<depend>libgflags-dev</depend>
<depend>libjsoncpp-dev</depend>
<depend>libyaml-dev</depend>
<depend>libzip-dev</depend>
<depend>tinyxml2</depend>

<export>
<build_type>cmake</build_type>
</export>
</package>
18 changes: 14 additions & 4 deletions src/ClientConfig.cc
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,22 @@ ClientConfig::ClientConfig() : dataPtr(new ClientConfigPrivate)
return;
}

if (!gz::common::isDirectory(gzFuelPath))
if (!gzFuelPath.empty())
{
gzerr << "[" << gzFuelPath << "] is not a directory" << std::endl;
return;
if (!gz::common::isDirectory(gzFuelPath))
gzerr << "[" << gzFuelPath << "] is not a directory" << std::endl;
else
this->SetCacheLocation(gzFuelPath);
}
this->SetCacheLocation(gzFuelPath);

std::string configYamlFile = common::joinPaths(this->CacheLocation(),
"config.yaml");
std::string configYmlFile = common::joinPaths(this->CacheLocation(),
"config.yml");
if (gz::common::exists(configYamlFile))
this->LoadConfig(configYamlFile);
else if (gz::common::exists(configYmlFile))
this->LoadConfig(configYmlFile);
}

//////////////////////////////////////////////////
Expand Down
10 changes: 7 additions & 3 deletions src/FuelClient_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,8 @@ TEST_F(FuelClientTest, DownloadWorld)
/////////////////////////////////////////////////
// Windows doesn't support colons in filenames
// https://github.com/gazebosim/gz-fuel-tools/issues/106
TEST_F(FuelClientTest, CachedWorld)
// This is fixed in gz-fuel-tools9+, but not here to preserve behavior
TEST_F(FuelClientTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(CachedWorld))
{
ClientConfig config;
config.SetCacheLocation(common::joinPaths(common::cwd(), "test_cache"));
Expand Down Expand Up @@ -1490,8 +1491,11 @@ TEST_F(FuelClientTest, UploadModelFail)
EXPECT_EQ(ResultType::UPLOAD_ERROR, result.Type());
}

//////////////////////////////////////////////////
TEST_F(FuelClientTest, PatchModelFail)
/////////////////////////////////////////////////
// Windows doesn't support colons in filenames
// https://github.com/gazebosim/gz-fuel-tools/issues/106
// This is fixed in gz-fuel-tools9+, but not here to preserve behavior
TEST_F(FuelClientTest, GZ_UTILS_TEST_DISABLED_ON_WIN32(PatchModelFail))
{
FuelClient client;
ModelIdentifier modelId;
Expand Down
29 changes: 22 additions & 7 deletions src/LocalCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -279,16 +279,23 @@ Model LocalCache::MatchingModel(const ModelIdentifier &_id)
// For the tip, we have to find the highest version
bool tip = (_id.Version() == 0);
Model tipModel;
if (!this->dataPtr->config)
return tipModel;

for (ModelIter iter = this->AllModels(); iter; ++iter)
std::string path = common::joinPaths(
this->dataPtr->config->CacheLocation(), uriToPath(_id.Server().Url()));

auto srvModels = this->dataPtr->ModelsInServer(path);
for (auto &model: srvModels)
{
ModelIdentifier id = iter->Identification();
model.dataPtr->id.SetServer(_id.Server());
auto id = model.Identification();
if (_id == id)
{
if (_id.Version() == id.Version())
return *iter;
return model;
else if (tip && id.Version() > tipModel.Identification().Version())
tipModel = *iter;
tipModel = model;
}
}

Expand All @@ -302,16 +309,24 @@ bool LocalCache::MatchingWorld(WorldIdentifier &_id) const
bool tip = (_id.Version() == 0);
WorldIdentifier tipWorld;

for (auto id = this->AllWorlds(); id; ++id)
if (!this->dataPtr->config)
return false;

std::string path = common::joinPaths(
this->dataPtr->config->CacheLocation(), uriToPath(_id.Server().Url()));

auto srvWorlds = this->dataPtr->WorldsInServer(path);
for (auto id: srvWorlds)
{
id.SetServer(_id.Server());
if (_id == id)
{
if (_id.Version() == id->Version())
if (_id.Version() == id.Version())
{
_id = id;
return true;
}
else if (tip && id->Version() > tipWorld.Version())
else if (tip && id.Version() > tipWorld.Version())
{
tipWorld = id;
}
Expand Down
Loading