jenkins-infra / repository-permissions-updater

Artifactory permissions synchronization tool and data set
77 stars 1.03k forks source link

Plugin Hosting Request: feishu-notification-plugin #3330

Closed 721806280 closed 1 year ago

721806280 commented 1 year ago

Repository URL

https://github.com/721806280/feishu-notification-plugin

New Repository Name

feishu-notification-plugin

Description

飞书 Jenkins 通知插件

GitHub users to have commit permission

@721806280

Jenkins project users to have release permission

xm721806280

Issue tracker

GitHub issues

jenkins-cert-app commented 1 year ago

Security audit, information and commands

The security team is auditing all the hosting requests, to ensure a better security by default.

This message informs you that a Jenkins Security Scan was triggered on your repository. It takes ~10 minutes to complete.

Commands The bot will parse all comments, and it will check if any line start with a command. Security team only:
  • /audit-ok => the audit is complete, the hosting can continue :tada:.
  • /audit-skip => the audit is not necessary, the hosting can continue :tada:.
  • /audit-findings => the audit reveals some issues that require corrections :pencil2:.
Anyone:
  • /request-security-scan => the findings from the [Jenkins Security Scan](https://www.jenkins.io/doc/developer/security/scan/) were corrected, this command will re-scan your repository :mag:.
  • /audit-review => the findings from the audit were corrected, this command will ping the security team to review the findings :eyes:. It's only applicable when the previous audit required changes.
Only one command can be requested per comment.

(automatically generated message, version: 1.17.21)

github-actions[bot] commented 1 year ago

Hello from your friendly Jenkins Hosting Checker

It appears you have some issues with your hosting request. Please see the list below and correct all issues marked Required. Your hosting request will not be approved until these issues are corrected. Issues marked with Warning or Info are just recommendations and will not stall the hosting process.

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

github-actions[bot] commented 1 year ago

Hello from your friendly Jenkins Hosting Checker

It appears you have some issues with your hosting request. Please see the list below and correct all issues marked Required. Your hosting request will not be approved until these issues are corrected. Issues marked with Warning or Info are just recommendations and will not stall the hosting process.

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

jenkins-cert-app commented 1 year ago

The Jenkins Security Scan discovered 1 finding(s) :mag:. For each of them, either apply the recommended correction, suppress the warning or provide a justification.

Once you're done, either re-run the scan with /request-security-scan or request the Security team to review your justifications with /audit-review.


Stapler: Missing permission check

You can find detailed information about this finding here.

FeiShuTalkManagementLink.java#45 ``` Potential missing permission check in FeiShuTalkManagementLink#doConfigure ```
NotMyFault commented 1 year ago

Hey @721806280,

additional to the issues mentioned by the bots above, could you add an English section to the README, please? That would help us and others to understand what this plugin does and facilitates a review.

Thanks!

721806280 commented 1 year ago

/hosting re-check

github-actions[bot] commented 1 year ago

Hello from your friendly Jenkins Hosting Checker

It appears you have some issues with your hosting request. Please see the list below and correct all issues marked Required. Your hosting request will not be approved until these issues are corrected. Issues marked with Warning or Info are just recommendations and will not stall the hosting process.

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

721806280 commented 1 year ago

/hosting re-check

github-actions[bot] commented 1 year ago

Hello from your friendly Jenkins Hosting Checker

It looks like you have everything in order for your hosting request. A member of the Jenkins hosting team will check over things that I am not able to check(code review, README content, etc) and process the request as quickly as possible. Thank you for your patience.

Hosting team members can host this request with /hosting host

github-actions[bot] commented 1 year ago

Hello from your friendly Jenkins Hosting Checker

It looks like you have everything in order for your hosting request. A member of the Jenkins hosting team will check over things that I am not able to check(code review, README content, etc) and process the request as quickly as possible. Thank you for your patience.

Hosting team members can host this request with /hosting host

721806280 commented 1 year ago

Hey @721806280,

additional to the issues mentioned by the bots above, could you add an English section to the README, please? That would help us and others to understand what this plugin does and facilitates a review.

Thanks!

https://github.com/721806280/feishu-notification-plugin/blob/main/README_EN.md

github-actions[bot] commented 1 year ago

Hello from your friendly Jenkins Hosting Checker

It looks like you have everything in order for your hosting request. A member of the Jenkins hosting team will check over things that I am not able to check(code review, README content, etc) and process the request as quickly as possible. Thank you for your patience.

Hosting team members can host this request with /hosting host

github-actions[bot] commented 1 year ago

Hello from your friendly Jenkins Hosting Checker

It looks like you have everything in order for your hosting request. A member of the Jenkins hosting team will check over things that I am not able to check(code review, README content, etc) and process the request as quickly as possible. Thank you for your patience.

Hosting team members can host this request with /hosting host

NotMyFault commented 1 year ago

Hey @721806280, additional to the issues mentioned by the bots above, could you add an English section to the README, please? That would help us and others to understand what this plugin does and facilitates a review. Thanks!

https://github.com/721806280/feishu-notification-plugin/blob/main/README_EN.md

Thanks, but all I see are compiling instructions. The part what this plugin is about, how it works and how you set it up is missing.

721806280 commented 1 year ago

嘿@721806280, 除了上述机器人提到的问题之外,您能否在 README 中添加一个英文部分?这将帮助我们和其他人了解这个插件的作用并促进审查。 谢谢!

https://github.com/721806280/feishu-notification-plugin/blob/main/README_EN.md

谢谢,但我看到的只是编译说明。这个插件是关于什么的,它是如何工作的以及你如何设置它的部分丢失了。

Introduction

feishu-notification-plugin is a FeiShu robot notification plugin for Jenkins, which can push the Jenkins build process and result notifications to the Feishu collaboration platform. Multiple notification timings can be configured, including build startup, build interruption, build failure, build success, build unstable, etc. Support many different types of messages, including text message, picture message, group business card message, rich text message, card message; At the same time, the plug-in also provides the functions of custom template and variable, enabling you to customize the content and format of notification messages according to your needs.

example

pipeline {
    agent any
    stages {
        stage('text'){
            steps {
                echo "Send card message..."
            }
            post {
                success {
                    feiShuTalk (
                        robot: "f72aa1bb-0f0b-47c7-8387-272d266dc25c",
                        type: "INTERACTIVE",
                        title: "📢 Jenkins build notifications",
                        text: [
                            "📋 **mission name**:[${JOB_NAME}](${JOB_URL})",
                            "🔢 **task number**:[${BUILD_DISPLAY_NAME}](${BUILD_URL})",
                            "🌟 **build status**: <font color='green'>成功</font>",
                            "🕐 **build time**: ${currentBuild.duration} ms",
                            "👤 **executor**: Started by user anonymous",
                            "<at id=all></at>"
                        ],
                        buttons: [
                           [
                              title: "amend record",
                              url: "${BUILD_URL}changes"
                           ],
                           [
                              title: "console",
                              type: "danger",
                              url: "${BUILD_URL}console"
                           ]
                        ]
                    )
                }
            }
        }
    }
}

renderings:

image

more documents: https://721806280.github.io/feishu-notification-plugin-doc/guide/front/pipeline.html#_5-%E5%8D%A1%E7%89%87%E6%B6%88%E6%81%AF

Related plugins: Dingtalk Plugin: https://github.com/jenkinsci/dingtalk-plugin

Thank you for your review, this is a simple explanation, I hope it can help you to have a better understanding, thank you~

NotMyFault commented 1 year ago

嘿@721806280, 除了上述机器人提到的问题之外,您能否在 README 中添加一个英文部分?这将帮助我们和其他人了解这个插件的作用并促进审查。 谢谢!

https://github.com/721806280/feishu-notification-plugin/blob/main/README_EN.md

谢谢,但我看到的只是编译说明。这个插件是关于什么的,它是如何工作的以及你如何设置它的部分丢失了。

Introduction

feishu-notification-plugin is a FeiShu robot notification plugin for Jenkins, which can push the Jenkins build process and result notifications to the Feishu collaboration platform. Multiple notification timings can be configured, including build startup, build interruption, build failure, build success, build unstable, etc. Support many different types of messages, including text message, picture message, group business card message, rich text message, card message; At the same time, the plug-in also provides the functions of custom template and variable, enabling you to customize the content and format of notification messages according to your needs.

example

pipeline {
    agent any
    stages {
        stage('text'){
            steps {
                echo "Send card message..."
            }
            post {
                success {
                    feiShuTalk (
                        robot: "f72aa1bb-0f0b-47c7-8387-272d266dc25c",
                        type: "INTERACTIVE",
                        title: "📢 Jenkins build notifications",
                        text: [
                            "📋 **mission name**:[${JOB_NAME}](${JOB_URL})",
                            "🔢 **task number**:[${BUILD_DISPLAY_NAME}](${BUILD_URL})",
                            "🌟 **build status**: <font color='green'>成功</font>",
                            "🕐 **build time**: ${currentBuild.duration} ms",
                            "👤 **executor**: Started by user anonymous",
                            "<at id=all></at>"
                        ],
                        buttons: [
                           [
                              title: "amend record",
                              url: "${BUILD_URL}changes"
                           ],
                           [
                              title: "console",
                              type: "danger",
                              url: "${BUILD_URL}console"
                           ]
                        ]
                    )
                }
            }
        }
    }
}

renderings:

image

more documents: https://721806280.github.io/feishu-notification-plugin-doc/guide/front/pipeline.html#_5-%E5%8D%A1%E7%89%87%E6%B6%88%E6%81%AF

Related plugins: Dingtalk Plugin: https://github.com/jenkinsci/dingtalk-plugin

Thank you for your review, this is a simple explanation, I hope it can help you to have a better understanding, thank you~

That should be in the README.md.

721806280 commented 1 year ago

嘿@721806280, 除了上述机器人提到的问题之外,您能否在 README 中添加一个英文部分?这将帮助我们和其他人了解这个插件的作用并促进审查。 谢谢!

https://github.com/721806280/feishu-notification-plugin/blob/main/README_EN.md

谢谢,但我看到的只是编译说明。这个插件是关于什么的,它是如何工作的以及你如何设置它的部分丢失了。

Introduction feishu-notification-plugin is a FeiShu robot notification plugin for Jenkins, which can push the Jenkins build process and result notifications to the Feishu collaboration platform. Multiple notification timings can be configured, including build startup, build interruption, build failure, build success, build unstable, etc. Support many different types of messages, including text message, picture message, group business card message, rich text message, card message; At the same time, the plug-in also provides the functions of custom template and variable, enabling you to customize the content and format of notification messages according to your needs. example

pipeline {
    agent any
    stages {
        stage('text'){
            steps {
                echo "Send card message..."
            }
            post {
                success {
                    feiShuTalk (
                        robot: "f72aa1bb-0f0b-47c7-8387-272d266dc25c",
                        type: "INTERACTIVE",
                        title: "📢 Jenkins build notifications",
                        text: [
                            "📋 **mission name**:[${JOB_NAME}](${JOB_URL})",
                            "🔢 **task number**:[${BUILD_DISPLAY_NAME}](${BUILD_URL})",
                            "🌟 **build status**: <font color='green'>成功</font>",
                            "🕐 **build time**: ${currentBuild.duration} ms",
                            "👤 **executor**: Started by user anonymous",
                            "<at id=all></at>"
                        ],
                        buttons: [
                           [
                              title: "amend record",
                              url: "${BUILD_URL}changes"
                           ],
                           [
                              title: "console",
                              type: "danger",
                              url: "${BUILD_URL}console"
                           ]
                        ]
                    )
                }
            }
        }
    }
}

renderings: image more documents: https://721806280.github.io/feishu-notification-plugin-doc/guide/front/pipeline.html#_5-%E5%8D%A1%E7%89%87%E6%B6%88%E6%81%AF Related plugins: Dingtalk Plugin: https://github.com/jenkinsci/dingtalk-plugin Thank you for your review, this is a simple explanation, I hope it can help you to have a better understanding, thank you~

That should be in the README.md.

updated: https://github.com/721806280/feishu-notification-plugin/blob/main/README_EN.md

NotMyFault commented 1 year ago

Thanks, I have some additional feedback:

721806280 commented 1 year ago

Thanks, I have some additional feedback:

About the content-security-policy caused by ajax. Is there a detailed replacement example? Other content has been adjusted, thanks for your review suggestion!

NotMyFault commented 1 year ago

https://github.com/721806280/feishu-notification-plugin/blob/a3425ebdd9d0e5b8ed2cb957956707bbd98d4378/src/main/webapp/scripts/notifierConfig.js#L4 Don't use Prototype.js. Jenkins is in the process of removing it. https://github.com/721806280/feishu-notification-plugin/blob/main/src/main/webapp/scripts/robotConfigValidator.js same here on line 7, 48 and 65. Take a look at https://www.jenkins.io/blog/2023/05/12/removing-prototype-from-jenkins/ how to remove the usages of Prototype.js

Remained unacknowledged. Prototype.js is still used, as you can verify with the query from the blog post. The blog post outlines how you can get a rid of it and update usages accordingly.

721806280 commented 1 year ago

https://github.com/721806280/feishu-notification-plugin/blob/a3425ebdd9d0e5b8ed2cb957956707bbd98d4378/src/main/webapp/scripts/notifierConfig.js#L4不要使用 Prototype.js。詹金斯正在删除它。 https://github.com/721806280/feishu-notification-plugin/blob/main/src/main/webapp/scripts/robotConfigValidator.js第 7、48 和 65 行相同。看看https://www .jenkins.io/blog/2023/05/12/removing-prototype-from-jenkins/如何删除 Prototype.js 的使用

仍然没有得到承认。Prototype.js 仍在使用,您可以使用博客文章中的查询进行验证。 该博客文章概述了如何摆脱它并相应地更新用法。

It's been done, thank you~

NotMyFault commented 1 year ago

/hosting re-check

NotMyFault commented 1 year ago

/request-security-scan

github-actions[bot] commented 1 year ago

Hello from your friendly Jenkins Hosting Checker

It looks like you have everything in order for your hosting request. A member of the Jenkins hosting team will check over things that I am not able to check(code review, README content, etc) and process the request as quickly as possible. Thank you for your patience.

Hosting team members can host this request with /hosting host

jenkins-cert-app commented 1 year ago

The Jenkins Security Scan did not find anything dangerous with your plugin, congratulations! :tada:


:bulb: The Security team recommends that you are setting up the scan in your repository by following our guide.

NotMyFault commented 1 year ago

/hosting host

jenkins-infra-bot commented 1 year ago

Hosting request complete, the code has been forked into the jenkinsci project on GitHub as https://github.com/jenkinsci/feishu-notification-plugin

GitHub issues has been selected for issue tracking and was enabled for the forked repo.

A pull request has been created against the repository permissions updater to setup release permissions. Additional users can be added by modifying the created file.

Please delete your original repository (if there are no other forks), under 'Danger Zone', so that the jenkinsci organization repository is the definitive source for the code. If there are other forks, please contact GitHub support to make the jenkinsci repo the root of the fork network (mention that Jenkins approval was given in support request 569994). Also, please make sure you properly follow the documentation on documenting your plugin so that your plugin is correctly documented.

You will also need to do the following in order to push changes and release your plugin:

In order for your plugin to be built by the Jenkins CI Infrastructure and check pull requests, please add a Jenkinsfile to the root of your repository with the following content: https://github.com/jenkinsci/archetypes/blob/master/common-files/Jenkinsfile

Welcome aboard!