From 731b05b7f112ddc62bd0fd032b132a07fc74e73a Mon Sep 17 00:00:00 2001 From: Bertty Contreras-Rojas Date: Mon, 24 Jan 2022 20:33:58 +0100 Subject: [PATCH] [CI] create Issues from the TODO in the code (#60) * [CI] add TODO to issue as github action Signed-off-by: bertty * [TODO] add todo Signed-off-by: bertty * [LICENSE-HEADER] add exceptions for the gitmodules Signed-off-by: bertty * [CI] todo2issue: execute in all the case Signed-off-by: bertty * [CI] todo2issue: update recursive to bring the submodules Signed-off-by: bertty * [DOCS][TODO] add Documentation Signed-off-by: bertty * [CI] todo2issue: add token Signed-off-by: bertty * [DOCS][TODO] add documentation Signed-off-by: bertty * [CI] add permissions Signed-off-by: bertty --- .github/actions/todo-to-issue-action | 1 + .github/workflows/todo2issue.yml | 38 +++++++++++++++++++ .gitmodules | 3 ++ .licenserc.yaml | 2 + pom.xml | 2 + .../wayang/core/optimizer/SanityChecker.java | 10 +++++ 6 files changed, 56 insertions(+) create mode 160000 .github/actions/todo-to-issue-action create mode 100644 .github/workflows/todo2issue.yml create mode 100644 .gitmodules diff --git a/.github/actions/todo-to-issue-action b/.github/actions/todo-to-issue-action new file mode 160000 index 000000000..16fa734cc --- /dev/null +++ b/.github/actions/todo-to-issue-action @@ -0,0 +1 @@ +Subproject commit 16fa734cc4c733df3535f1c1343fdf226a6cfbea diff --git a/.github/workflows/todo2issue.yml b/.github/workflows/todo2issue.yml new file mode 100644 index 000000000..07318ad2c --- /dev/null +++ b/.github/workflows/todo2issue.yml @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: to-do to issue workflow + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + types: [closed] +permissions: + issues: write +jobs: + build: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@master" + with: + persist-credentials: false + submodules: recursive + - name: "TODO to Issue" + uses: ./.github/actions/todo-to-issue-action + id: "todo" + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..d155c2488 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule ".github/actions/todo-to-issue-action"] + path = .github/actions/todo-to-issue-action + url = https://github.com/alstr/todo-to-issue-action.git diff --git a/.licenserc.yaml b/.licenserc.yaml index d04a19de3..783765316 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -35,6 +35,8 @@ header: - '**/*.lock' - '**/*.ini' - '**/.gitignore' + - '**/.gitmodules' + - '**/.github/actions/todo-to-issue-action' - '**/org/apache/wayang/commons/util/profiledb/**' comment: on-failure diff --git a/pom.xml b/pom.xml index 1bbecb483..7f185947e 100644 --- a/pom.xml +++ b/pom.xml @@ -1216,6 +1216,8 @@ **/.git/** **/.gitignore + **/.gitmodules + **/.github/actions/** **/target/** diff --git a/wayang-commons/wayang-core/src/main/java/org/apache/wayang/core/optimizer/SanityChecker.java b/wayang-commons/wayang-core/src/main/java/org/apache/wayang/core/optimizer/SanityChecker.java index d4a57033e..20ed63840 100644 --- a/wayang-commons/wayang-core/src/main/java/org/apache/wayang/core/optimizer/SanityChecker.java +++ b/wayang-commons/wayang-core/src/main/java/org/apache/wayang/core/optimizer/SanityChecker.java @@ -115,6 +115,11 @@ private void checkSubplanNotASingleton(Subplan subplan, final AtomicBoolean test } } + /** + * TODO: (Documentation) add SanityChecker.checkFlatAlternatives + * labels: documentation,todo + * @return + */ public boolean checkFlatAlternatives() { AtomicBoolean testOutcome = new AtomicBoolean(true); new PlanTraversal(true, false) @@ -123,6 +128,11 @@ public boolean checkFlatAlternatives() { return testOutcome.get(); } + /** + * TODO: (Documentation) add SanityChecker.getFlatAlternativeCallback + * labels: documentation,todo + * @return + */ private PlanTraversal.Callback getFlatAlternativeCallback(AtomicBoolean testOutcome) { return (operator, fromInputSlot, fromOutputSlot) -> { if (operator.isAlternative()) {