Re: Unforking Commons FileUpload

2021-01-12 Thread Basil Crow
On Tue, Jan 12, 2021 at 7:33 PM Jesse Glick  wrote:
>
> sounds like it would break normal usage from Jenkins

The status quo is Commons FileUpload 1.3.1-jenkins-2 (patch in my
previous message), which _already_ removed serialization from
DiskFileItem.

Here is the timeline of events upstream:

Feb 7, 2014: Commons FileUpload 1.3.1 released [1]

May 26, 2016: Commons FileUpload 1.3.2 released [2], in which
CVE-2016-3092 is fixed (see
src/main/java/org/apache/commons/fileupload/MultipartStream.java)

July 3, 2020: Commons FileUpload 1.4.0 released [3], in which
DiskFileItem is made no longer Serializable (see
src/main/java/org/apache/commons/fileupload/FileItem.java)

Meanwhile, in Jenkins-land:

Sep 27, 2014: Jenkins adopts 1.3.1-jenkins-1 [4] in commit 28d997704f,
in which DiskFileItem is made no longer Serializable, preceding upstream
by over 6 years (see
src/main/java/org/apache/commons/fileupload/FileItem.java)

Sep 28-29, 2017: Jenkins adopts 1.3.1-jenkins-2 [5] in commit
ea981a029c, in which CVE-2016-3092 is fixed, a year and a half after
upstream (see
src/main/java/org/apache/commons/fileupload/MultipartStream.java)

Both of the patches from the Jenkins fork are present in upstream
release 1.4, so we should be able to unfork to upstream release 1.4.

Can you see a flaw in my reasoning?

[1] 
https://archive.apache.org/dist/commons/fileupload/source/commons-fileupload-1.3.1-src.tar.gz
[2] 
https://archive.apache.org/dist/commons/fileupload/source/commons-fileupload-1.3.2-src.tar.gz
[3] 
https://archive.apache.org/dist/commons/fileupload/source/commons-fileupload-1.4-src.tar.gz
[4] 
https://repo.jenkins-ci.org/releases/commons-fileupload/commons-fileupload/1.3.1-jenkins-1/commons-fileupload-1.3.1-jenkins-1-src.tar.gz
[5] 
https://repo.jenkins-ci.org/releases/commons-fileupload/commons-fileupload/1.3.1-jenkins-2/commons-fileupload-1.3.1-jenkins-2-source-release.zip

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAFwNDjqN49UB2QLv_vq1E%3DBvZecoa_T5%2B7iPNg3VmxVzYfn6eA%40mail.gmail.com.


Re: Unforking Commons FileUpload

2021-01-12 Thread Jesse Glick
https://dist.apache.org/repos/dist/release/commons/fileupload/RELEASE-NOTES.txt
says

The 1.4 release removes serialization from DiskFileItem for security
> reasons, which could be a
> breaking change depending upon one's mechanism of consumption of
> commons-fileupload.


which sounds like it would break normal usage from Jenkins. At least I
found the need to whitelist it for JEP-200 and the comment in
`FileParameterValue` suggests that this is critical. Perhaps these comments
are obsolete, I am not sure, but you would need to check various scenarios
involving file uploads and Jenkins restarts.

https://github.com/jenkinsci/file-parameters-plugin uses `FileItem` but
only transiently, not in a serialized field, so it should be unaffected.

Certainly it would be desirable to use an unforked upstream release if this
can be done compatibly, or if whatever idioms would be broken are sought
out and proactively corrected.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1gpG6w5Y6O%2BT4mfX%3DsO41Lg%2BSfrSoPsM2u6V%3DEeUQLnw%40mail.gmail.com.


Re: [Plugin Development] API to listen to the end of the execution of a step and to collect its result?

2021-01-12 Thread Jesse Glick
On Mon, Jan 11, 2021 at 8:24 PM 'Cyrille Le Clerc' via Jenkins Developers <
jenkinsci-dev@googlegroups.com> wrote:

>
>- I am not clear on if I should track the `StepEndNode` containing a
>`LabelAction` or an `ArgumentsAction`
>
> Depends on whether you are interested in the close of the body (which a
block-scoped step may run zero, one, or more times), or of the step itself.


