[JIRA] (JENKINS-57492) Isolate errors during SCM scanning

10 views
Skip to first unread message

bitwiseman@gmail.com (JIRA)

unread,
May 15, 2019, 3:02:03 PM5/15/19
to jenkinsc...@googlegroups.com
Liam Newman created an issue
 
Jenkins / Improvement JENKINS-57492
Isolate errors during SCM scanning
Issue Type: Improvement Improvement
Assignee: Unassigned
Components: github-branch-source-plugin
Created: 2019-05-15 19:01
Priority: Minor Minor
Reporter: Liam Newman

In https://issues.jenkins-ci.org/browse/JENKINS-56996 we isolated errors in PR scanning to make them not crash the scan overall. We should isolate other errors as well.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

bitwiseman@gmail.com (JIRA)

unread,
May 15, 2019, 3:03:02 PM5/15/19
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
Change By: Liam Newman
In https://issues.jenkins-ci.org/browse/JENKINS-56996 we isolated errors in PR scanning to make them not crash the scan overall.  We should isolate other errors as well.

Wow.
I did some digging on this and it is not particularly easy.

I'd love to be able to simply catch and swallow some error locally, but if we do that it may result in jobs being deleted (or marked for deletion) simply because there was an error while reading them. I looked pretty carefully and I didn't see a way to address this safely in a small/local change.

The core problem is that the code that controls how child items are created and maintained is spread across several other plugins, including folders, scm-api and branch-api.

My thought is that we'll need to add a no-op
{{ preserve(String itemName) }} method to {{[ SCMHeadObserver |https://github . com/jenkinsci/scm-api-plugin/blob/6a044fe60143278ed26f8d91b0ec1cee116617d6/src/main/java/jenkins/scm/api/SCMHeadObserver.java#L43]}}.


Then we can wire through an implementation in {{[ MultiBranchProject.SCMHeadObserverImpl |https://github . com/jenkinsci/branch-api-plugin/blob/ed229d8e1392645c99e5686b8bd652a14ec87f4a/src/main/java/jenkins/branch/MultiBranchProject.java#L1948]}}.


Finally, we'd expose that in github-branch-source for the {{ GitHubSCMSource }} to call when an error occurs.

I suppose it would okay for PRs specifically to simply be deleted on
{{ FileNotFoundException }} specifically, but not great behavior.    

bitwiseman@gmail.com (JIRA)

unread,
May 15, 2019, 3:03:02 PM5/15/19
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
In https://issues.jenkins-ci.org/browse/JENKINS-56996 we isolated errors in PR scanning to make them not crash the scan overall.  We should isolate other errors as well.

I did some digging on this and it is not particularly easy.

I'd love to be able to simply catch and swallow some error locally, but if we do that it may result in jobs being deleted (or marked for deletion) simply because there was an error while reading them. I looked pretty carefully and I didn't see a way to address this safely in a small/local change.

The core problem is that the code that controls how child items are created and maintained is spread across several other plugins, including folders, scm-api and branch-api.

My thought is that we'll need to add a no-op preserve(String itemName) method to SCMHeadObserver.

Then we can wire through an implementation in MultiBranchProject.SCMHeadObserverImpl.


Finally, we'd expose that in github-branch-source for the GitHubSCMSource to call when an error occurs.

I suppose it would okay for PRs specifically to simply be deleted on FileNotFoundException specifically, but not great behavior.

bitwiseman@gmail.com (JIRA)

unread,
May 15, 2019, 3:04:02 PM5/15/19
to jenkinsc...@googlegroups.com
Liam Newman updated an issue
In https://issues.jenkins-ci.org/browse/JENKINS-56996 we isolated errors in PR scanning to make them not crash the scan overall.  We should isolate other errors as well.


Wow.
I did some digging on this and it is not particularly easy.

I'd love to be able to simply catch and swallow some error locally, but if we do that it may result in jobs being deleted (or marked for deletion) simply because there was an error while reading them. I looked pretty carefully and I didn't see a way to address this safely in a small/local change.

The core problem is that the code that controls how child items are created and maintained is spread across several other plugins, including folders, scm-api and branch-api.


Finally, we'd expose that in github-branch-source for the {{GitHubSCMSource}} to call when an error occurs.

I suppose it would okay for PRs specifically to simply be deleted on {{FileNotFoundException}} specifically, but not great behavior.   

bitwiseman@gmail.com (JIRA)

unread,
May 15, 2019, 3:05:02 PM5/15/19
to jenkinsc...@googlegroups.com

I did some digging on this and it is not particularly easy.

I'd love to be able to simply catch and swallow some error locally, but if we do that it may result in jobs being deleted (or marked for deletion) simply because there was an error while reading them. I looked pretty carefully and I didn't see a way to address this safely in a small/local change.

The core problem is that the code that controls how child items are created and maintained is spread across several other plugins, including folders, scm-api and branch-api.

My thought is that we'll need to add a no-op preserve(String itemName) method to SCMHeadObserver.

Then we can wire through an implementation in MultiBranchProject.SCMHeadObserverImpl.

Finally, we'd expose that in github-branch-source for the GitHubSCMSource to call when an error occurs.

Reply all
Reply to author
Forward
0 new messages