diff options
author | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-22 21:37:47 +0300 |
---|---|---|
committer | Micaël Bergeron <mbergeron@gitlab.com> | 2018-03-22 21:37:47 +0300 |
commit | b08a1cd2c406919491f8a91e51aa0034762df14e (patch) | |
tree | a86a9ffd254deab1374aaad82fb58dcdee997ab0 | |
parent | 764b5fdd162d159bc6d8fb81adf71e32f5901de1 (diff) |
fix the failing specs
-rw-r--r-- | app/controllers/concerns/send_file_upload.rb | 3 | ||||
-rw-r--r-- | doc/administration/job_artifacts.md | 2 | ||||
-rw-r--r-- | doc/administration/uploads.md | 2 | ||||
-rw-r--r-- | doc/workflow/lfs/lfs_administration.md | 2 | ||||
-rw-r--r-- | spec/requests/api/jobs_spec.rb | 1 | ||||
-rw-r--r-- | spec/support/stub_object_storage.rb | 6 | ||||
-rw-r--r-- | spec/tasks/gitlab/artifacts/migrate_rake_spec.rb | 2 |
7 files changed, 11 insertions, 7 deletions
diff --git a/app/controllers/concerns/send_file_upload.rb b/app/controllers/concerns/send_file_upload.rb index e8636ab7901..55011c89886 100644 --- a/app/controllers/concerns/send_file_upload.rb +++ b/app/controllers/concerns/send_file_upload.rb @@ -8,7 +8,8 @@ module SendFileUpload if file_upload.file_storage? send_file file_upload.path, send_params elsif file_upload.class.proxy_download_enabled? - Gitlab::Workhorse.send_url(file_upload.url(**redirect_params)) + headers.store(*Gitlab::Workhorse.send_url(file_upload.url(**redirect_params))) + head :ok else redirect_to file_upload.url(**redirect_params) end diff --git a/doc/administration/job_artifacts.md b/doc/administration/job_artifacts.md index 0687d4bce71..ac3a12930c3 100644 --- a/doc/administration/job_artifacts.md +++ b/doc/administration/job_artifacts.md @@ -109,7 +109,7 @@ For source installations the following settings are nested under `artifacts:` an | `enabled` | Enable/disable object storage | `false` | | `remote_directory` | The bucket name where Artfacts will be stored| | | `background_upload` | Set to false to disable automatic upload. Option may be removed once upload is direct to S3 | `true` | -| `proxy_download` | Set to false to disable proxying all files served. Option allows to reduce egress traffic as this allows clients to download directly from remote storage instead of proxying all data | `false` | +| `proxy_download` | Set to true to enable proxying all files served. Option allows to reduce egress traffic as this allows clients to download directly from remote storage instead of proxying all data | `false` | | `connection` | Various connection options described below | | #### S3 compatible connection settings diff --git a/doc/administration/uploads.md b/doc/administration/uploads.md index 30d8436b5c9..a82735cc72c 100644 --- a/doc/administration/uploads.md +++ b/doc/administration/uploads.md @@ -66,7 +66,7 @@ For source installations the following settings are nested under `uploads:` and | `enabled` | Enable/disable object storage | `false` | | `remote_directory` | The bucket name where Uploads will be stored| | | `background_upload` | Set to false to disable automatic upload. Option may be removed once upload is direct to S3 | `true` | -| `proxy_download` | Set to false to disable proxying all files served. Option allows to reduce egress traffic as this allows clients to download directly from remote storage instead of proxying all data | `false` | +| `proxy_download` | Set to true to enable proxying all files served. Option allows to reduce egress traffic as this allows clients to download directly from remote storage instead of proxying all data | `false` | | `connection` | Various connection options described below | | #### S3 compatible connection settings diff --git a/doc/workflow/lfs/lfs_administration.md b/doc/workflow/lfs/lfs_administration.md index 734c040211b..ca28e0a3304 100644 --- a/doc/workflow/lfs/lfs_administration.md +++ b/doc/workflow/lfs/lfs_administration.md @@ -64,7 +64,7 @@ For source installations the following settings are nested under `lfs:` and then | `enabled` | Enable/disable object storage | `false` | | `remote_directory` | The bucket name where LFS objects will be stored| | | `background_upload` | Set to false to disable automatic upload. Option may be removed once upload is direct to S3 | `true` | -| `proxy_download` | Set to false to disable proxying all files served. Option allows to reduce egress traffic as this allows clients to download directly from remote storage instead of proxying all data | `false` | +| `proxy_download` | Set to true to enable proxying all files served. Option allows to reduce egress traffic as this allows clients to download directly from remote storage instead of proxying all data | `false` | | `connection` | Various connection options described below | | #### S3 compatible connection settings diff --git a/spec/requests/api/jobs_spec.rb b/spec/requests/api/jobs_spec.rb index 81335e72350..aa9a9918b8c 100644 --- a/spec/requests/api/jobs_spec.rb +++ b/spec/requests/api/jobs_spec.rb @@ -21,7 +21,6 @@ describe API::Jobs do let(:guest) { create(:project_member, :guest, project: project).user } before do - stub_licensed_features(cross_project_pipelines: true) project.add_developer(user) end diff --git a/spec/support/stub_object_storage.rb b/spec/support/stub_object_storage.rb index 69c59fb0015..3780fbab37c 100644 --- a/spec/support/stub_object_storage.rb +++ b/spec/support/stub_object_storage.rb @@ -1,8 +1,12 @@ module StubConfiguration - def stub_object_storage_uploader(config:, uploader:, remote_directory:, enabled: true, background_upload: false) + def stub_object_storage_uploader(config:, uploader:, remote_directory:, + enabled: true, + proxy_download: false, + background_upload: false) Fog.mock! allow(config).to receive(:enabled) { enabled } + allow(config).to receive(:proxy_download) { proxy_download } allow(config).to receive(:background_upload) { background_upload } return unless enabled diff --git a/spec/tasks/gitlab/artifacts/migrate_rake_spec.rb b/spec/tasks/gitlab/artifacts/migrate_rake_spec.rb index 570c7fa7503..8544fb62b5a 100644 --- a/spec/tasks/gitlab/artifacts/migrate_rake_spec.rb +++ b/spec/tasks/gitlab/artifacts/migrate_rake_spec.rb @@ -2,7 +2,7 @@ require 'rake_helper' describe 'gitlab:artifacts namespace rake task' do before(:context) do - Rake.application.rake_require 'tasks/gitlab/artifacts' + Rake.application.rake_require 'tasks/gitlab/artifacts/migrate' end let(:object_storage_enabled) { false } |