>- On none of the StepEndNode give me access to the error thrown during
>the execution to indicate a failure,  `StepEndNode#getError()` and
>`StepEndNode.getExecution.getCauseOfFailure()` return null
>during  `GraphListener#onNewHead(FlowNode)`
>
> `onNewHead` is going to be called as soon as the new node is created,
before some of its metadata is actually initialized. Probably there should
be a better API here, but you can just use `GraphListener` in such a way
that when a new head is added, you process metadata from its *parent* node(s),
which by that time should be finalized.

I have a similar request for `git` steps that don't even have a
> `StepEndNode`, how can I intercept the end of execution and the
> result/error of the execution of a `git` step.
>
Same. When the *next* node appears, the atom node for the step should have
any `ErrorAction` attached.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr1X6WP4UUndWTpaoSqLhbAZWjoHD0jObypXNHzu1SRfOA%40mail.gmail.com.


Re: Jenkins Governance Meeting on Jan 13, 2020

2021-01-12 Thread 'Gavin Mogan' via Jenkins Developers
I have nothing to add. I'm just happy finally making my first one as a
board member

On Tue., Jan. 12, 2021, 2:13 p.m. Marky Jackson, 
wrote:

> +1 to the list of topics and I have none to add.
>
> On Jan 12, 2021, at 2:02 PM, Oleg Nenashev  wrote:
>
> Hi all,
>
> On Jan 13 we will have a regular Jenkins Governance meeting. It will
> happen at 6PM UTC in Zoom (time to finally start the new poll). There are
> only a few agenda items at the moment, please feel free suggest your
> agenda items
> 
> .
>
>- News/Updates
>- Follow-up: expectations from the Jenkins governance
>- Defining governance priorities for 2021
>
> For the governance priorities, I suggest to discuss Jenkins contributor
> onboarding, strengthening Jenkins security, and community events / outreach
> programs. If there are other topics.
>
> Best regards,
> Oleg
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/9298ba6e-cfa0-431a-a5ab-5aac1d683756n%40googlegroups.com
> 
> .
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/AAEA0679-760A-4413-B8B3-0E0D2D136D37%40gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CAG%3D_DuuH_rkihoUD8Q83vtfa2%2Bqs5-eHUHboWrjh467mG_3wfg%40mail.gmail.com.


Re: Jenkins Governance Meeting on Jan 13, 2020

2021-01-12 Thread Marky Jackson
+1 to the list of topics and I have none to add.

> On Jan 12, 2021, at 2:02 PM, Oleg Nenashev  wrote:
> 
> Hi all,
> 
> On Jan 13 we will have a regular Jenkins Governance meeting. It will happen 
> at 6PM UTC in Zoom (time to finally start the new poll). There are only a few 
> agenda items at the moment, please feel free suggest your agenda items 
> .
> News/Updates
> Follow-up: expectations from the Jenkins governance
> Defining governance priorities for 2021
> For the governance priorities, I suggest to discuss Jenkins contributor 
> onboarding, strengthening Jenkins security, and community events / outreach 
> programs. If there are other topics.
> 
> Best regards,
> Oleg
> 
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to jenkinsci-dev+unsubscr...@googlegroups.com 
> .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-dev/9298ba6e-cfa0-431a-a5ab-5aac1d683756n%40googlegroups.com
>  
> .

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/AAEA0679-760A-4413-B8B3-0E0D2D136D37%40gmail.com.


signature.asc
Description: Message signed with OpenPGP


Jenkins Governance Meeting on Jan 13, 2020

2021-01-12 Thread Oleg Nenashev
Hi all,

On Jan 13 we will have a regular Jenkins Governance meeting. It will happen 
at 6PM UTC in Zoom (time to finally start the new poll). There are only a 
few agenda items at the moment, please feel free suggest your agenda items 

.

   - News/Updates
   - Follow-up: expectations from the Jenkins governance
   - Defining governance priorities for 2021

For the governance priorities, I suggest to discuss Jenkins contributor 
onboarding, strengthening Jenkins security, and community events / outreach 
programs. If there are other topics.

Best regards,
Oleg

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/9298ba6e-cfa0-431a-a5ab-5aac1d683756n%40googlegroups.com.


Re: Unforking Commons FileUpload

