You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What Operating System are you using (both controller, and any agents involved in the problem)?
Windows Server 2019
Reproduction steps
Archive any file in a job
Use Copy Artifacts plugin to pull down the artifacts in another job.
The Modified Date for the file will be blank.
Expected Results
The downloaded file should have its Modified Date filled out.
Actual Results
The downloaded file has a blank Modified Date.
Anything else?
This can be fixed (with a minimal loss of precision) by multiplying lastModified.toEpochSecond() by 1000 in lastModified(). Here's how I handled it in AzureBlobVirtualFile.java
private static final int SECOND_TO_MILLISECOND_CONVERSION = 1000;
@Override
public long lastModified() throws IOException {
String keyS = key + "/";
CacheFrame frame = findCacheFrame(keyS);
if (frame != null) {
String rel = stripTrailingSlash(keyS.substring(frame.root.length()));
CachedMetadata metadata = frame.children.get(rel);
LOGGER.log(Level.FINER, "cache hit on lastModified of {0} / {1}", new Object[] {container, key});
return metadata != null ? metadata.lastModified : 0;
}
if (isDirectory()) {
return 0;
}
StorageAccountInfo accountInfo = Utils.getStorageAccount(build.getParent());
try {
BlobContainerClient blobContainerReference = Utils.getBlobContainerReference(accountInfo, this.container,
false);
BlobClient blockBlobReference = blobContainerReference.getBlobClient(this.key);
BlobProperties properties = blockBlobReference.getProperties();
OffsetDateTime lastModified = properties.getLastModified();
return lastModified == null ? 0
: (lastModified.toEpochSecond() * SECOND_TO_MILLISECOND_CONVERSION);
} catch (URISyntaxException e) {
throw new IOException(e);
} catch (BlobStorageException e) {
if (e.getStatusCode() == NOT_FOUND) {
return 0;
}
// drop the cause in case there's unserializable fields
throw new IOException(e.getMessage());
}
}
(Apologies for no PR, same as with the last bug I helped with, my company doesn't have an official GitHub account)
The text was updated successfully, but these errors were encountered:
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
Windows Server 2019
Reproduction steps
Expected Results
The downloaded file should have its Modified Date filled out.
Actual Results
The downloaded file has a blank Modified Date.
Anything else?
This can be fixed (with a minimal loss of precision) by multiplying lastModified.toEpochSecond() by 1000 in lastModified(). Here's how I handled it in AzureBlobVirtualFile.java
(Apologies for no PR, same as with the last bug I helped with, my company doesn't have an official GitHub account)
The text was updated successfully, but these errors were encountered: