From dcb88035d4fca674e66f761cf34a34970e67756e Mon Sep 17 00:00:00 2001 From: kminoda <44218668+kminoda@users.noreply.github.com> Date: Mon, 24 Jun 2024 22:39:19 +0900 Subject: [PATCH 1/2] feat(auoware_test_utils): add jump_clock interface (#7638) * feat(auoware_test_utils): add jump_clock interface Signed-off-by: kminoda * add comment Signed-off-by: kminoda --------- Signed-off-by: kminoda --- .../autoware_test_utils.hpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/common/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp b/common/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp index d7de1397bfaac..254a2d03f71d1 100644 --- a/common/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp +++ b/common/autoware_test_utils/include/autoware_test_utils/autoware_test_utils.hpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -527,6 +528,7 @@ class AutowareTestManager AutowareTestManager() { test_node_ = std::make_shared("autoware_test_manager_node"); + pub_clock_ = test_node_->create_publisher("/clock", 1); } template @@ -560,10 +562,28 @@ class AutowareTestManager } } + /** + * @brief Publishes a ROS Clock message with the specified time. + * + * This function publishes a ROS Clock message with the specified time. + * Be careful when using this function, as it can affect the behavior of + * the system under test. Consider using ament_add_ros_isolated_gtest to + * isolate the system under test from the ROS clock. + * + * @param time The time to publish. + */ + void jump_clock(const rclcpp::Time & time) + { + rosgraph_msgs::msg::Clock clock; + clock.clock = time; + pub_clock_->publish(clock); + } + protected: // Publisher std::unordered_map> publishers_; std::unordered_map> subscribers_; + rclcpp::Publisher::SharedPtr pub_clock_; // Node rclcpp::Node::SharedPtr test_node_; From ef3cef1f253b693e38be468998788868cfb69c90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Fatih=20C=C4=B1r=C4=B1t?= Date: Mon, 24 Jun 2024 18:03:01 +0300 Subject: [PATCH 2/2] chore: update the PR template (#7667) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: M. Fatih Cırıt --- .github/PULL_REQUEST_TEMPLATE.md | 8 --- .github/PULL_REQUEST_TEMPLATE/small-change.md | 44 ------------- .../PULL_REQUEST_TEMPLATE/standard-change.md | 63 ------------------- .github/pull_request_template.md | 61 ++++++++++++++++++ .github/sync-files.yaml | 3 - .github/workflows/comment_on_pr.yaml | 25 ++++++++ 6 files changed, 86 insertions(+), 118 deletions(-) delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE/small-change.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE/standard-change.md create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/comment_on_pr.yaml diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 97b0e95452426..0000000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,8 +0,0 @@ -**Note**: Confirm the [contribution guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/) before submitting a pull request. - -Click the `Preview` tab and select a PR template: - -- [Standard change](?expand=1&template=standard-change.md) -- [Small change](?expand=1&template=small-change.md) - -**Do NOT send a PR with this description.** diff --git a/.github/PULL_REQUEST_TEMPLATE/small-change.md b/.github/PULL_REQUEST_TEMPLATE/small-change.md deleted file mode 100644 index e15fdd992d114..0000000000000 --- a/.github/PULL_REQUEST_TEMPLATE/small-change.md +++ /dev/null @@ -1,44 +0,0 @@ -## Description - - - -## Tests performed - - - - -Not applicable. - -## Effects on system behavior - - - -Not applicable. - -## Interface changes - - - -## Pre-review checklist for the PR author - -The PR author **must** check the checkboxes below when creating the PR. - -- [ ] I've confirmed the [contribution guidelines]. -- [ ] The PR follows the [pull request guidelines]. - -## In-review checklist for the PR reviewers - -The PR reviewers **must** check the checkboxes below before approval. - -- [ ] The PR follows the [pull request guidelines]. - -## Post-review checklist for the PR author - -The PR author **must** check the checkboxes below before merging. - -- [ ] There are no open discussions or they are tracked via tickets. - -After all checkboxes are checked, anyone who has write access can merge the PR. - -[contribution guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/ -[pull request guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/ diff --git a/.github/PULL_REQUEST_TEMPLATE/standard-change.md b/.github/PULL_REQUEST_TEMPLATE/standard-change.md deleted file mode 100644 index 391af629751e0..0000000000000 --- a/.github/PULL_REQUEST_TEMPLATE/standard-change.md +++ /dev/null @@ -1,63 +0,0 @@ -## Description - - - -## Related links - - - -## Tests performed - - - -## Notes for reviewers - - - -## Interface changes - - - -### ROS Topic Changes - - - - - - -### ROS Parameter Changes - - - - - -## Effects on system behavior - - - -## Pre-review checklist for the PR author - -The PR author **must** check the checkboxes below when creating the PR. - -- [ ] I've confirmed the [contribution guidelines]. -- [ ] The PR follows the [pull request guidelines]. - -## In-review checklist for the PR reviewers - -The PR reviewers **must** check the checkboxes below before approval. - -- [ ] The PR follows the [pull request guidelines]. -- [ ] The PR has been properly tested. -- [ ] The PR has been reviewed by the code owners. - -## Post-review checklist for the PR author - -The PR author **must** check the checkboxes below before merging. - -- [ ] There are no open discussions or they are tracked via tickets. -- [ ] The PR is ready for merge. - -After all checkboxes are checked, anyone who has write access can merge the PR. - -[contribution guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/ -[pull request guidelines]: https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/ diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000000000..fcaf3601fef92 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,61 @@ +## Description + +## Related links + +**Parent Issue:** + +- Link + + + +## How was this PR tested? + +## Notes for reviewers + +None. + +## Interface changes + +None. + + + +## Effects on system behavior + +None. diff --git a/.github/sync-files.yaml b/.github/sync-files.yaml index 263df86438787..151890e2783d9 100644 --- a/.github/sync-files.yaml +++ b/.github/sync-files.yaml @@ -7,9 +7,6 @@ - source: .github/ISSUE_TEMPLATE/bug.yaml - source: .github/ISSUE_TEMPLATE/config.yml - source: .github/ISSUE_TEMPLATE/task.yaml - - source: .github/PULL_REQUEST_TEMPLATE.md - - source: .github/PULL_REQUEST_TEMPLATE/small-change.md - - source: .github/PULL_REQUEST_TEMPLATE/standard-change.md - source: .github/dependabot.yaml - source: .github/stale.yml - source: .github/workflows/cancel-previous-workflows.yaml diff --git a/.github/workflows/comment_on_pr.yaml b/.github/workflows/comment_on_pr.yaml new file mode 100644 index 0000000000000..d9b13e78ac29d --- /dev/null +++ b/.github/workflows/comment_on_pr.yaml @@ -0,0 +1,25 @@ +name: Comment on PR +on: + pull_request: + +jobs: + comment-on-pr: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Initial PR comment + uses: marocchino/sticky-pull-request-comment@v2 + with: + message: | + Thank you for contributing to the Autoware project! + + 🚧 If your pull request is in progress, [switch it to draft mode](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#converting-a-pull-request-to-a-draft). + + Please ensure: + - You've checked our [contribution guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/). + - Your PR follows our [pull request guidelines](https://autowarefoundation.github.io/autoware-documentation/main/contributing/pull-request-guidelines/). + - All required CI checks pass before [marking the PR ready for review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review).