2021-01-12 Thread Jeff Thompson
I'm in favor of unforking, wherever we can. A while back I unforked 
dom4j. It turned out the forked additions were essentially unused, but 
it took a long time to validate everything. Since JEP-200, the extra 
precaution to make DiskFileItem unserializable probably isn't needed, 
though that needs to be checked with the whitelist.


I haven't investigated the changes and the usage, but it looks like it 
could be unforked. That would definitely be a nice improvement.


Jeff Thompson


On 1/11/21 5:58 PM, Basil Crow wrote:

Jenkins core uses a fork of Commons FileUpload 1.3.1. Changes to
org.apache.commons.fileupload.FileItem and
org.apache.commons.fileupload.disk.DiskFileItem were made in
1.3.1-jenkins-1, and a change to
org.apache.commons.fileupload.MultipartStream was made in
1.3.1-jenkins-2. The change made in 1.3.1-jenkins-2 is just a backport
of the upstream fix for CVE-2016-3092 (released upstream as 1.3.2) for
SECURITY-490. The primary reason for the fork is the change made in
1.3.1-jenkins-1. The commit message for this change states: "[FIXED
SECURITY-159] Bumping up dependencies to 1.3.1, with extra precaution
to make DiskFileItem non-serializable." The security advisory for
SECURITY-159 states: "Security vulnerability in commons fileupload
allows unauthenticated attacker to upload arbitrary files to the
Jenkins controller." Is this "extra precaution" necessary? Do we want
to consider unforking Commons FileUpload?

diff --git a/pom.xml b/pom.xml
index 5228423..b046e78 100644
--- a/pom.xml
+++ b/pom.xml
@@ -26,7 +26,7 @@

commons-fileupload
commons-fileupload
-  1.3.1
+  1.3.1-jenkins-2

Apache Commons FileUpload

@@ -166,11 +166,6 @@
  


-  
-
scm:svn:http://svn.apache.org/repos/asf/commons/proper/fileupload/trunk
-
scm:svn:https://svn.apache.org/repos/asf/commons/proper/fileupload/trunk
-http://svn.apache.org/viewvc/commons/proper/fileupload/trunk
-  

  jira
  http://issues.apache.org/jira/browse/FILEUPLOAD
@@ -216,6 +211,7 @@
  


+  


  
@@ -295,4 +292,17 @@
  


+  
+
+  maven.jenkins-ci.org
+  https://repo.jenkins-ci.org/releases/
+
+  
+
+  
+
scm:git:git://github.com/jenkinsci/commons-fileupload.git
+
scm:git:g...@github.com:jenkinsci/commons-fileupload.git
+http://github.com/jenkinsci/commons-fileupload
+commons-fileupload-1.3.1-jenkins-2
+  
  
diff --git a/src/main/java/org/apache/commons/fileupload/FileItem.java
b/src/main/java/org/apache/commons/fileupload/FileItem.java
index d1b5c18..3a7f8b0 100644
--- a/src/main/java/org/apache/commons/fileupload/FileItem.java
+++ b/src/main/java/org/apache/commons/fileupload/FileItem.java
@@ -46,7 +46,7 @@ import java.io.UnsupportedEncodingException;
   * @version $Id: FileItem.java 1454690 2013-03-09 12:08:48Z simonetripodi $
   * @since 1.3 additionally implements FileItemHeadersSupport
   */
