From 3b7ecc0218dd073b3adb5092aabdbe97ea3c5e8d Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Mon, 28 Jun 2021 19:45:36 -0700 Subject: [PATCH 1/4] Add triage, remove ticket templates (#608) Signed-off-by: Louise Poubel --- .github/ISSUE_TEMPLATE/bug_report.md | 29 ------- .github/ISSUE_TEMPLATE/feature_request.md | 23 ------ .github/PULL_REQUEST_TEMPLATE.md | 92 ----------------------- .github/workflows/triage.yml | 19 +++++ 4 files changed, 19 insertions(+), 144 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/triage.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 3d89f6414..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: Bug report -about: Report a bug -labels: bug ---- - - - -## Environment -* OS Version: -* Source or binary build? - - - -## Description -* Expected behavior: -* Actual behavior: - -## Steps to reproduce - - -1. -2. -3. - -## Output - diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 87233a479..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: Feature request -about: Request a new feature -labels: enhancement ---- - - - -## Desired behavior - - -## Alternatives considered - - -## Implementation suggestion - - -## Additional context - diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index eb39c73cd..000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,92 +0,0 @@ - - -# 🦟 Bug fix - -Fixes # - -## Summary - - -## Checklist -- [ ] Signed all commits for DCO -- [ ] Added tests -- [ ] Updated documentation (as needed) -- [ ] Updated migration guide (as needed) -- [ ] Code check passed (In source directory, run `sh tools/code_check.sh`) -- [ ] All tests passed (See - [test coverage](https://ignitionrobotics.org/docs/all/contributing#test-coverage)) -- [ ] While waiting for a review on your PR, please help review -[another open pull request](https://github.com/pulls?q=is%3Aopen+is%3Apr+user%3Aignitionrobotics+repo%3Aosrf%2Fsdformat+archived%3Afalse+) -to support the maintainers - -**Note to maintainers**: Remember to use **Squash-Merge** - -πŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”Έ - -# πŸŽ‰ New feature - -Closes # - -## Summary - - -## Test it - - -## Checklist -- [ ] Signed all commits for DCO -- [ ] Added tests -- [ ] Added example and/or tutorial -- [ ] Updated documentation (as needed) -- [ ] Updated migration guide (as needed) -- [ ] Code check passed (In source directory, run `sh tools/code_check.sh`) -- [ ] All tests passed (See [test coverage](https://ignitionrobotics.org/docs/all/contributing#test-coverage)) -- [ ] While waiting for a review on your PR, please help review -[another open pull request](https://github.com/pulls?q=is%3Aopen+is%3Apr+user%3Aignitionrobotics+repo%3Aosrf%2Fsdformat+archived%3Afalse+) -to support the maintainers - -**Note to maintainers**: Remember to use **Squash-Merge** - -πŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”Έ - -# ➑️ Forward port - -Port to - -Branch comparison: https://github.com/osrf/sdformat/compare/... - -**Note to maintainers**: Remember to **Merge** with commit (not squash-merge or rebase) - -πŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”Έ - - - -# 🎈 Release - -Preparation for release. - -Comparison to : https://github.com/osrf/sdformat/compare/... - - -Needed by - -## Checklist -- [ ] Asked team if this is a good time for a release -- [ ] There are no changes to be ported from the previous major version -- [ ] No PRs targeted at this major version are close to getting in -- [ ] Bumped minor for new features, patch for bug fixes -- [ ] Updated changelog -- [ ] Updated migration guide (as needed) -- [ ] Link to PR updating dependency versions in appropriate repository in [ignition-release](https://github.com/ignition-release) (as needed): - - - -**Note to maintainers**: Remember to use **Squash-Merge** diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml new file mode 100644 index 000000000..736670e0e --- /dev/null +++ b/.github/workflows/triage.yml @@ -0,0 +1,19 @@ +on: + issues: + types: [opened] + pull_request_target: + types: [opened] +name: Ticket opened +jobs: + assign: + name: Add ticket to inbox + runs-on: ubuntu-latest + steps: + - name: Add ticket to inbox + uses: technote-space/create-project-card-action@v1 + with: + PROJECT: Core development + COLUMN: Inbox + GITHUB_TOKEN: ${{ secrets.TRIAGE_TOKEN }} + CHECK_ORG_PROJECT: true + From a4a71bcadbb08735ac59abc077449c095274afb9 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Mon, 28 Jun 2021 21:48:14 -0500 Subject: [PATCH 2/4] Fix ABI break on sdf11 (#606) Signed-off-by: Addisu Z. Taddese --- include/sdf/Element.hh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/sdf/Element.hh b/include/sdf/Element.hh index 41d2c51e5..2b47e655f 100644 --- a/include/sdf/Element.hh +++ b/include/sdf/Element.hh @@ -519,9 +519,6 @@ namespace sdf /// \brief True if element is required public: std::string required; - /// \brief True if the element was set in the SDF file. - public: bool explicitlySetInFile; - /// \brief Element description public: std::string description; @@ -574,14 +571,17 @@ namespace sdf /// \brief Path to file where this element came from public: std::string path; + /// \brief Spec version that this was originally parsed from. + public: std::string originalVersion; + + /// \brief True if the element was set in the SDF file. + public: bool explicitlySetInFile; + /// \brief Line number in file where this element came from public: std::optional lineNumber; /// \brief XML path of this element. public: std::string xmlPath; - - /// \brief Spec version that this was originally parsed from. - public: std::string originalVersion; }; /////////////////////////////////////////////// From 6034739bedabd5cbc97a2640f6b7622c3bf481b1 Mon Sep 17 00:00:00 2001 From: Louise Poubel Date: Tue, 29 Jun 2021 09:28:01 -0700 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=8E=88=2011.2.1=20(#609)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Louise Poubel Signed-off-by: Steve Peters Co-authored-by: Steve Peters --- CMakeLists.txt | 2 +- Changelog.md | 8 ++++++++ Migration.md | 14 +++++++++----- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00117b15c..8acbd36ea 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ set (SDF_PROTOCOL_VERSION 1.8) set (SDF_MAJOR_VERSION 11) set (SDF_MINOR_VERSION 2) -set (SDF_PATCH_VERSION 0) +set (SDF_PATCH_VERSION 1) set (SDF_VERSION ${SDF_MAJOR_VERSION}.${SDF_MINOR_VERSION}) set (SDF_VERSION_FULL ${SDF_MAJOR_VERSION}.${SDF_MINOR_VERSION}.${SDF_PATCH_VERSION}) diff --git a/Changelog.md b/Changelog.md index c26ef6fa4..9dd94e68f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,6 +2,14 @@ ### libsdformat 11.X.X (202X-XX-XX) +### libsdformat 11.2.1 (2021-06-28) + +1. Fix ABI break on sdf11 + * [Pull request #606](https://github.com/ignitionrobotics/sdformat/pull/606) + +1. Add triage, remove ticket templates + * [Pull request #608](https://github.com/ignitionrobotics/sdformat/pull/608) + ### libsdformat 11.2.0 (2021-06-23) 1. Revert behavior of FilePath() for elements loaded from strings diff --git a/Migration.md b/Migration.md index c10c6208a..5ddbc0ad7 100644 --- a/Migration.md +++ b/Migration.md @@ -12,11 +12,15 @@ forward programmatically. This document aims to contain similar information to those files but with improved human-readability.. +## libsdformat 11.1.0 to 11.2.0 + +ABI was broken for `sdf::Element`, and restored on version 11.2.1. + ## libsdformat 11.0.0 to 11.x.x ### Additions -1. **sdf/Console.hh** Add functions to retrieve message stream objects. These +1. **sdf/Console.hh** Add functions to retrieve message stream objects. These can be useful for redirecting the console output to other streams. + ConsoleStream &GetMsgStream() + ConsoleStream &GetLogStream() @@ -28,15 +32,15 @@ but with improved human-readability.. 1. **test/test_utils.hh**: + ScopeExit: A utility struct that calls a function when going out of scope. - + RedirectConsoleStream: A utility class used for redirecting the output of - sdferr, sdfwarn, etc to a more convenient stream object like a + + RedirectConsoleStream: A utility class used for redirecting the output of + sdferr, sdfwarn, etc to a more convenient stream object like a std::stringstream for testing purposes. ## libsdformat 10.x to 11.0 ### Additions -1. **sdf/ParserConfig.hh** A class that contains configuration options for the +1. **sdf/ParserConfig.hh** A class that contains configuration options for the libsdformat parser. 1. + Depend on ignition-utils1 for the ImplPtr and UniqueImplPtr. @@ -92,7 +96,7 @@ but with improved human-readability.. 1. Fixed Atmosphere DOM class's temperature default value. Changed from -0.065 to -0.0065. * [Pull request 482](https://github.com/osrf/sdformat/pull/482) - + 1. Fixed parsing of `` tags on lumped links when converting from URDF. * [Pull request 525](https://github.com/osrf/sdformat/pull/525) From a9c928d86a42dcb65a24a12f66eab9b38c19fd98 Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Wed, 30 Jun 2021 06:10:57 +0800 Subject: [PATCH 4/4] Fix segfault when checking for required elements in joint (#610) * Used xml instead of elemXml, added test for this particular case Signed-off-by: Aaron Chong --- src/parser.cc | 8 ++++---- src/parser_TEST.cc | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/parser.cc b/src/parser.cc index 441dcaa6d..cc23aaa3a 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -1495,13 +1495,13 @@ bool readXml(tinyxml2::XMLElement *_xml, ElementPtr _sdf, if (_sdf->GetName() == "joint" && _sdf->Get("type") != "ball") { - Error err( + Error missingElementError( ErrorCode::ELEMENT_MISSING, "XML Missing required element[" + elemDesc->GetName() + "], child of element[" + _sdf->GetName() + "]", - errorSourcePath, elemXml->GetLineNum()); - err.SetXmlPath(elemXmlPath); - _errors.push_back(err); + errorSourcePath, _xml->GetLineNum()); + missingElementError.SetXmlPath(elemXmlPath); + _errors.push_back(missingElementError); return false; } else diff --git a/src/parser_TEST.cc b/src/parser_TEST.cc index a2289097a..5e7f6fcae 100644 --- a/src/parser_TEST.cc +++ b/src/parser_TEST.cc @@ -767,6 +767,45 @@ TEST(Parser, ElementFilePath) EXPECT_EQ("", directModel->FilePath()); } +///////////////////////////////////////////////// +/// Check for missing element segfault, #590 +TEST(Parser, MissingRequiredElement) +{ + const std::string testString = R"( + + + + + + + link_0 + + 1 0 0 + + -1 + 1 + + + + + + )"; + + sdf::Errors errors; + sdf::SDFPtr sdf = InitSDF(); + EXPECT_FALSE(sdf::readString(testString, sdf, errors)); + + ASSERT_NE(errors.size(), 0u); + std::cerr << errors[0] << std::endl; + + EXPECT_EQ(errors[0].Code(), sdf::ErrorCode::ELEMENT_MISSING); + ASSERT_TRUE(errors[0].FilePath().has_value()); + EXPECT_EQ(errors[0].FilePath().value(), + "<" + std::string(sdf::kSdfStringSource) + ">"); + ASSERT_TRUE(errors[0].LineNumber().has_value()); + EXPECT_EQ(errors[0].LineNumber().value(), 7); +} + ///////////////////////////////////////////////// /// Main int main(int argc, char **argv)