Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
xiphon
CCS Backend
Commits
cf1f9603
Commit
cf1f9603
authored
Dec 31, 2018
by
beardedwarrior
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
included states in to pulling mrs and front matter
parent
ea25ce73
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
app/Console/Commands/FetchMergeRequests.php
app/Console/Commands/FetchMergeRequests.php
+12
-1
app/Console/Commands/ProcessProposals.php
app/Console/Commands/ProcessProposals.php
+4
-2
No files found.
app/Console/Commands/FetchMergeRequests.php
View file @
cf1f9603
...
...
@@ -42,12 +42,17 @@ class fetchMergeRequests extends Command
$projects
=
$connection
->
mergeRequests
(
'all'
);
foreach
(
$projects
as
$project
)
{
$state
=
'OPENED'
;
if
(
strpos
(
$project
->
title
,
'[IDEA]'
)
!==
false
)
{
$state
=
'IDEA'
;
}
$title
=
str_replace
(
'[IDEA]'
,
''
,
$project
->
title
);
// create requests that are still pending
$project
=
Project
::
firstOrNew
([
'merge_request_id'
=>
$project
->
id
,
],[
'title'
=>
$title
,
'state'
=>
$state
,
'title'
=>
trim
(
$title
),
'gitlab_state'
=>
$project
->
state
,
'gitlab_username'
=>
$project
->
author
->
username
,
'gitlab_url'
=>
$project
->
web_url
,
...
...
@@ -55,4 +60,10 @@ class fetchMergeRequests extends Command
$project
->
save
();
}
}
// fetch the idea
// check for merged merges.
// if proposal merged search for its md file
//issue payment_id and payment page
//
}
app/Console/Commands/ProcessProposals.php
View file @
cf1f9603
...
...
@@ -37,7 +37,6 @@ class ProcessProposals extends Command
*/
public
function
handle
()
{
$projects
=
Project
::
whereNull
(
'filename'
);
$details
=
[];
$files
=
Storage
::
files
(
'ffs-proposals'
);
foreach
(
$files
as
$file
)
{
...
...
@@ -45,9 +44,12 @@ class ProcessProposals extends Command
$detail
[
'name'
]
=
$file
;
$detail
[
'values'
]
=
$this
->
getAmountFromText
(
$file
);
$details
[]
=
$detail
[
'values'
][
'title'
];
$project
=
$p
roject
s
->
where
(
'title'
,
$detail
[
'values'
][
'title'
])
->
first
();
$project
=
P
roject
::
where
(
'title'
,
$detail
[
'values'
][
'title'
])
->
first
();
if
(
$project
)
{
$project
->
filename
=
$file
;
if
(
$project
->
state
===
'IDEA'
)
{
$project
->
state
=
'FUNDING-REQUIRED'
;
}
$project
->
target_amount
=
$detail
[
'values'
][
'amount'
];
$project
->
save
();
}
...
...
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