This repository has been archived by the owner on Jun 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from atomiix/related_ticket
Make relatedTicket mandatory in the PR's description
- Loading branch information
Showing
13 changed files
with
198 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
<!-- PR_TABLE_DESCRIPTION_ERROR --> | ||
Hi! | ||
Hi, thanks for this contribution! | ||
|
||
Your pull request description seems to be incomplete or malformed: | ||
|
||
{% for error in errors %} | ||
* {{ error.message }} | ||
{% endfor %} | ||
|
||
Would you mind completing the contribution table ? This would help us understand how interesting your contribution is. | ||
Would you mind completing it? This would help us understand how interesting your contribution is, thank you very much! | ||
|
||
Thank you! | ||
{% if missingRelatedTicket %} | ||
Note: it is a good practice to open an issue before submitting a Pull Request as it allows maintainers to verify that the bug is effectively due to a defect in the code (and that it hasn't already been fixed) and to discuss the improvement/feature suggestion before a single line of code is written. Additionally, it may lead the Core Product team to mark that issue as a priority, further attracting the maintainer's attention. | ||
{% endif %} | ||
|
||
(note: this is an automated message, but answering it will reach a real human ) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
namespace Tests\AppBundle\PullRequests; | ||
|
||
use AppBundle\PullRequests\BodyParser; | ||
use PHPUnit\Framework\TestCase; | ||
use Symfony\Component\Validator\ValidatorBuilder; | ||
|
||
class ListenerTest extends TestCase | ||
{ | ||
private $validator; | ||
|
||
public function setUp() | ||
{ | ||
$this->validator = (new ValidatorBuilder()) | ||
->enableAnnotationMapping() | ||
->getValidator(); | ||
} | ||
|
||
/** | ||
* @dataProvider getTests | ||
* | ||
* @param $descriptionFilename | ||
* @param $expected | ||
*/ | ||
public function testDescriptions($descriptionFilename, $expected) | ||
{ | ||
$body = file_get_contents(__DIR__.'/../../Resources/PullRequestBody/'.$descriptionFilename); | ||
$bodyParser = new BodyParser($body); | ||
|
||
$validations = $this->validator->validate($bodyParser); | ||
$this->assertSame(\count($expected), \count($validations)); | ||
foreach ($validations as $validation) { | ||
$this->assertContains($validation->getPropertyPath(), $expected); | ||
} | ||
} | ||
|
||
public function getTests() | ||
{ | ||
return [ | ||
'Valid description' => [ | ||
'bug_fix.txt', | ||
[], | ||
], | ||
'Missing description' => [ | ||
'missing_description.txt', | ||
['description'], | ||
], | ||
'Invalid type' => [ | ||
'invalid_type.txt', | ||
['type'], | ||
], | ||
'Invalid category' => [ | ||
'invalid_category.txt', | ||
['category'], | ||
], | ||
'No related ticked' => [ | ||
'no_related_ticket.txt', | ||
['relatedTicket'], | ||
], | ||
]; | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- Thank you for contributing to the PrestaShop project! | ||
|
||
Please take the time to edit the "Answers" rows with the necessary information:--> | ||
|
||
| Questions | Answers | ||
| ------------- | ------------------------------------------------------- | ||
| Branch? | develop | ||
| Description? | Such a great description | ||
| Type? | bug fix | ||
| Category? | AZ | ||
| BC breaks? | no | ||
| Deprecations? | yes | ||
| Fixed ticket? | #1234 | ||
| How to test? | To test it, launch unit tests | ||
|
||
<!-- Click the form's "Preview button" to make sure the table is functional in GitHub. Thank you! --> | ||
|
||
#### Important guidelines | ||
|
||
* Make sure [your local branch is up to date](https://help.github.com/articles/syncing-a-fork/) before commiting your changes! | ||
* Your code MUST respect [our Coding Standards](http://doc.prestashop.com/display/PS16/Coding+Standards) (for code written in PHP, JavaScript, HTML/CSS/Smarty/Twig, SQL)! | ||
* Your commit name MUST respect our [naming convention](http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message)! | ||
|
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,23 @@ | ||
<!-- Thank you for contributing to the PrestaShop project! | ||
|
||
Please take the time to edit the "Answers" rows with the necessary information:--> | ||
|
||
| Questions | Answers | ||
| ------------- | ------------------------------------------------------- | ||
| Branch? | develop | ||
| Description? | Such a great description | ||
| Type? | | ||
| Category? | BO | ||
| BC breaks? | no | ||
| Deprecations? | yes | ||
| Fixed ticket? | #1234 | ||
| How to test? | To test it, launch unit tests | ||
|
||
<!-- Click the form's "Preview button" to make sure the table is functional in GitHub. Thank you! --> | ||
|
||
#### Important guidelines | ||
|
||
* Make sure [your local branch is up to date](https://help.github.com/articles/syncing-a-fork/) before commiting your changes! | ||
* Your code MUST respect [our Coding Standards](http://doc.prestashop.com/display/PS16/Coding+Standards) (for code written in PHP, JavaScript, HTML/CSS/Smarty/Twig, SQL)! | ||
* Your commit name MUST respect our [naming convention](http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message)! | ||
|
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,23 @@ | ||
<!-- Thank you for contributing to the PrestaShop project! | ||
|
||
Please take the time to edit the "Answers" rows with the necessary information:--> | ||
|
||
| Questions | Answers | ||
| ------------- | ------------------------------------------------------- | ||
| Branch? | develop | ||
| Description? | | ||
| Type? | bug fix | ||
| Category? | BO | ||
| BC breaks? | no | ||
| Deprecations? | yes | ||
| Fixed ticket? | #1234 | ||
| How to test? | To test it, launch unit tests | ||
|
||
<!-- Click the form's "Preview button" to make sure the table is functional in GitHub. Thank you! --> | ||
|
||
#### Important guidelines | ||
|
||
* Make sure [your local branch is up to date](https://help.github.com/articles/syncing-a-fork/) before commiting your changes! | ||
* Your code MUST respect [our Coding Standards](http://doc.prestashop.com/display/PS16/Coding+Standards) (for code written in PHP, JavaScript, HTML/CSS/Smarty/Twig, SQL)! | ||
* Your commit name MUST respect our [naming convention](http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message)! | ||
|
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,23 @@ | ||
<!-- Thank you for contributing to the PrestaShop project! | ||
|
||
Please take the time to edit the "Answers" rows with the necessary information:--> | ||
|
||
| Questions | Answers | ||
| ------------- | ------------------------------------------------------- | ||
| Branch? | develop | ||
| Description? | Such a great description | ||
| Type? | bug fix | ||
| Category? | BO | ||
| BC breaks? | no | ||
| Deprecations? | yes | ||
| Fixed ticket? | | ||
| How to test? | To test it, launch unit tests | ||
|
||
<!-- Click the form's "Preview button" to make sure the table is functional in GitHub. Thank you! --> | ||
|
||
#### Important guidelines | ||
|
||
* Make sure [your local branch is up to date](https://help.github.com/articles/syncing-a-fork/) before commiting your changes! | ||
* Your code MUST respect [our Coding Standards](http://doc.prestashop.com/display/PS16/Coding+Standards) (for code written in PHP, JavaScript, HTML/CSS/Smarty/Twig, SQL)! | ||
* Your commit name MUST respect our [naming convention](http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message)! | ||
|
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