Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
GitLab FOSS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
GitLab FOSS
Commits
7327fb4a
Verified
Commit
7327fb4a
authored
6 years ago
by
Grzegorz Bizon
Committed by
Yorick Peterse
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Present all pipeline triggers using trigger presenter
parent
084b7edb
No related branches found
No related tags found
1 merge request
!24018
Fix `import_github_repo_spec.rb`
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
app/controllers/projects/settings/ci_cd_controller.rb
+2
-0
2 additions, 0 deletions
app/controllers/projects/settings/ci_cd_controller.rb
app/models/ci/trigger.rb
+1
-1
1 addition, 1 deletion
app/models/ci/trigger.rb
lib/api/triggers.rb
+3
-3
3 additions, 3 deletions
lib/api/triggers.rb
with
6 additions
and
4 deletions
app/controllers/projects/settings/ci_cd_controller.rb
+
2
−
0
View file @
7327fb4a
...
...
@@ -99,7 +99,9 @@ def define_ci_variables
def
define_triggers_variables
@triggers
=
@project
.
triggers
.
present
(
current_user:
current_user
)
@trigger
=
::
Ci
::
Trigger
.
new
.
present
(
current_user:
current_user
)
end
def
define_badges_variables
...
...
This diff is collapsed.
Click to expand it.
app/models/ci/trigger.rb
+
1
−
1
View file @
7327fb4a
...
...
@@ -30,7 +30,7 @@ def last_used
end
def
short_token
token
[
0
...
4
]
token
[
0
...
4
]
if
token
.
present?
end
def
legacy?
...
...
This diff is collapsed.
Click to expand it.
lib/api/triggers.rb
+
3
−
3
View file @
7327fb4a
...
...
@@ -85,7 +85,7 @@ class Triggers < Grape::API
declared_params
(
include_missing:
false
).
merge
(
owner:
current_user
))
if
trigger
.
valid?
present
trigger
,
with:
Entities
::
Trigger
present
trigger
,
with:
Entities
::
Trigger
,
current_user:
current_user
else
render_validation_error!
(
trigger
)
end
...
...
@@ -106,7 +106,7 @@ class Triggers < Grape::API
break
not_found!
(
'Trigger'
)
unless
trigger
if
trigger
.
update
(
declared_params
(
include_missing:
false
))
present
trigger
,
with:
Entities
::
Trigger
present
trigger
,
with:
Entities
::
Trigger
,
current_user:
current_user
else
render_validation_error!
(
trigger
)
end
...
...
@@ -127,7 +127,7 @@ class Triggers < Grape::API
if
trigger
.
update
(
owner:
current_user
)
status
:ok
present
trigger
,
with:
Entities
::
Trigger
present
trigger
,
with:
Entities
::
Trigger
,
current_user:
current_user
else
render_validation_error!
(
trigger
)
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment