-
Bug
-
Resolution: Unresolved
-
Major
-
MacOS 10.10.5
Jenkins 1.634
image gallery plugin 1.2
-
Powered by SuggestiMate
Our configuration uses this plugin on archived artifacts. In the configuration, we don't define an image width.
In latest build, the images are displayed correctly (full size).
In previous builds, the images are not visible; inspecting the page source code shows that image width is set to "0".
<h2>Screenshots</h2> <a href="artifact/reports/iPad/Test_AddFavoriteContact/20151030_161534.368//Screen_Error.jpeg" title="reports/iPad/Test_AddFavoriteContact/20151030_161534.368//Screen_Error.jpeg" class="gallery"><img src="artifact/reports/iPad/Test_AddFavoriteContact/20151030_161534.368//Screen_Error.jpeg" width="0" title="Image 0" /></a>
Changing the size in the source code (using Chrome inspector, for example) brings back the images.
- imageWidth.patch
- 0.9 kB
- no_work.jpg
- 233 kB
- works.jpg
- 278 kB
[JENKINS-31364] Image width is set to "0" in previous builds
Hi there. I have the same issue of nicolas_avenza. Tried different values or format (ie. 100 or 100px) but same result of empty field and images with "original" width.
Hi!
I couldn't reproduce this issue. Here's the steps I tried:
- Started the plug-in with Jenkins 1.580.3 (git clone repository + mvn hpi:run)
- Created a simple job with one Execute Shell build step:
`wget http://i.imgur.com/d8Y0tS8.png`
- Added post build action to archive *.png
- Added post build action to create an image gallery
- Selected Archived Images Gallery, Gallery title => Test 1, Include pattern => *.png
Building the project the image is downloaded and archived, and I can see the image + gallery on the first build page.
Building the project again, generates build #2. I can see the image on the build page of both builds just fine.
Not sure if I should have chosen a different gallery, or if there is something else that could highlight why I couldn't reproduce it.
Should be easy to fix once we find what's broken
Cheers
Bruno
Hi,
when I saw the issue, it happened only after a few builds; I could have last build and previous one (and possibly previous previous one) with images but the 4th one (and following) didn't have any. This job was run hourly so each build were separated by one hour.
I'm wondering if this is not related to a cache or some expiration date as in the faulty job, I can't find anymore any image for all my builds (I haven't run one in the last few weeks).
Maybe this will give you some new ideas
Thanks,
Frederic
Hi Frederic! Tried with a different script to see if we a few builds with and without images I could reproduce it, but nothing obvious yet.
{{#!/bin/bash
set -x
rm -rf *.png
FLAG=`expr ${RANDOM} % 2`
if [ $FLAG eq 0 ]; then
echo "Downloading image..."
wget http://i.imgur.com/d8Y0tS8.png
else
echo "Skipped..."
fi}}
Thanks anyway
Bruno
I'm using:
- jenkins 1.644
- image gallery plugin 1.2
I worked perfectly till I've updated to 1.2. Now I'll try to downgrade to 1.1
Vincenzo
I tried to downgrade the plugin to 1.1 and I got this:
MissingFieldException: No field 'imageWidthText' found in class 'org.jenkinsci.plugins.imagegallery.imagegallery.ArchivedImagesGalleryBuildAction'
I tried to Dismiss and set Image Width again without luck.
Thanks
Vincenzo
Hi here,
I confirm that downgrade to 1.1 solve the issue. I was able to save and store a width value and gallery is built correctly.
Thanks
Vincenzo
The width seems to remain stable for me; but I do have the problem in v1.2 that when opening the job config, the image width disappears.
I confirmed that in config.xml the correct width is there, but when opening the job config page, that field is empty.
I just installed the plugin today; I didn't upgrade from 1.1 or any other version.
Nope, the width doesn't remain stable — I checked a build this morning, and it looked fine. Now that a couple of other builds have been made, all of the builds now have image width = 0.
The job config is still correct and hasn't changed, but all image galleries have HTML like this now:
<link rel="stylesheet" type="text/css" href="/adjuncts/36717366/org/jenkinsci/plugins/imagegallery/stapler/colorbox/css/colorbox.css"> <h2>Screenshot from linux-slave-1</h2><a title="screenshot.png" class="gallery" href="artifact/screenshot.png"><img title="Image 0" width="0" src="artifact/screenshot.png"></a>
Thanks for the feedback orrc. Starting a sprint to work on Jenkins plug-ins this weekend, will include some hours for image-gallery-plugin. Hopefully this issue with the image width should be easy to fix.
@orrc, thanks for your feedback here again. Thanks to that, I've found what is causing this issue.
The first time you save the build, it persists the image width. But in the past we fixed one issue where image width was an integer, and it was replaced by a String (for supporting values like 300px).
I tried to keep backward compatibility with some XStream-Fu, but that's where I failed.
Forgot to fix Jelly files, and now when you open the job configuration again and save it, the old image width is not displayed in the form, and thus overwritten by zero.
Two bugs, first that the help file states that when no value is given, the original image width is used. Will look into that.
The second that the value is not displayed in the config form. Fixing that right now, with the help of Eclipse's Find tool. Simple to fix, but will take some time to fix it, review, test, make sure it's working, and commit.
Fixed in 1.3, released in about 10 hours.
Code changed in jenkins
User: Bruno P. Kinoshita
Path:
src/main/java/org/jenkinsci/plugins/imagegallery/AbstractArchivedImagesGallery.java
src/main/java/org/jenkinsci/plugins/imagegallery/ImageGallery.java
src/main/java/org/jenkinsci/plugins/imagegallery/comparative/ComparativeArchivedImagesGallery.java
src/main/java/org/jenkinsci/plugins/imagegallery/comparative/ComparativeImagesGalleryBuildAction.java
src/main/java/org/jenkinsci/plugins/imagegallery/comparative/InFolderComparativeArchivedImagesGallery.java
src/main/java/org/jenkinsci/plugins/imagegallery/comparative/MultipleFolderComparativeArchivedImagesGallery.java
src/main/java/org/jenkinsci/plugins/imagegallery/imagegallery/ArchivedImagesGallery.java
src/main/java/org/jenkinsci/plugins/imagegallery/imagegallery/ArchivedImagesGalleryBuildAction.java
src/main/resources/org/jenkinsci/plugins/imagegallery/comparative/ComparativeArchivedImagesGallery/config.jelly
src/main/resources/org/jenkinsci/plugins/imagegallery/comparative/InFolderComparativeArchivedImagesGallery/config.jelly
src/main/resources/org/jenkinsci/plugins/imagegallery/comparative/MultipleFolderComparativeArchivedImagesGallery/config.jelly
src/main/resources/org/jenkinsci/plugins/imagegallery/imagegallery/ArchivedImagesGallery/config.jelly
src/main/resources/org/jenkinsci/plugins/imagegallery/imagegallery/ComparativeArchivedImagesGallery/config.jelly
src/main/resources/org/jenkinsci/plugins/imagegallery/imagegallery/ComparativeArchivedImagesGalleryBuildAction/summary.jelly
src/main/webapp/help-imageWidth.html
http://jenkins-ci.org/commit/image-gallery-plugin/a993ebc8a28884a894540c88354192198847e736
Log:
JENKINS-31364 Use the width text fields, updating jelly files (for stapler) and java files as well. Do not default to 0, but to empty string.
Code changed in jenkins
User: Bruno P. Kinoshita
Path:
src/main/java/org/jenkinsci/plugins/imagegallery/comparative/ComparativeImagesGalleryBuildAction.java
http://jenkins-ci.org/commit/image-gallery-plugin/dc59ebfeb39b1dbe684e55a1ea6ab145fa3504a1
Log:
JENKINS-31364 Remove StringUtils (not the [lang] one) import
Reviewed the changes three times. First went through each Java class, then jelly file. Then used Find in Files from Eclipse, and looked for width in all *.java and *.jelly files.
Fixed where I found the variables names.
Reviewed once again in gitk locally, committing and pushing the changes.
Writing tests for this issue seems a bit tricky and I would like to triage the other issues before cutting a release. So will release it with 1.3, and in case there is any regression will prepare a new dev cycle to write tests.
Tested locally running mvn hpi:run, successfully changed the image width, re-opening the job configuration, and confirmed the width was persisted correctly.
Released with 1.3. Available from update centre in the next couple hours.
Issue is still present in our configuration, using Jenkins 2.8 and Image Gallery v1.3.
In the last build, the image size is right; in previous builds, the size is still "0". Do we need to do something on our configuration ? (I already tried to edit/save it)
Here is the plugin config:
<hudson.tasks.ArtifactArchiver> <artifacts>*-screenshot.png,Log*.txt</artifacts> <allowEmptyArchive>true</allowEmptyArchive> <onlyIfSuccessful>false</onlyIfSuccessful> <fingerprint>false</fingerprint> <defaultExcludes>true</defaultExcludes> <caseSensitive>true</caseSensitive> </hudson.tasks.ArtifactArchiver> <org.jenkinsci.plugins.imagegallery.ImageGalleryRecorder plugin="image-gallery@1.3"> <imageGalleries> <org.jenkinsci.plugins.imagegallery.imagegallery.ArchivedImagesGallery> <title></title> <imageWidthText>300</imageWidthText> <markBuildAsUnstableIfNoArchivesFound>false</markBuildAsUnstableIfNoArchivesFound> <includes>**/*-screenshot.png</includes> </org.jenkinsci.plugins.imagegallery.imagegallery.ArchivedImagesGallery> </imageGalleries> </org.jenkinsci.plugins.imagegallery.ImageGalleryRecorder>
fdubuisson: I think previous builds (that occurred when version 1.2 was installed) will still have this problem.
But I just tested it now with v1.3, and multiple builds of my image gallery job now all show the correct width.
orrc The v1.3 is installed since last week and we got many builds in the meantime, all with the issue.
It looks like there is something wrong with our environment but I've no idea of what it is.
I finally found the source issue. There is still one place in the code that does not handle correctly the "imageWidth/imageWidthText" transition.
With the attached patch, the issue is no more present, even in old builds.
Hi fdubuisson, patch applied in https://github.com/biouno/image-gallery-plugin/commit/d17880bb9a308d7818687c82134b9ceed9f37155 (forgot to use JENKINS-31364 in the commit message, sorry).
Feel free to review the commit. Will close the ticket when releasing 1.4 (next weeks).
Thank you for the patch.
Bruno
I'm using 1.4 and I am getting bit by this too. It seems it's hit or miss. Sometimes the width shows 0, sometimes it shows 400 (which is the width that I have it set to). I can't really tell the difference on when it works and when it doesn't. The console output is the same, and there are no logs in Jenkins to indicate anything went wrong.
Hi Alex,
Are you able to consistently reproduce the issue? I have some spare time in this development cycle, and in case there is a simple way to test and reproduce it, I can include this issue and give it a try
Cheers
Bruno
Thanks!!! I will try to reproduce it this morning and hopefully it IS reproducible! If so, I'll attach the image files and job config.xml
Dang. I've been trying all morning to reproduce and no luck. I'm using the EXACT same images in 2 jobs: one works, one doesn't.
The only difference is that the one that does NOT work has extra "things" on that page, like unit test results, code coverage, etc. etc.
I'm attaching a screenshot of what I mean. I'll try to create a dummy job that has those dummy widgets too...
Hi Alex,
I know how you feel. I am working on Image Gallery and Active Choices, before jumping to TAP plug-in before x-mas. For Active Choices I have spent a fair amount of the last days just trying to reproduce issues with no luck. That's why I first asked here if you could reproduce it
But I think I know what could be happening.
I bet you have a job that was created with an older version of the plug-in. Then we fixed the issue, and are probably not properly handling backward compatibility, and Java serialization.
If you really want to reproduce it now, you would need to start a blank Jenkins with an older version of the plug-in (one before the bug was fixed), run the job at least once to have the gallery configuration persisted on disk. Then finally you just update the plug-in, re-run the job, and you should see the bug.
This bug still seems to be an issue in Jenkins 2.89.2 with plugin 1.4
I've also noticed that the width value is not properly stored in the job configuration; the field is empty every time you go to edit the job again.