You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/02/11 11:53:55 UTC

[GitHub] [hadoop-ozone] elek opened a new pull request #543: HDDS-2997. Support github comment based commands

elek opened a new pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543
 
 
   ## What changes were proposed in this pull request?
   
   Before we started to use github actions we had the opportunity to use some "commands" in github comments. For example when a `/label xxx` comment has been added to a PR, a bot added the label (by default just the committers can use labels, but with this approach it was possible for everyone).
   
   Since the move to use github actions I got multiple question about re-triggering the test. Even it it's possible to do with pushing an empty commit (only by the owner or committer) I think it would be better to restore the support of comment commands.
   
   This patch follows a very simple approach. The available commands are store in a separated subdirectory as shell scripts and they are called by a lightweight wrapper.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-2997
   
   ## How was this patch tested?
   
   As it works only if merged to the master I tested it in my own fork:
   
   Feel free to use this example PR to test it:
   
   https://github.com/elek/hadoop-ozone/pull/9

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] elek closed pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
elek closed pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r378814689
 
 

 ##########
 File path: .github/comment-commands/retest.sh
 ##########
 @@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+!/usr/bin/env bash
 
 Review comment:
   ```
   2020-02-13T09:37:16.1836554Z /home/runner/work/hadoop-ozone/hadoop-ozone/.github/comment-commands/retest.sh: line 1: !/usr/bin/env: No such file or directory
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] elek commented on issue #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
elek commented on issue #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#issuecomment-587058901
 
 
   Thanks the review and the test @adoroszlai I am merging it to the master right now...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r377630026
 
 

 ##########
 File path: .github/comment-commands/retest.sh
 ##########
 @@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# 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.
+
+#doc: add new empty commit to trigger new CI build
+
+PR_URL=$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")
+read -r REPO_URL BRANCH <<<"$(curl "$PR_URL" | jq -r '.head.repo.ssh_url + " " + .head.ref')"
 
 Review comment:
   I tried `/retest` in the PR in your repo, but it [failed](https://github.com/elek/hadoop-ozone/pull/9#issuecomment-584615406).  Just guessing: maybe `-s` parameter for `curl` is missing and the extra output trips up `jq`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r377612873
 
 

 ##########
 File path: .github/comment-commands/help.sh
 ##########
 @@ -0,0 +1,27 @@
+#!/usr/bin/env bash
+# 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.
+
+#doc: Show all the available comment commands
+DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
+echo "Available commands:"
+DOCTAG="#"
+DOCTAG="${DOCTAG}doc"
+for command in "$DIR"/*.sh; do
+  COMMAND_NAME="$(basename "$command" | sed 's/.sh//g')"
 
 Review comment:
   I think the regex can be a bit more strict (to allow names like `flush` or `push`, just in case):
   
   ```suggestion
     COMMAND_NAME="$(basename "$command" | sed 's/\.sh$//')"
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] elek commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r378842830
 
 

 ##########
 File path: .github/comment-commands/retest.sh
 ##########
 @@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+!/usr/bin/env bash
 
 Review comment:
   Not intentional. Just disappeared in the fog. Thanks to catch it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] elek commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r378119516
 
 

 ##########
 File path: .github/comment-commands/pending.sh
 ##########
 @@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+# 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.
+
+#doc: Add a REQUESTED_CHANGE type review to mark issue non-mergeable: `/pending <reason>`
+# shellcheck disable=SC2124
+MESSAGE="Marking this issue as un-mergeable as requested.
+
+Please use \`/ready\` comment when it's resolved.
+
+> $@"
+
+URL="$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")/reviews"
+set +x #GITHUB_TOKEN
 
 Review comment:
   I am not sure if github expose the token to the console or it's masked. If not masked we should either use `set +x` or never use `set -x`. Both works. Do you prefer to put it to everywhere or remove it from everwhere?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r378812429
 
 

 ##########
 File path: .github/comment-commands/retest.sh
 ##########
 @@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+!/usr/bin/env bash
 
 Review comment:
   Is removal of `#` intentional?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r378245941
 
 

 ##########
 File path: .github/comment-commands/pending.sh
 ##########
 @@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+# 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.
+
+#doc: Add a REQUESTED_CHANGE type review to mark issue non-mergeable: `/pending <reason>`
+# shellcheck disable=SC2124
+MESSAGE="Marking this issue as un-mergeable as requested.
+
+Please use \`/ready\` comment when it's resolved.
+
+> $@"
+
+URL="$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")/reviews"
+set +x #GITHUB_TOKEN
 
 Review comment:
   I wouldn't have thought about it, but since you added it here, I guess I'd prefer adding it everywhere.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] elek commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r378729998
 
 

 ##########
 File path: .github/comment-commands/pending.sh
 ##########
 @@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+# 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.
+
+#doc: Add a REQUESTED_CHANGE type review to mark issue non-mergeable: `/pending <reason>`
+# shellcheck disable=SC2124
+MESSAGE="Marking this issue as un-mergeable as requested.
+
+Please use \`/ready\` comment when it's resolved.
+
+> $@"
+
+URL="$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")/reviews"
+set +x #GITHUB_TOKEN
 
 Review comment:
   Ok. I added `set +x` to everywhere where GITHUB_TOKEN is used.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r377630247
 
 

 ##########
 File path: .github/comment-commands/pending.sh
 ##########
 @@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+# 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.
+
+#doc: Add a REQUESTED_CHANGE type review to mark issue non-mergeable: `/pending <reason>`
+# shellcheck disable=SC2124
+MESSAGE="Marking this issue as un-mergeable as requested.
+
+Please use \`/ready\` comment when it's resolved.
+
+> $@"
+
+URL="$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")/reviews"
+set +x #GITHUB_TOKEN
 
 Review comment:
   Is `set +x` needed for safety in the other scripts, or is this one special?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] elek commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r378729723
 
 

 ##########
 File path: .github/comment-commands/retest.sh
 ##########
 @@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# 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.
+
+#doc: add new empty commit to trigger new CI build
+
+PR_URL=$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")
+read -r REPO_URL BRANCH <<<"$(curl "$PR_URL" | jq -r '.head.repo.ssh_url + " " + .head.ref')"
 
 Review comment:
   OK, it's fixed now. Tested on the same PR

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org


[GitHub] [hadoop-ozone] elek commented on a change in pull request #543: HDDS-2997. Support github comment based commands

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #543: HDDS-2997. Support github comment based commands
URL: https://github.com/apache/hadoop-ozone/pull/543#discussion_r378281735
 
 

 ##########
 File path: .github/comment-commands/retest.sh
 ##########
 @@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# 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.
+
+#doc: add new empty commit to trigger new CI build
+
+PR_URL=$(jq -r '.issue.pull_request.url' "$GITHUB_EVENT_PATH")
+read -r REPO_URL BRANCH <<<"$(curl "$PR_URL" | jq -r '.head.repo.ssh_url + " " + .head.ref')"
 
 Review comment:
   Seems to be a permission problem. For some reason github couldn't push. I can try to use https remote and the token as the password...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org