Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
226 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/main/resources/com/zerocracy/stk/pm/in/orders/close_issue.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Copyright (c) 2016-2018 Zerocracy | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to read | ||
* the Software only. Permissions is hereby NOT GRANTED to use, copy, modify, | ||
* merge, publish, distribute, sublicense, and/or sell copies of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package com.zerocracy.stk.pm.in.orders | ||
|
||
import com.jcabi.xml.XML | ||
import com.zerocracy.farm.Assume | ||
import com.zerocracy.jstk.Project | ||
import com.zerocracy.pm.ClaimIn | ||
import com.zerocracy.pm.staff.Roles | ||
import java.security.SecureRandom | ||
|
||
def exec(Project project, XML xml) { | ||
new Assume(project, xml).notPmo() | ||
new Assume(project, xml).type('Close issue') | ||
def claim = new ClaimIn(xml) | ||
def qa = new Roles(project).bootstrap().findByRole('QA') | ||
if (qa.empty) { | ||
claim.copy() | ||
.type('Finish order') | ||
.param('reason', 'GitHub issue was closed, order is finished.') | ||
.postTo(project) | ||
} else { | ||
claim.copy() | ||
.type('Assign QA') | ||
.param('assignee', qa.size() > 1 ? qa[new SecureRandom().nextInt(qa.size() - 1)] : qa.first()) | ||
.postTo(project) | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/main/resources/com/zerocracy/stk/pm/qa/assign_qa.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Copyright (c) 2016-2018 Zerocracy | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to read | ||
* the Software only. Permissions is hereby NOT GRANTED to use, copy, modify, | ||
* merge, publish, distribute, sublicense, and/or sell copies of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package com.zerocracy.stk.pm.qa | ||
|
||
import com.jcabi.xml.XML | ||
import com.zerocracy.Par | ||
import com.zerocracy.farm.Assume | ||
import com.zerocracy.jstk.Project | ||
import com.zerocracy.pm.ClaimIn | ||
import com.zerocracy.pm.scope.Wbs | ||
|
||
def exec(Project project, XML xml) { | ||
new Assume(project, xml).notPmo() | ||
new Assume(project, xml).type('Assign QA') | ||
def claim = new ClaimIn(xml) | ||
def job = claim.param('job') | ||
new Wbs(project).bootstrap().add(job) | ||
claim.reply( | ||
new Par('@%s please review this job as in §30.') | ||
.say(claim.param('assignee')) | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/test/resources/com/zerocracy/bundles/assign_qa_user/_after.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Copyright (c) 2016-2018 Zerocracy | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to read | ||
* the Software only. Permissions is hereby NOT GRANTED to use, copy, modify, | ||
* merge, publish, distribute, sublicense, and/or sell copies of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package com.zerocracy.bundles.assign_qa_user | ||
|
||
import com.jcabi.xml.XML | ||
import com.zerocracy.jstk.Project | ||
import com.zerocracy.pm.scope.Wbs | ||
import org.hamcrest.MatcherAssert | ||
import org.hamcrest.Matchers | ||
|
||
def exec(Project project, XML xml) { | ||
MatcherAssert.assertThat( | ||
new Wbs(project).bootstrap().role('gh:test/test#1'), | ||
Matchers.equalTo('DEV') | ||
) | ||
} |
32 changes: 32 additions & 0 deletions
32
src/test/resources/com/zerocracy/bundles/assign_qa_user/_before.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* Copyright (c) 2016-2018 Zerocracy | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to read | ||
* the Software only. Permissions is hereby NOT GRANTED to use, copy, modify, | ||
* merge, publish, distribute, sublicense, and/or sell copies of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
package com.zerocracy.bundles.assign_qa_user | ||
|
||
import com.jcabi.github.Github | ||
import com.jcabi.github.Issue | ||
import com.jcabi.github.Repos | ||
import com.jcabi.xml.XML | ||
import com.zerocracy.entry.ExtGithub | ||
import com.zerocracy.jstk.Farm | ||
import com.zerocracy.jstk.Project | ||
|
||
def exec(Project project, XML xml) { | ||
Farm farm = binding.variables.farm | ||
Github github = new ExtGithub(farm).value() | ||
def repo = github.repos().create(new Repos.RepoCreate('test', false)) | ||
new Issue.Smart(repo.issues().create('Hello, world', '')) | ||
} |
29 changes: 29 additions & 0 deletions
29
src/test/resources/com/zerocracy/bundles/assign_qa_user/claims.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2016-2018 Zerocracy | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to read | ||
the Software only. Permissions is hereby NOT GRANTED to use, copy, modify, | ||
merge, publish, distribute, sublicense, and/or sell copies of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
--> | ||
<claims xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/zerocracy/datum/0.37/xsd/pm/claims.xsd" version="0.1" updated="2017-03-27T11:18:09.228Z"> | ||
<claim id="3"> | ||
<created>2017-03-27T11:18:09.228Z</created> | ||
<type>Close issue</type> | ||
<author>yegor256</author> | ||
<token>test;C123;yegor256</token> | ||
<params> | ||
<param name="login">yegor256</param> | ||
<param name="job">gh:test/test#1</param> | ||
</params> | ||
</claim> | ||
</claims> |
25 changes: 25 additions & 0 deletions
25
src/test/resources/com/zerocracy/bundles/assign_qa_user/people.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2016-2018 Zerocracy | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to read | ||
the Software only. Permissions is hereby NOT GRANTED to use, copy, modify, | ||
merge, publish, distribute, sublicense, and/or sell copies of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
--> | ||
<people xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/zerocracy/datum/0.37/xsd/pmo/people.xsd" version="1" updated="2016-12-29T09:03:21.684Z"> | ||
<person id="test"> | ||
<mentor>yegor256</mentor> | ||
</person> | ||
<person id="yegor256"> | ||
<mentor>yegor256</mentor> | ||
</person> | ||
</people> |
25 changes: 25 additions & 0 deletions
25
src/test/resources/com/zerocracy/bundles/assign_qa_user/roles.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2016-2018 Zerocracy | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to read | ||
the Software only. Permissions is hereby NOT GRANTED to use, copy, modify, | ||
merge, publish, distribute, sublicense, and/or sell copies of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
--> | ||
<roles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/zerocracy/datum/0.37/xsd/pm/staff/roles.xsd" version="0.1" updated="2017-03-27T11:18:09.228Z"> | ||
<person id="yegor256"> | ||
<role>ARC</role> | ||
</person> | ||
<person id="test"> | ||
<role>QA</role> | ||
</person> | ||
</roles> |
c0bf614
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Puzzle
73-6d39317c
discovered insrc/main/resources/com/zerocracy/radars/q-tracker.xml
and submitted as #408. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, butwe discovered it only now.