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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
7fc74818
Commit
7fc74818
authored
Oct 01, 2018
by
Shinya Maeda
Committed by
Alessio Caiazza
Oct 02, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scheduled_actions as an explicit group of actions
parent
384da927
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
7 additions
and
1 deletion
+7
-1
app/models/ci/build.rb
app/models/ci/build.rb
+2
-1
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-0
app/serializers/build_action_entity.rb
app/serializers/build_action_entity.rb
+1
-0
app/serializers/job_entity.rb
app/serializers/job_entity.rb
+1
-0
app/serializers/pipeline_details_entity.rb
app/serializers/pipeline_details_entity.rb
+1
-0
app/serializers/pipeline_serializer.rb
app/serializers/pipeline_serializer.rb
+1
-0
No files found.
app/models/ci/build.rb
View file @
7fc74818
...
@@ -92,7 +92,8 @@ module Ci
...
@@ -92,7 +92,8 @@ module Ci
scope
:with_artifacts_not_expired
,
->
()
{
with_artifacts_archive
.
where
(
'artifacts_expire_at IS NULL OR artifacts_expire_at > ?'
,
Time
.
now
)
}
scope
:with_artifacts_not_expired
,
->
()
{
with_artifacts_archive
.
where
(
'artifacts_expire_at IS NULL OR artifacts_expire_at > ?'
,
Time
.
now
)
}
scope
:with_expired_artifacts
,
->
()
{
with_artifacts_archive
.
where
(
'artifacts_expire_at < ?'
,
Time
.
now
)
}
scope
:with_expired_artifacts
,
->
()
{
with_artifacts_archive
.
where
(
'artifacts_expire_at < ?'
,
Time
.
now
)
}
scope
:last_month
,
->
()
{
where
(
'created_at > ?'
,
Date
.
today
-
1
.
month
)
}
scope
:last_month
,
->
()
{
where
(
'created_at > ?'
,
Date
.
today
-
1
.
month
)
}
scope
:manual_actions
,
->
()
{
where
(
when:
%i[manual delayed]
,
status:
COMPLETED_STATUSES
+
%i[manual scheduled]
)
}
scope
:manual_actions
,
->
()
{
where
(
when: :manual
,
status:
COMPLETED_STATUSES
+
%i[manual]
)
}
scope
:scheduled_actions
,
->
()
{
where
(
when: :delayed
,
status:
COMPLETED_STATUSES
+
%i[scheduled]
)
}
scope
:ref_protected
,
->
{
where
(
protected:
true
)
}
scope
:ref_protected
,
->
{
where
(
protected:
true
)
}
scope
:with_live_trace
,
->
{
where
(
'EXISTS (?)'
,
Ci
::
BuildTraceChunk
.
where
(
'ci_builds.id = ci_build_trace_chunks.build_id'
).
select
(
1
))
}
scope
:with_live_trace
,
->
{
where
(
'EXISTS (?)'
,
Ci
::
BuildTraceChunk
.
where
(
'ci_builds.id = ci_build_trace_chunks.build_id'
).
select
(
1
))
}
...
...
app/models/ci/pipeline.rb
View file @
7fc74818
...
@@ -35,6 +35,7 @@ module Ci
...
@@ -35,6 +35,7 @@ module Ci
has_many
:retryable_builds
,
->
{
latest
.
failed_or_canceled
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:retryable_builds
,
->
{
latest
.
failed_or_canceled
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:cancelable_statuses
,
->
{
cancelable
},
foreign_key: :commit_id
,
class_name:
'CommitStatus'
has_many
:cancelable_statuses
,
->
{
cancelable
},
foreign_key: :commit_id
,
class_name:
'CommitStatus'
has_many
:manual_actions
,
->
{
latest
.
manual_actions
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:manual_actions
,
->
{
latest
.
manual_actions
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:scheduled_actions
,
->
{
latest
.
scheduled_actions
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:artifacts
,
->
{
latest
.
with_artifacts_not_expired
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:artifacts
,
->
{
latest
.
with_artifacts_not_expired
.
includes
(
:project
)
},
foreign_key: :commit_id
,
class_name:
'Ci::Build'
has_many
:auto_canceled_pipelines
,
class_name:
'Ci::Pipeline'
,
foreign_key:
'auto_canceled_by_id'
has_many
:auto_canceled_pipelines
,
class_name:
'Ci::Pipeline'
,
foreign_key:
'auto_canceled_by_id'
...
...
app/serializers/build_action_entity.rb
View file @
7fc74818
...
@@ -12,6 +12,7 @@ class BuildActionEntity < Grape::Entity
...
@@ -12,6 +12,7 @@ class BuildActionEntity < Grape::Entity
end
end
expose
:playable?
,
as: :playable
expose
:playable?
,
as: :playable
expose
:scheduled_at
private
private
...
...
app/serializers/job_entity.rb
View file @
7fc74818
...
@@ -25,6 +25,7 @@ class JobEntity < Grape::Entity
...
@@ -25,6 +25,7 @@ class JobEntity < Grape::Entity
end
end
expose
:playable?
,
as: :playable
expose
:playable?
,
as: :playable
expose
:scheduled_at
expose
:created_at
expose
:created_at
expose
:updated_at
expose
:updated_at
expose
:detailed_status
,
as: :status
,
with:
DetailedStatusEntity
expose
:detailed_status
,
as: :status
,
with:
DetailedStatusEntity
...
...
app/serializers/pipeline_details_entity.rb
View file @
7fc74818
...
@@ -5,5 +5,6 @@ class PipelineDetailsEntity < PipelineEntity
...
@@ -5,5 +5,6 @@ class PipelineDetailsEntity < PipelineEntity
expose
:ordered_stages
,
as: :stages
,
using:
StageEntity
expose
:ordered_stages
,
as: :stages
,
using:
StageEntity
expose
:artifacts
,
using:
BuildArtifactEntity
expose
:artifacts
,
using:
BuildArtifactEntity
expose
:manual_actions
,
using:
BuildActionEntity
expose
:manual_actions
,
using:
BuildActionEntity
expose
:scheduled_actions
,
using:
BuildActionEntity
end
end
end
end
app/serializers/pipeline_serializer.rb
View file @
7fc74818
...
@@ -13,6 +13,7 @@ class PipelineSerializer < BaseSerializer
...
@@ -13,6 +13,7 @@ class PipelineSerializer < BaseSerializer
:cancelable_statuses
,
:cancelable_statuses
,
:trigger_requests
,
:trigger_requests
,
:manual_actions
,
:manual_actions
,
:scheduled_actions
,
:artifacts
,
:artifacts
,
{
{
pending_builds: :project
,
pending_builds: :project
,
...
...
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