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 + diff --git a/Changelog.md b/Changelog.md index 281cae3da..dcbacbd65 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,6 +6,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 07c970b02..aad051f0f 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) 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; }; /////////////////////////////////////////////// diff --git a/src/parser.cc b/src/parser.cc index bd776db7c..a44baa90f 100644 --- a/src/parser.cc +++ b/src/parser.cc @@ -1508,14 +1508,14 @@ 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() + "]", _source, - elemXml->GetLineNum()); - err.SetXmlPath(elemXmlPath); - _errors.push_back(err); + _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 23b8d6d48..ce5f9289c 100644 --- a/src/parser_TEST.cc +++ b/src/parser_TEST.cc @@ -765,6 +765,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)