[JIRA] (JENKINS-59342) Ability to download Specific Objects bundles

0 views
Skip to first unread message

aburdajewicz@cloudbees.com (JIRA)

unread,
Sep 13, 2019, 1:26:02 AM9/13/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ assigned an issue to Allan BURDAJEWICZ
 
Jenkins / Story JENKINS-59342
Ability to download Specific Objects bundles
Change By: Allan BURDAJEWICZ
Assignee: Emilio  Escobar Allan BURDAJEWICZ
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

aburdajewicz@cloudbees.com (JIRA)

unread,
Sep 13, 2019, 1:26:02 AM9/13/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ created an issue
Issue Type: Story Story
Assignee: Emilio Escobar
Components: support-core-plugin
Created: 2019-09-13 05:25
Priority: Major Major
Reporter: Allan BURDAJEWICZ

Administrators would benefit from a feature to download job bundle, build bundle, node bundle directly from the Jenkins UI. Those information are required to troubleshoot issues related to build / node failures or job / node configuration. While those can be retrieved from the file system, it would be really useful to b able to get this from the UI and also leverage anonymization of the Support Core.

aburdajewicz@cloudbees.com (JIRA)

unread,
Sep 13, 2019, 1:30:02 AM9/13/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ updated an issue
Change By: Allan BURDAJEWICZ
Administrators would benefit from a feature to download job bundle, build bundle, node bundle directly from the Jenkins UI. Those information are required to troubleshoot issues related to build / node failures or job / node configuration. While those can be retrieved from the file system, it would be really useful to b able to get this from the UI and also leverage anonymization of the Support Core.


* Run Action to download Run information (build.xml, build logs, other files and directories)
* Item Action to download Item information (config.xml, other files and directories)
* Computer Action to download Node / Computer information (config.xml, remote working dir, remote logs, ...)

aburdajewicz@cloudbees.com (JIRA)

unread,
Sep 13, 2019, 1:30:02 AM9/13/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ started work on Story JENKINS-59342
 
Change By: Allan BURDAJEWICZ
Status: Open In Progress

aburdajewicz@cloudbees.com (JIRA)

unread,
Oct 16, 2019, 8:04:03 AM10/16/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ updated an issue
Administrators would benefit from a feature to download job bundle, build bundle, node bundle directly from the Jenkins UI. Those information are required to troubleshoot issues related to build / node failures or job / node configuration. While those can be retrieved from the file system, it would be really useful to b able to get this from the UI and also leverage anonymization of the Support Core.

* Run Action to download Run information (build.xml, build logs, other files and directories)
* Item Action to download Item information (config.xml, other files and directories)
* Computer Action to download Node / Computer information (config.xml, remote working dir, remote logs, ...)


As a Jenkins administrator, I would like to be able to click on a "Support" button for a build, a job, a folder, a node and generate a bundle which contains the contents of the item that I'm concerned about. When I click on this button, I'm prompted to select what I which to include from the item with relevant default selection.

h3. Acceptance

* Administrators shall see a new Support menu option on each Build, Item, Node (except master) page.
* The Action shall only be available to users with sufficient permission on that item
* The Action layout shall resemble the one of the root action
* The bundle generation shall leverage the current anonymization model
* The bundle generated shall contain a manifest
* The user shall be able to select an option to add files from object root directory
* The user shall be able to includes / excludes object root directory files from the bundle generation  (Ant Style pattern)
* The Menu option(s) to download content from the file system will only be available to users with {{Jenkins.ADMINISTER}} (or could be {{Jenkins.RUN_SCRIPTS}}) permission
* The user shall be presented with meaningful / non performance impacting defaults (For example, when getting content of a top level item, do not allow defaults that would download the entire root directory)
* For Nodes, the user shall be able to select an option to add files from the remote working directory
* For Nodes, the user shall be able to includes / excludes remote work dir files from the bundle generation  (Ant Style pattern)
* For Nodes, the user shall be able to select options that exists in the Root action:
**  Agent System Properties
** Agent System Configuration (Linux only)
** Agent JVM System Metrics
** Agent Config file
** Agent Logs
** Agent Launch Logs
** Agent Command Statistics
** Networks Interfaces
** File Descriptors
** Thread Dump
** Environment Variables
** Dump Export Table
** Root CAs

h3. Design