-public interface FileItem extends Serializable, FileItemHeadersSupport {
+public interface FileItem extends FileItemHeadersSupport {

  // --- Methods from 
javax.activation.DataSource

diff --git a/src/main/java/org/apache/commons/fileupload/MultipartStream.java
b/src/main/java/org/apache/commons/fileupload/MultipartStream.java
index a27e1ae..452192a 100644
--- a/src/main/java/org/apache/commons/fileupload/MultipartStream.java
+++ b/src/main/java/org/apache/commons/fileupload/MultipartStream.java
@@ -326,11 +326,6 @@ public class MultipartStream {
  throw new IllegalArgumentException("boundary may not be null");
  }

-this.input = input;
-this.bufSize = bufSize;
-this.buffer = new byte[bufSize];
-this.notifier = pNotifier;
-
  // We prepend CR/LF to the boundary to chop trailing CR/LF from
  // body-data tokens.
  this.boundaryLength = boundary.length + BOUNDARY_PREFIX.length;
@@ -338,6 +333,12 @@ public class MultipartStream {
  throw new IllegalArgumentException(
  "The buffer size specified for the
MultipartStream is too small");
  }
+
+this.input = input;
+this.bufSize = Math.max(bufSize, boundaryLength*2);
+this.buffer = new byte[this.bufSize];
+this.notifier = pNotifier;
+
  this.boundary = new byte[this.boundaryLength];
  this.keepRegion = this.boundary.length;

diff --git a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
index 550a7ed..3d258b1 100644
--- a/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
+++ b/src/main/java/org/apache/commons/fileupload/disk/DiskFileItem.java
@@ -644,53 +644,6 @@ public class DiskFileItem
  out.defaultWriteObject();
  }

-/**
- * Reads the state of this object during deserialization.
- *
- * @param in The stream from which the state should be read.
- *
- * @throws IOException if 

Re: [Plugin Development] API to listen to the end of the execution of a step and to collect its result?

2021-01-12 Thread Jeff
I'm the author of the "Job and Stage monitoring plugin"

Have you considered extending that plugin? I don't entirely understand what
you're trying to accomplish, but to the extent it overlaps with your
proposed plugin, it's probably better for the community not to have two
similar plugins. Most users aren't going to understand the differences
between two similar plugins, which is confusing and frustrating.

The "Job and Stage monitoring plugin" watches jobs, and allows code to take
arbitrary actions at the end of each step in a job, and also at the end of
the job. Said code can either be hosted in the JSM plugin, or an entirely
separate plugin.

On Tue, Jan 12, 2021 at 4:14 AM Andrey Babushkin  wrote:

>
> You can take a look at Job and Stage monitoring plugin (
> https://github.com/jenkinsci/github-autostatus-plugin). I think it does
> the thing you're looking for.
> On Tuesday, January 12, 2021 at 4:50:23 AM UTC+3 Mark Waite wrote:
>
>> On Mon, Jan 11, 2021 at 6:24 PM 'Cyrille Le Clerc' via Jenkins Developers
>>  wrote:
>>
>>> Dear community,
>>>
>>> *Context: *
>>> I'm trying to implement an OpenTelemetry instrumentation of Jenkins,
>>> starting injecting distributed traces in job executions. See
>>> https://github.com/cyrille-leclerc/opentelemetry-plugin
>>>
>>> *Question: *
>>> *What is the recommended way to listen to the end of the execution of a
>>> step and to collect its result?*
>>> I would like to listen the end of execution of `stage`and `git` steps to
>>> end a trace span reporting the result of the step.
>>>
>>> I found the `GraphListener#onNewHead(FlowNode)` API and I identify the
>>> end of stage steps with `StepEndNode` containing a   whose descriptor is a
>>> `StageStep.DescriptorImpl` but
>>>
>>>- I am not clear on if I should track the `StepEndNode` containing a
>>>`LabelAction` or an `ArgumentsAction`
>>>- On none of the StepEndNode give me access to the error thrown
>>>during the execution to indicate a failure,  `StepEndNode#getError()` and
>>>`StepEndNode.getExecution.getCauseOfFailure()` return null
>>>during  `GraphListener#onNewHead(FlowNode)`
>>>
>>> I'm wondering if I have to add a `BodyExecutionCallback` to the `
>>> CpsBodyInvoker` but I didn't find an API to do this implementing a
>>> listener of the pipeline executions.
>>>
>>> I have a similar request for `git` steps that don't even have a
>>> `StepEndNode`, how can I intercept the end of execution and the
>>> result/error of the execution of a `git` step.
>>>
>>>
>>
>> I don't know the answer to your listener question.  This is probably not
>> what you want to hear, but I think that you should focus on the checkout
>> step rather than the git step.  Per the git step documentation:
>>
>> More advanced checkout operations require the checkout step rather than
>> the git step.
>>
>> The git step is a simplified shorthand for a subset of the more powerful
>> checkout step:
>>
>> checkout([$class: 'GitSCM', branches: [[name: '*/master']],
>> userRemoteConfigs: [[url: 'http://git-server/user/repository.git']]])
>>
>>
>>
>>
>>> I hope my question is detailed enough.
>>>
>>> Cyrille
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Jenkins Developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to jenkinsci-de...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/jenkinsci-dev/db5376b1-3888-46f0-9429-9b34e3940ed9n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/a1012b64-1979-47a5-9646-832e21376146n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CADVhPTqzStaAww54%3DqXJL4XNfzyW0E2z3o-d7XXcYL7yu7dGXQ%40mail.gmail.com.


