You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/11/02 14:29:18 UTC

[GitHub] [skywalking-eyes] ryanmrichard opened a new pull request #84: Adds an option to the action to run in "fix" mode

ryanmrichard opened a new pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84


   This PR is a small change which adds an additional, optional, input to the action called `mode`. My goal with this change is to make it so CI pipelines can automatically apply the licenses to PRs which lack them (applying the changes would be handled by a different action like [this one](https://github.com/EndBug/add-and-commit)). I looked around and did not see any mention of such functionality; apologies if I missed it.
   
   Some additional notes:
   
   - `mode` can take one of two values: `check` or `fix`. I set the default to `check` to preserve existing behavior.
   - I have also updated the README with the new input description. 
   - I see from the diff that my IDE removed some trailing spaces; if you really want those back I can redo the changes with vim or something
   - I have tested that this works as intended with one of my own repositories; if you want proper unit tests I will need guidance/help on how to go about doing that.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] ryanmrichard commented on pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
ryanmrichard commented on pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84#issuecomment-957757469


   @kezhenxu94 I added a subsection detailing fix mode usage per your request.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] wu-sheng merged pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] wu-sheng commented on a change in pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84#discussion_r741164406



##########
File path: README.md
##########
@@ -44,6 +44,33 @@ header:
 
 **NOTE**: The full configurations can be found in [the configuration section](#configurations).
 
+#### Using the Action in Fix Mode
+
+By default the action runs License-Eye in check mode, which will raise an error
+if any of the processed files are missing license headers. If `mode` is set to
+`fix`, the action will instead apply the license header to any processed file
+that is missing a license header. The fixed files can then be pushed back to the
+pull request using another GitHub action. For example:

Review comment:
       So, one action would commit and push, then make the CI failing, right? Just confirming. Then maintainers should rerun the CI task to make it passed.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] ryanmrichard commented on a change in pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
ryanmrichard commented on a change in pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84#discussion_r741193224



##########
File path: README.md
##########
@@ -44,6 +44,33 @@ header:
 
 **NOTE**: The full configurations can be found in [the configuration section](#configurations).
 
+#### Using the Action in Fix Mode
+
+By default the action runs License-Eye in check mode, which will raise an error
+if any of the processed files are missing license headers. If `mode` is set to
+`fix`, the action will instead apply the license header to any processed file
+that is missing a license header. The fixed files can then be pushed back to the
+pull request using another GitHub action. For example:

Review comment:
       @wu-sheng The SkyWalking-Eyes action will edit the files in place. The subsequent "add-and-commit" action will use git to commit the changed files back to the PR. The action I linked to has a couple returns (see [here](https://github.com/EndBug/add-and-commit#outputs)); if you wanted to, you could add a step to the action which errs if the "add-and-commit" action makes a commit. Automating the re-run is not straightforward because GitHub doesn't like workflows triggering other workflows, so the maintainer will probably need to manually re-run the failed workflow. 
   
   In practice I usually don't worry about this becasue there's usually other changes needed to the PR; so when the PR author submits those changes (which will necessarily need to be synched with the automatic commit) they'll re-trigger CI.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] wu-sheng merged pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] ryanmrichard commented on a change in pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
ryanmrichard commented on a change in pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84#discussion_r741193224



##########
File path: README.md
##########
@@ -44,6 +44,33 @@ header:
 
 **NOTE**: The full configurations can be found in [the configuration section](#configurations).
 
+#### Using the Action in Fix Mode
+
+By default the action runs License-Eye in check mode, which will raise an error
+if any of the processed files are missing license headers. If `mode` is set to
+`fix`, the action will instead apply the license header to any processed file
+that is missing a license header. The fixed files can then be pushed back to the
+pull request using another GitHub action. For example:

Review comment:
       @wu-sheng The SkyWalking-Eyes action will edit the files in place. The subsequent "add-and-commit" action will use git to commit the changed files back to the PR. The action I linked to has a couple returns (see [here](https://github.com/EndBug/add-and-commit#outputs)); if you wanted to, you could add a step to the action which errs if the "add-and-commit" action makes a commit. Automating the re-run is not straightforward because GitHub doesn't like workflows triggering other workflows, so the maintainer will probably need to manually re-run the failed workflow. 
   
   In practice I usually don't worry about this becasue there's usually other changes needed to the PR; so when the PR author submits those changes (which will necessarily need to be synched with the automatic commit) they'll re-trigger CI.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] wu-sheng commented on a change in pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84#discussion_r741164406



##########
File path: README.md
##########
@@ -44,6 +44,33 @@ header:
 
 **NOTE**: The full configurations can be found in [the configuration section](#configurations).
 
+#### Using the Action in Fix Mode
+
+By default the action runs License-Eye in check mode, which will raise an error
+if any of the processed files are missing license headers. If `mode` is set to
+`fix`, the action will instead apply the license header to any processed file
+that is missing a license header. The fixed files can then be pushed back to the
+pull request using another GitHub action. For example:

Review comment:
       So, one action would commit and push, then make the CI failing, right? Just confirming. Then maintainers should rerun the CI task to make it passed.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] ryanmrichard commented on a change in pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
ryanmrichard commented on a change in pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84#discussion_r741193224



##########
File path: README.md
##########
@@ -44,6 +44,33 @@ header:
 
 **NOTE**: The full configurations can be found in [the configuration section](#configurations).
 
+#### Using the Action in Fix Mode
+
+By default the action runs License-Eye in check mode, which will raise an error
+if any of the processed files are missing license headers. If `mode` is set to
+`fix`, the action will instead apply the license header to any processed file
+that is missing a license header. The fixed files can then be pushed back to the
+pull request using another GitHub action. For example:

Review comment:
       @wu-sheng The SkyWalking-Eyes action will edit the files in place. The subsequent "add-and-commit" action will use git to commit the changed files back to the PR. The action I linked to has a couple returns (see [here](https://github.com/EndBug/add-and-commit#outputs)); if you wanted to, you could add a step to the action which errs if the "add-and-commit" action makes a commit. Automating the re-run is not straightforward because GitHub doesn't like workflows triggering other workflows, so the maintainer will probably need to manually re-run the failed workflow. 
   
   In practice I usually don't worry about this becasue there's usually other changes needed to the PR; so when the PR author submits those changes (which will necessarily need to be synched with the automatic commit) they'll re-trigger CI.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] ryanmrichard commented on pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
ryanmrichard commented on pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84#issuecomment-957757469


   @kezhenxu94 I added a subsection detailing fix mode usage per your request.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] ryanmrichard commented on pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
ryanmrichard commented on pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84#issuecomment-957757469


   @kezhenxu94 I added a subsection detailing fix mode usage per your request.


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] wu-sheng commented on a change in pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84#discussion_r741164406



##########
File path: README.md
##########
@@ -44,6 +44,33 @@ header:
 
 **NOTE**: The full configurations can be found in [the configuration section](#configurations).
 
+#### Using the Action in Fix Mode
+
+By default the action runs License-Eye in check mode, which will raise an error
+if any of the processed files are missing license headers. If `mode` is set to
+`fix`, the action will instead apply the license header to any processed file
+that is missing a license header. The fixed files can then be pushed back to the
+pull request using another GitHub action. For example:

Review comment:
       So, one action would commit and push, then make the CI failing, right? Just confirming. Then maintainers should rerun the CI task to make it passed.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-eyes] wu-sheng merged pull request #84: Adds an option to the action to run in "fix" mode

Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #84:
URL: https://github.com/apache/skywalking-eyes/pull/84


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org