Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c1212bea
Commit
c1212bea
authored
Oct 19, 2016
by
Z.J. van de Weg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use deployment IID when saving refs
parent
ba2d5b16
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/models/deployment.rb
app/models/deployment.rb
+1
-1
app/models/environment.rb
app/models/environment.rb
+2
-2
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+1
-1
No files found.
app/models/deployment.rb
View file @
c1212bea
...
...
@@ -102,6 +102,6 @@ class Deployment < ActiveRecord::Base
private
def
ref_path
File
.
join
(
environment
.
ref_path
,
'deployments'
,
id
.
to_s
)
File
.
join
(
environment
.
ref_path
,
'deployments'
,
i
i
d
.
to_s
)
end
end
app/models/environment.rb
View file @
c1212bea
...
...
@@ -71,8 +71,8 @@ class Environment < ActiveRecord::Base
return
nil
unless
ref
deployment_id
=
ref
.
split
(
'/'
).
last
deployments
.
find
(
deployment_
id
)
deployment_i
i
d
=
ref
.
split
(
'/'
).
last
deployments
.
find
_by
(
iid:
deployment_i
id
)
end
def
ref_path
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
c1212bea
...
...
@@ -913,7 +913,7 @@ describe Projects::MergeRequestsController do
end
describe
'GET ci_environments_status'
do
context
'
when
the environment is from a forked project'
do
context
'the environment is from a forked project'
do
let!
(
:forked
)
{
create
(
:project
)
}
let!
(
:environment
)
{
create
(
:environment
,
project:
forked
)
}
let!
(
:deployment
)
{
create
(
:deployment
,
environment:
environment
,
sha:
forked
.
commit
.
id
,
ref:
'master'
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment