[JIRA] (JENKINS-58642) Copying artifacts from project in sub-folder using parameter doesn't work

16 views
Skip to first unread message

www.darkloki@mail.ru (JIRA)

unread,
Jul 24, 2019, 10:34:02 AM7/24/19
to jenkinsc...@googlegroups.com
Andrey T created an issue
 
Jenkins / Bug JENKINS-58642
Copying artifacts from project in sub-folder using parameter doesn't work
Issue Type: Bug Bug
Assignee: Unassigned
Components: copyartifact-plugin
Created: 2019-07-24 14:33
Priority: Critical Critical
Reporter: Andrey T

Let say we have the following job structure

Builds > TRUNK > TRUNK-Installer

Builds > PerformanceTest

where Builds and TRUNK are the folders
PerformanceTest has a parameter called SOURCE_VERSION
 

Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

${SOURCE_VERSION}/DPA-${SOURCE_VERSION}-Installer

Now the PerformanceTest fails with

17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/DPA-TRUNK-Installer
17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.

 
BUT
if I change Project name for just

TRUNK/DPA-TRUNK-Installer

It will work like a charm

Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

www.darkloki@mail.ru (JIRA)

unread,
Jul 24, 2019, 10:34:05 AM7/24/19
to jenkinsc...@googlegroups.com
Andrey T updated an issue
Change By: Andrey T
Let say we have the following job structure

Builds > TRUNK > TRUNK-Installer

Builds > PerformanceTest

where Builds and TRUNK are the folders
PerformanceTest has a parameter called SOURCE_VERSION
 

Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

{code}${SOURCE_VERSION}/${SOURCE_VERSION}-Installer{code}


Now the PerformanceTest fails with
{code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/ DPA- TRUNK-Installer
17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
 
*BUT*

if I change Project name for just
{code}TRUNK/DPA-TRUNK-Installer{code}


It will work like a charm
{code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}

www.darkloki@mail.ru (JIRA)

unread,
Jul 24, 2019, 10:34:10 AM7/24/19
to jenkinsc...@googlegroups.com
Andrey T updated an issue
Let say we have the following job structure

Builds > TRUNK > TRUNK-Installer

Builds > PerformanceTest

where Builds and TRUNK are the folders
PerformanceTest has a parameter called SOURCE_VERSION
 

Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

{code}${SOURCE_VERSION}/ DPA- ${SOURCE_VERSION}-Installer{code}


Now the PerformanceTest fails with
{code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/DPA-TRUNK-Installer
17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
 
*BUT*
if I change Project name for just
{code}TRUNK/DPA-TRUNK-Installer{code}

It will work like a charm
{code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}

www.darkloki@mail.ru (JIRA)

unread,
Jul 24, 2019, 10:35:01 AM7/24/19
to jenkinsc...@googlegroups.com
Andrey T updated an issue
Let say we have the following job structure

Builds > TRUNK > TRUNK-Installer

Builds > PerformanceTest

where Builds and TRUNK are the folders
PerformanceTest has a parameter called SOURCE_VERSION
 

Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

{code}${SOURCE_VERSION}/${SOURCE_VERSION}-Installer{code}


Now the PerformanceTest fails with
{code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/TRUNK-Installer

17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
 
*BUT*
if I change Project name for just
{code}TRUNK/ DPA- TRUNK-Installer{code}


It will work like a charm
{code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}

www.darkloki@mail.ru (JIRA)

unread,
Jul 24, 2019, 10:36:01 AM7/24/19
to jenkinsc...@googlegroups.com
Andrey T updated an issue
Let say we have the following job structure

Builds > TRUNK > TRUNK-Installer

Builds > PerformanceTest

where Builds and TRUNK are the folders
PerformanceTest has a parameter called SOURCE_VERSION
 

Now performance test uses copyartifact-plugin to copy artifacts using parameter for Project name:

{code}${SOURCE_VERSION}/${SOURCE_VERSION}-Installer{code}

Now the PerformanceTest with parameter SOURCE_VERSION=TRUNK fails with

{code}17:25:02 ERROR: Unable to find project for artifact copy: TRUNK/TRUNK-Installer
17:25:02 This may be due to incorrect project name or permission settings; see help for project name in job configuration.{code}
 
*BUT*
if I change Project name for just
{code}TRUNK/TRUNK-Installer{code}


It will work like a charm
{code}Copied 1 artifact from "Builds » TRUNK » TRUNK-Installer" build number 47{code}

www.darkloki@mail.ru (JIRA)

unread,
Jul 29, 2019, 5:16:01 AM7/29/19
to jenkinsc...@googlegroups.com
Andrey T commented on Bug JENKINS-58642
 
Re: Copying artifacts from project in sub-folder using parameter doesn't work

It seems that I've missed the configuration of "Builds > TRUNK > TRUNK-Installer" Permission to copy artifacts option
Used a wildcard and it started to work.

The trick is hidden here hudson/plugins/copyartifact/CopyArtifact.java line 414. If a build selected using a parameter it then checks for permissions.
I'm not sure why it's not checked when there are no parameters involved because it confused me a lot...

www.darkloki@mail.ru (JIRA)

unread,
Jul 29, 2019, 5:16:01 AM7/29/19
to jenkinsc...@googlegroups.com

www.darkloki@mail.ru (JIRA)

unread,
Jul 29, 2019, 5:17:02 AM7/29/19
to jenkinsc...@googlegroups.com
Andrey T resolved as Not A Defect
Change By: Andrey T
Status: Open Resolved
Resolution: Not A Defect

www.darkloki@mail.ru (JIRA)

unread,
Jul 29, 2019, 5:26:02 AM7/29/19
to jenkinsc...@googlegroups.com
Andrey T edited a comment on Bug JENKINS-58642
It seems that I've missed the configuration of "Builds > TRUNK > TRUNK-Installer" *Permission to copy artifacts* option

Used a wildcard and it started to work.

The trick is hidden here hudson/plugins/copyartifact/CopyArtifact.java line 414.

{code}if (job != null && !expandedProject.equals(project)
            //
If projectName is parameterized, need to do permission check on source project.
            && !canReadFrom(job, build)) {
            job = null; // Disallow access
        }
{code}

If
a build selected using a parameter it then checks for permissions.
I'm not sure why it's not checked when there are no parameters involved because it confused me a lot...
Reply all
Reply to author
Forward
0 new messages