Open siddhantdange opened 5 months 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
/hosting re-check
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
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.
/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:./request-security-scan
=> the findings from the Jenkins 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.(automatically generated message, version: 1.28.6)
:x: Jenkins Security Scan failed. The Security team was notified about this.
Hey @siddhantdange
I think the Security scan is failing because you do not include in the pom.xml the pluginRepository, leading to the failure to find maven-hpi-plugin:3.13
(available in the Jenkins repo)
<pluginRepositories>
<pluginRepository>
<id>repo.jenkins-ci.org</id>
<url>https://repo.jenkins-ci.org/public/</url>
</pluginRepository>
</pluginRepositories>
/request-security-scan
The Jenkins Security Scan discovered 4 finding(s) :mag:.
Please follow the instructions below for every identified issues:
After addressing the findings through one of the above methods:
/request-security-scan
command./audit-review
command.You can find detailed information about this finding here.
You can find detailed information about this finding here.
You can find detailed information about this finding here.
/request-security-scan
The Jenkins Security Scan discovered 3 finding(s) :mag:.
Please follow the instructions below for every identified issues:
After addressing the findings through one of the above methods:
/request-security-scan
command./audit-review
command.You can find detailed information about this finding here.
You can find detailed information about this finding here.
You can find detailed information about this finding here.
/request-security-scan
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 is there any further action needed?
I'll take a look later the week
Hi @NotMyFault - just wanted to check back in here!
I'll take a look when I get a shot to, currently I don't
I took a brief look over your hosting request and have some feedback for you:
.github
folder with the following files and directories: https://github.com/jenkinsci/archetypes/tree/master/common-files/.github.mvn
folder with the following files: https://github.com/jenkinsci/archetypes/tree/master/common-files/.mvnJenkinsfile
with the following content: https://github.com/jenkinsci/archetypes/blob/master/common-files/Jenkinsfileindex.jelly
<tag>${scmTag}</tag>
io.jenkins.plugins
, e.g. io.jenkins.plugins.buildpulse
FilePath.createLauncher()
if you want to execute external processes, or you can use FilePath.act()
when you want to download a file and write it to the workspace. At the moment everything will fail miserably when the step is running on an agent.Hi @NotMyFault, we've pushed an update that addresses many of these points, do you mind checking the pom.xml again? Also, many of these dependencies we have are for our tests (updated pom.xml to reflect that).
@mawinter69
Test Jenkinsfile:
pipeline {
agent {
docker {
image 'ruby:3.0.5' // Specify the Ruby container image you want to use
args '-u root' // Optionally, specify additional Docker container run arguments
}
}
environment {
GIT_REPO_URL = 'my-repo-url' // Replace with your repository URL
GIT_BRANCH = 'main' // Replace with your branch name if needed
}
stages {
stage('Clone Repository') {
steps {
script {
echo 'Cloning the repository...'
scmVars = git branch: "${env.GIT_BRANCH}", url: "${env.GIT_REPO_URL}", credentialsId: 'github'
env.GIT_COMMIT = scmVars.GIT_COMMIT
}
}
}
stage('Setup') {
steps {
script {
sh "gem install bundler -v '2.3.26'"
sh 'bundle install --jobs=4 --retry=3 --path vendor/bundle'
sh 'bin/rspec'
}
}
}
}
post {
always {
buildpulseStep accountId: '', repositoryId: '', junitXMLPaths: '', key: '', secret: '', commitSHA: env.GIT_COMMIT, branch: env.GIT_BRANCH, tags: '', quota: '', coveragePaths: ''
}
}
}
To test with a real agent install the Mock agent plugin, create an agent and run the pipeline on that agent. I'm not familiar with docker agents in Jenkins but afaik such docker containers run on the controller host and the docker plugin creates a local workspace on the controller and maps this at the same place in the docker container. So the path on the agent and the controller are identical and your plugin finds the file.
You might not persist the key yourself, but Jenkins is writing xml files with step parameters to the file system
@mawinter69 I tested this pipeline with the Jenkinsfile above + my plugin, running on Mock Agent, and it seems to work fine.
From the logs:
Running on [agent](http://localhost:8080/computer/agent/) in /var/jenkins_home/mock-agents/agent/workspace/test-pipeline
Happy to paste full logs if you want to see that.
I think it only works because the mock-agent runs on the same physical machine with the same user. So you should setup a real agent that is running on a different machine (or on the same machine as a different user that has no access to /var/jenkins_home)
@mawinter69 Made the necessary changes, tested it on another agent on another node. Mind taking another look?
It looks good now from the point that execution on agents works without problems I think. This leaves 2 open points:
io.jenkins.plugins
, e.g. io.jenkins.plugins.buildpulse
There might be one issue with downloading the binary file: https://github.com/buildpulse/buildpulse-jenkins-plugin/blob/d2e6c4cdf257ffdac2b6efe888c15c1e4bac347b/src/main/java/io/jenkins/plugins/BuildPulseCommand.java#L172 is executed on the controller so when the controller is Linux you will always get the unix binary even when the agent is on windows. With FilePath.toComputer() -> Computer.getSystemProperties() you can determine the remote OS.
https://github.com/buildpulse/buildpulse-jenkins-plugin/blob/d2e6c4cdf257ffdac2b6efe888c15c1e4bac347b/src/main/java/io/jenkins/plugins/BuildPulseStep.java#L132 Looks suspicious, why hard coded git url pointing to something not existing?
@mawinter69 Addressed these comments and updated repository. The hardcoded url is for a required argument to the binary - the binary infers repository url from env vars for other CI providers, however, this does not apply here so we've filled in a dummy value (added comment for clarity).
Some more things
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.86</version>
<relativePath/>
</parent>
The missing pom is the reason why you have to define the dependencies in lines 55-72 and 122-139. You can just remove them. This also allows you to remove the lines 160-182 and 27-28
src/main/resources/index.jelly
with a description what the plugin does. This is what is shown in the Jenkins UI in the available plugins pageconfig.jelly
for your BuildStep. With this file you allow your customers to use the snippet generator to generate the correct syntax for the step. Also add corresponding help files for each things that can be configured. This can be of great help when you have the help inline and don't need to first visit e.g. the plugin page or some other place.* @jenkinsci/buildpulse-flaky-tests-plugin-developers
@mawinter69 Updated once more - will add the config.jelly
as a part of a future update. By the way, I appreciate all the time you're spending here!
Also looks like when clicking on a plugin 'Available Plugins', it redirects me to the plugin documentation (plugin README)
A few more things:
.github/CODEOWNERS
, so delete the one in the project root and update the one in .github
buildpulse-flaky-tests-plugin
so the urls in the pom should use that, what most people do is to write https://github.com/jenkinsci/${project.artifactId}-plugin
, affected lines: 10, 30, 33 - 35@mawinter69 updated CODEOWNERS
, pom.xml
, and renamed the repository to buildpulse-flaky-tests-plugin
The urls in line 33-35 are missing a /
after the org
@NotMyFault @mawinter69 updated
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
@mawinter69 is this approved?
/request-security-scan
The Jenkins Security Scan discovered 2 finding(s) :mag:.
Please follow the instructions below for every identified issues:
After addressing the findings through one of the above methods:
/request-security-scan
command./audit-review
command.You can find detailed information about this finding here.
/request-security-scan
The Jenkins Security Scan discovered 1 finding(s) :mag:.
Please follow the instructions below for every identified issues:
After addressing the findings through one of the above methods:
/request-security-scan
command./audit-review
command.You can find detailed information about this finding here.
/request-security-scan
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 keyId
is never serialized to disk
@NotMyFault @mawinter69 Just wanted to bump this
Hi apologies for the delay.
Repository URL
https://github.com/buildpulse/buildpulse-flaky-tests-plugin
New Repository Name
buildpulse-flaky-tests-plugin
Description
Our Jenkins plugin allows one to easily send test results to BuildPulse for CI analytics and flaky test detection.
GitHub users to have commit permission
@siddhantdange
Jenkins project users to have release permission
sidbuildpulse
Issue tracker
GitHub issues