Re: [Plugin Development] API to listen to the end of the execution of a step and to collect its result?

2021-01-12 Thread 'Cyrille Le Clerc' via Jenkins Developers
Many thanks Andrey. It seems to be spot on, I'll look at this as soon as my 
day job ends.

@Mark you are right. I simplified a bit just mentioning the `git`step but 
I'm interested in instrumenting as many SCM integration as possible.

Cyrille

On Tuesday, January 12, 2021 at 1:14:03 PM UTC+1 oxyg...@gmail.com wrote:

>
> You can take a look at Job and Stage monitoring plugin (
> https://github.com/jenkinsci/github-autostatus-plugin). I think it does 
> the thing you're looking for.
> On Tuesday, January 12, 2021 at 4:50:23 AM UTC+3 Mark Waite wrote:
>
>> On Mon, Jan 11, 2021 at 6:24 PM 'Cyrille Le Clerc' via Jenkins Developers 
>>  wrote:
>>
>>> Dear community,
>>>
>>> *Context: *
>>> I'm trying to implement an OpenTelemetry instrumentation of Jenkins, 
>>> starting injecting distributed traces in job executions. See 
>>> https://github.com/cyrille-leclerc/opentelemetry-plugin
>>>
>>> *Question: *
>>> *What is the recommended way to listen to the end of the execution of a 
>>> step and to collect its result?*
>>> I would like to listen the end of execution of `stage`and `git` steps to 
>>> end a trace span reporting the result of the step.
>>>
>>> I found the `GraphListener#onNewHead(FlowNode)` API and I identify the 
>>> end of stage steps with `StepEndNode` containing a   whose descriptor is a 
>>> `StageStep.DescriptorImpl` but
>>>
>>>- I am not clear on if I should track the `StepEndNode` containing a 
>>>`LabelAction` or an `ArgumentsAction`
>>>- On none of the StepEndNode give me access to the error thrown 
>>>during the execution to indicate a failure,  `StepEndNode#getError()` 
>>> and 
>>>`StepEndNode.getExecution.getCauseOfFailure()` return null 
>>>during  `GraphListener#onNewHead(FlowNode)`
>>>
>>> I'm wondering if I have to add a `BodyExecutionCallback` to the `
>>> CpsBodyInvoker` but I didn't find an API to do this implementing a 
>>> listener of the pipeline executions.
>>>
>>> I have a similar request for `git` steps that don't even have a  
>>> `StepEndNode`, how can I intercept the end of execution and the 
>>> result/error of the execution of a `git` step.
>>>
>>>
>>
>> I don't know the answer to your listener question.  This is probably not 
>> what you want to hear, but I think that you should focus on the checkout 
>> step rather than the git step.  Per the git step documentation:
>>
>> More advanced checkout operations require the checkout step rather than 
>> the git step.  
>>
>> The git step is a simplified shorthand for a subset of the more powerful 
>> checkout step:
>>
>> checkout([$class: 'GitSCM', branches: [[name: '*/master']],
>> userRemoteConfigs: [[url: 'http://git-server/user/repository.git']]])
>>
>>
>>  
>>
>>> I hope my question is detailed enough.
>>>
>>> Cyrille
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Jenkins Developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to jenkinsci-de...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-dev/db5376b1-3888-46f0-9429-9b34e3940ed9n%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/d2254a2e-250b-482f-9cb7-8cd074f8c404n%40googlegroups.com.


Re: [Plugin Development] API to listen to the end of the execution of a step and to collect its result?

2021-01-12 Thread Andrey Babushkin

You can take a look at Job and Stage monitoring plugin 
(https://github.com/jenkinsci/github-autostatus-plugin). I think it does 
the thing you're looking for.
On Tuesday, January 12, 2021 at 4:50:23 AM UTC+3 Mark Waite wrote:

> On Mon, Jan 11, 2021 at 6:24 PM 'Cyrille Le Clerc' via Jenkins Developers <
> jenkin...@googlegroups.com> wrote:
>
>> Dear community,
>>
>> *Context: *
>> I'm trying to implement an OpenTelemetry instrumentation of Jenkins, 
>> starting injecting distributed traces in job executions. See 
>> https://github.com/cyrille-leclerc/opentelemetry-plugin
>>
>> *Question: *
>> *What is the recommended way to listen to the end of the execution of a 
>> step and to collect its result?*
>> I would like to listen the end of execution of `stage`and `git` steps to 
>> end a trace span reporting the result of the step.
>>
>> I found the `GraphListener#onNewHead(FlowNode)` API and I identify the 
>> end of stage steps with `StepEndNode` containing a   whose descriptor is a 
>> `StageStep.DescriptorImpl` but
>>
>>- I am not clear on if I should track the `StepEndNode` containing a 
>>`LabelAction` or an `ArgumentsAction`
>>- On none of the StepEndNode give me access to the error thrown 
>>during the execution to indicate a failure,  `StepEndNode#getError()` and 
>>`StepEndNode.getExecution.getCauseOfFailure()` return null 
>>during  `GraphListener#onNewHead(FlowNode)`
>>
>> I'm wondering if I have to add a `BodyExecutionCallback` to the `
>> CpsBodyInvoker` but I didn't find an API to do this implementing a 
>> listener of the pipeline executions.
>>
>> I have a similar request for `git` steps that don't even have a  
>> `StepEndNode`, how can I intercept the end of execution and the 
>> result/error of the execution of a `git` step.
>>
>>
>
> I don't know the answer to your listener question.  This is probably not 
> what you want to hear, but I think that you should focus on the checkout 
> step rather than the git step.  Per the git step documentation:
>
> More advanced checkout operations require the checkout step rather than 
> the git step.  
>
> The git step is a simplified shorthand for a subset of the more powerful 
> checkout step:
>
> checkout([$class: 'GitSCM', branches: [[name: '*/master']],
> userRemoteConfigs: [[url: 'http://git-server/user/repository.git']]])
>
>
>  
>
>> I hope my question is detailed enough.
>>
>> Cyrille
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Developers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-de...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-dev/db5376b1-3888-46f0-9429-9b34e3940ed9n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/a1012b64-1979-47a5-9646-832e21376146n%40googlegroups.com.


Re: Has anyone implemented OpenTelemetry or similar observability APIs in Jenkins?

2021-01-12 Thread 'Cyrille Le Clerc' via Jenkins Developers
Hello Matt,

For Your Information

   - I'm writing a PoC to instrument Jenkins with OpenTelemetry.
  - code: https://github.com/cyrille-leclerc/opentelemetry-plugin
   - My focus for the moment is tracing the execution of jobs with 
   OpenTelemetry distributed traces
  - I have a glitch for which I am asking for help 
  on https://groups.google.com/g/jenkinsci-dev/c/TEMMId7vzh0
   - I plan later down the road to instrument:
  - Jobs with OpenTelemetry metrics and logs
  - Jenkins internals with OpenTelemetry metrics and logs
   - We could also instrument Jenkins HTTP requests as you said

As OpenTelemetry is emerging as the standard for Observability / Monitoring 
with integrations with most observability technologies, open source and 
commercial, such as Jaeger, Elastic, Prometheus...), this integration will 
enable CI monitoring to most Jenkins users.

Cyrille

On Thursday, May 7, 2020 at 12:11:37 AM UTC+2, Matt Sicker wrote:
>
> Site: https://opentelemetry.io/ 
>
> This seems like it could be a useful thing to integrate with, 
> particularly for Remoting-related network calls, but it could 
> potentially be extended to other HTTP client type calls and such for 
> richer tracing data. As a Jenkins admin, you'd be able to identify 
> issues in your Jenkins cluster more easily. Implemented properly, it 
> could even provide a way for users to submit traces to help debug 
> issues they find. 
>
> I looked at their Java library, and it seems to have an absurd amount 
> of dependencies compared to a proper logging library (which has no 
> required dependencies), but the gist of attaching traces and spans to 
> requests/responses is fairly simple to implement. 
>
> -- 
> Matt Sicker 
> Senior Software Engineer, CloudBees 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/296be7c7-f98b-4f80-a3a8-f023ffb118c7o%40googlegroups.com.