h4. New type of Component
* Abstract class {{ObjectComponent}} with generics for extensions of {{Actionable}} (or {{AbstractModelObject}} ?) items that implements a {{Describable}} (need components more complex than just a checkbox).
** An {{ObjectComponent}} defines an abstract method to add contents for a specific object (maybe {{addContents(Container, T)}}).
** An {{ObjectComponent}} defines a method {{applicable(T)}}, {{true}} by default but not final, to indicate if the component is applicable to the object processed.
** An {{ObjectComponent}} defines a method {{isSelectedByDefault(T)}}, {{true}} by default but not final, to indicate if the component should be selected by default for the object processed
** {{ObjectComponent}} shall extend {{Component}}
*** To be able to leverage existing model
*** To have components that may be used at both Root and Object(s) level
*** (Also it does make sense in terms of architecture: an {{ObjectComponent}} is a {{Component}} with extra capabilities, or this could be done with interfaces instead ?)
*** {{addContents(Container)}} inherited from {{}} Component shall be a no-op by default. Could be overridden for {{Component}}s that apply to both Root and a specific object. In most of those cases the {{addContents}} method would probably reuse the {{ObjectComponent#addContents(Container, T)}} in a loop.

h4. New Actions "API" for Object
* Abstract class {{SupportObjectAction}} with generics for extensions of {{Actionable}} (or {{AbstractModelObject}} ?) items
** Should provide most of the method required for stapler (like getting applicable descriptor and components and the defaults)

h4. New Components for Directory content
* A component that has an includes / excludes field, and can retrieve root directory content for a specific class of object, extension of {{Actionable}} (or {{AbstractModelObject}}?).
* A component that has an includes / excludes field, and can retrieve remote working directory content for a specific Node.
* Add a reusable writeBundle method that accepts a "consumer" of Component. This consumer should have a method that pass the {{Container}} such as  {{visit(Container, Component)}}.
** The object actions would pass consumers that append content using {{ObjectComponent#addContents(Container, T)}}.
** The root action would pass a consumer that appends content using the existing {{Component#addContents(container)}}.

h4. Existing API changes
* SupportAction (Root action) should not accept all extensions anymore, only the _applicable_ ones
* {{Component}} should have a method {{isApplicable(Class)}} to indicate if it is applicable to a specific class of item. Should be applicable to {{Jenkins}} by default.
* {{writeBundle}} should reuse a new method that accepts a consumer of {{Component}}.
* Existing Component that can be applied at object levels may need to be extending the more specific class {{ObjectComponent}}, have a DataBoundConstructor annotated constructor and a descriptor. Another solution, that avoid modifying, is to create a components and duplicate a bit of code.

_(Note: The design should also enable to add functionality to generate bundle for list of nodes and items, and why not all combined in the same archive. In that regards, it is important that the location of the appended content in the bundle do not clash between (all) components. For example, a component that retrieve content within the root directory of nodes should be located under {{nodes/slave/<slaveName>/}}. A component that retrieve this for an item or a build may be under {{items/<itemFullPath>/}}.)_

h3. Testing

Code:
* For each new action, integration test of Action URL via HTTP request
* For each new component, unit tests

Integration:
* Environment: Jenkins LTS 2.138.1
* Environment: Jenkins LTS 2.138.1 with a dependent like CloudBees Jenkins Advisor
* Environment: Jenkins latest LTS
* Environment: Jenkins latest LTS with a dependent like CloudBees Jenkins Advisor

aburdajewicz@cloudbees.com (JIRA)

unread,
Oct 16, 2019, 8:06:02 AM10/16/19
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ updated an issue
Change By: Allan BURDAJEWICZ
Attachment: poc-node-action-components.png
Attachment: poc-item-action-components.png

aburdajewicz@cloudbees.com (JIRA)

unread,
Oct 18, 2019, 2:25:03 AM10/18/19
to jenkinsc...@googlegroups.com

egutierrez@cloudbees.com (JIRA)

unread,
Jan 14, 2020, 4:15:08 AM1/14/20
to jenkinsc...@googlegroups.com
Change By: Evaristo Gutierrez
Status: In Review Fixed but Unreleased
Resolution: Fixed

egutierrez@cloudbees.com (JIRA)

unread,
Jan 14, 2020, 4:15:10 AM1/14/20
to jenkinsc...@googlegroups.com
Change By: Evaristo Gutierrez
Status: Fixed but Unreleased Resolved
Released As: support-core-2.66
Reply all
Reply to author
Forward
0 new messages