Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Rename network request build operation and drop unused attributes.

    • -0
    • +237
    ./org/gradle/internal/resource/BuildOperationFiringExternalResourceDecorator.java
  1. … 4 more files in changeset.
Show remote resource downloads in the console 'work in progress' section.

  1. … 1 more file in changeset.
Removed unused `ExternalResource.isLocal()`

  1. … 3 more files in changeset.
Further reworking external resource APIs to remove `ExternalResourceRepository.getResource()` and corresponding `ExternalResource.close()`.

Now, all `ExternalResource` implementations are live, rather than some implementations being live and some being an awkward one shot instance.

  1. … 14 more files in changeset.
Started reworking `ExternalResourceRepository` so that no network request spans more than one method call on `ExternalResourceRepository` or `ExternalResource`.

This is work in progress and this change leaves `ExternalResourceRepository` in an intermediate state between the old and new behaviours. A subsequent change will remove the old behaviours entirely.

The semantics of the `ExternalResourceDownloadBuildOperationType` have changed in several ways:

- The build operation wraps the entire network request, rather than the "download" portion of the request.

- The build operation events are fired regardless of whether the network request was successful or not.

- No content type or content length are included in the operation's detail.

This build operation type is yet to be refactored or documented to reflect these changes.

  1. … 8 more files in changeset.
Pushed usage of `ExternalResourceName` instead of `URI` to represent a remote resource closer to the origin.

  1. … 22 more files in changeset.
Reorganise the rich build operation details/results type to further decouple from producer side semantics.

    • -0
    • +155
    ./org/gradle/internal/resource/DownloadBuildOperationFiringExternalResourceDecorator.java
  1. … 81 more files in changeset.
Reuse `FileUtils#canonicalize`

    • -10
    • +3
    ./org/gradle/internal/resource/UriTextResource.java
Reverted changes from PR#1900

  1. … 24 more files in changeset.
Convey the number of content bytes read in the download build operation result.

This provides a more (but not absolutely) reliable indicator of bytes transferred than the advertised content length pre transfer.

    • -0
    • +65
    ./org/gradle/internal/resource/ExternalResourceReadResult.java
  1. … 10 more files in changeset.
Made settings.gradle apply works (and added test)

  1. … 14 more files in changeset.
Javadocs.

  1. … 2 more files in changeset.
Javadocs.

  1. … 1 more file in changeset.
Cache script display name

    • -7
    • +15
    ./org/gradle/internal/resource/UriTextResource.java
Clean up cached artifact transform outputs on failure or crash.

  1. … 6 more files in changeset.
Javadocs.

    • -1
    • +17
    ./org/gradle/internal/resource/local/FileStore.java
  1. … 1 more file in changeset.
Introduced an abstraction that represents a snapshot of a resource's content and changed `IncrementalFileSnapshot` to extend this.

  1. … 9 more files in changeset.
Merge pull request #690 from kiddouk:story/S3-repository-can-be-configured-to-authenticate-using-AWS-EC2-instance-metadata

S3 repository can authenticate using AWS EC2 instance metadata

* This is related to https://github.com/gradle/gradle/blob/c2dc9979706e6b3beca13f1de860834e9255fb1b/design-docs/finding-and-using-credentials.md#story-an-s3-repository-can-be-configured-to-authenticate-using-awss-ec2-instance-metadata

* Note that the AWS S3 Client implementation will now use the following

credentials (in this specific order)

- Environment (AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY,

AWS_SESSION_TOKEN)

- Java System Properties - aws.accessKeyId and aws.secretKey

- Credential profiles file at the default

location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI

- Instance Profile Credentials - delivered through the Amazon EC2

metadata service

* The implementation assumes that only ONE authentication can be used

per s3-resource at a time

* This patch enforces that each Authentication now declares

`requiresCredentials` to be explicit

Integration tests:

Note that we cannot mock the instance meta data since it uses the ip

169.254.169.254 so we mock the system properties that the client

CredentialsProviderChain will look for.

  1. … 22 more files in changeset.
Only list direct children form the S3 ExternalResourceLister

- Document the contract of ExternalResourceLister

- Fix the S#Stub server to return the correct file contents and common prefixes in a listing

- Simplify S3 resource name extraction

+review REVIEW-5988

  1. … 10 more files in changeset.
Disable caching for Jar URIs opened by `UriTextResource`

The underlying caching of `JarURLConnection` will prevent the file handle

to the backing Jar file being released even when the input stream is

closed. This change disables caching for JarURLConnection when loading

via `UriTextResource`.

This change will have a performance impact for any UriScriptSource created

with a URL like `jar://my-jar-file.jar!/build-script.gradle`. On inspection

this will only occur if such a URL is used in an `apply from: ...` construct.

This fix should address leaking file handles in `UriTextResourceTest`.

  1. … 2 more files in changeset.
Add ability to reset cache statistics

+review REVIEW-5952

  1. … 1 more file in changeset.
Add ability to record remote access statistics

This plugin introduces optional recording of statistics of access for external resources.

To use it, you must run the build with `-Dgradle.externalresources.recordstats=(none|count|trace)` where:

- `count` will only record the number of times resources are fetched

- `trace` will record the number of times _each_ URI is accessed

The trace mode can have a significant impact on memory usage since all URIs are recorded.

By default, statistics are not recorded (equivalent to use `none` as the statistics recorder).

+review REVIEW-5952

  1. … 1 more file in changeset.
Add ability to revalidate external resource requests

The argument allows Cache-Control: max-age=0 to be added in cases where it's desirable for artifact repositories or caching proxies to revalidate requests:

- Listing version metadata

- Resource has exceeded it's cache lifetime on disk, such as dynamic/snapshot dependencies or when --refresh-dependencies is specified

  1. … 23 more files in changeset.
Use consistent exceptions and error messages when a resource cannot be read.

  1. … 6 more files in changeset.
Merged internal `ResourceNotFoundException` into public `MissingResourceException`.

  1. … 9 more files in changeset.
Merged internal `ResourceException` into public `ResourceException`.

    • -0
    • +45
    ./org/gradle/internal/resource/ResourceExceptions.java
  1. … 26 more files in changeset.
A slight improvement to the check whether a URI resource has content or not.

    • -1
    • +10
    ./org/gradle/internal/resource/UriTextResource.java
Moved public `ResourceException` and its subtypes from core to resources project.

    • -0
    • +26
    ./org/gradle/api/resources/MissingResourceException.java
    • -0
    • +37
    ./org/gradle/api/resources/ResourceException.java
    • -0
    • +28
    ./org/gradle/internal/resource/ResourceIsAFolderException.java
  1. … 5 more files in changeset.
Added methods to get `TextResource` content as a `Reader` and to query the encoding of the backing file, if present.

    • -4
    • +26
    ./org/gradle/internal/resource/UriTextResource.java
  1. … 4 more files in changeset.
Fixed the location reported when a pom or ivy.xml cannot be parsed so that it points to the origin of the resource, not the cached file.

Also changed the error message to use file path for an origin that is on the file system and a URI for a remote origin. Plus added some test coverage for this.

  1. … 3 more files in changeset.