Commit 47b49f8f authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 04be2066 6b2f81f6
...@@ -86,7 +86,7 @@ class Projects::ArtifactsController < Projects::ApplicationController ...@@ -86,7 +86,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
end end
def build_from_id def build_from_id
project.get_build(params[:job_id]) if params[:job_id] project.builds.find_by_id(params[:job_id]) if params[:job_id]
end end
def build_from_ref def build_from_ref
......
...@@ -45,7 +45,7 @@ class Projects::BuildArtifactsController < Projects::ApplicationController ...@@ -45,7 +45,7 @@ class Projects::BuildArtifactsController < Projects::ApplicationController
end end
def job_from_id def job_from_id
project.get_build(params[:build_id]) if params[:build_id] project.builds.find_by_id(params[:build_id]) if params[:build_id]
end end
def job_from_ref def job_from_ref
......
...@@ -658,10 +658,6 @@ class Project < ActiveRecord::Base ...@@ -658,10 +658,6 @@ class Project < ActiveRecord::Base
latest_successful_build_for(job_name, ref) || raise(ActiveRecord::RecordNotFound.new("Couldn't find job #{job_name}")) latest_successful_build_for(job_name, ref) || raise(ActiveRecord::RecordNotFound.new("Couldn't find job #{job_name}"))
end end
def get_build(id)
builds.find_by(id: id)
end
def merge_base_commit(first_commit_id, second_commit_id) def merge_base_commit(first_commit_id, second_commit_id)
sha = repository.merge_base(first_commit_id, second_commit_id) sha = repository.merge_base(first_commit_id, second_commit_id)
commit_by(oid: sha) if sha commit_by(oid: sha) if sha
......
...@@ -103,7 +103,7 @@ In order to deploy functions to your Knative instance, the following files must ...@@ -103,7 +103,7 @@ In order to deploy functions to your Knative instance, the following files must
The `gitlab-ci.yml` template creates a `Deploy` stage with a `functions` job that invokes the `tm` CLI with the required parameters. The `gitlab-ci.yml` template creates a `Deploy` stage with a `functions` job that invokes the `tm` CLI with the required parameters.
2. `serverless.yml`: This file contains the metadata for your functions, 2. `serverless.yml`: This file contains the metadata for your functions,
such as name, runtime, and environment. It must be included at the root of your repository. The following is a sample `echo` function which shows the required structure for the file. such as name, runtime, and environment. It must be included at the root of your repository. The following is a sample `echo` function which shows the required structure for the file. You can find the relevant files for this project in the [functions example project](https://gitlab.com/knative-examples/functions).
```yaml ```yaml
service: my-functions service: my-functions
...@@ -127,7 +127,7 @@ In order to deploy functions to your Knative instance, the following files must ...@@ -127,7 +127,7 @@ In order to deploy functions to your Knative instance, the following files must
``` ```
The `serverless.yml` file contains three sections with distinct parameters: The `serverless.yml` file is referencing both an `echo` directory (under `buildargs`) and an `echo` file (under `handler`) which is a reference to `echo.js` in the [repository](https://gitlab.com/knative-examples/functions). Additionally, it contains three sections with distinct parameters:
### `service` ### `service`
......
...@@ -2184,29 +2184,6 @@ describe Project do ...@@ -2184,29 +2184,6 @@ describe Project do
end end
end end
describe '#get_build' do
let(:project) { create(:project, :repository) }
let(:ci_pipeline) { create(:ci_pipeline, project: project) }
context 'when build exists' do
context 'build is associated with project' do
let(:build) { create(:ci_build, :success, pipeline: ci_pipeline) }
it { expect(project.get_build(build.id)).to eq(build) }
end
context 'build is not associated with project' do
let(:build) { create(:ci_build, :success) }
it { expect(project.get_build(build.id)).to be_nil }
end
end
context 'build does not exists' do
it { expect(project.get_build(rand 100)).to be_nil }
end
end
describe '#import_status' do describe '#import_status' do
context 'with import_state' do context 'with import_state' do
it 'returns the right status' do it 'returns the right status' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment