-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(911): Add method to get changed files. BREAKING CHANGE: requires…
… getChangedFiles
- Loading branch information
Showing
6 changed files
with
129 additions
and
76 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,51 +1,3 @@ | ||
# Contributing | ||
# Contributing to Screwdriver | ||
|
||
Thank you for considering contributing! There are many ways you can help. | ||
|
||
## Issues | ||
|
||
File an issue if you think you've found a bug. Be sure to describe | ||
|
||
1. How can it be reproduced? | ||
2. What did you expect? | ||
3. What actually occurred? | ||
4. Version, platform, etc. if possibly relevant. | ||
|
||
## Docs | ||
|
||
Documentation, READMEs, and examples are extremely important. Please help improve them and if you find a typo or notice a problem, please send a fix or say something. | ||
|
||
## Submitting Patches | ||
|
||
Patches for fixes, features, and improvements are accepted through pull requests. | ||
|
||
* Write good commit messages, in the present tense! (Add X, not Added X). Short title, blank line, bullet points if needed. Capitalize the first letter of the title or bullet item. No punctuation in the title. | ||
* Code must pass lint and style checks. | ||
* All external methods must be documented. | ||
* Include tests to improve coverage and prevent regressions. | ||
* Squash changes into a single commit per feature/fix. Ask if you're unsure how to discretize your work. | ||
|
||
Please ask before embarking on a large improvement so you're not disappointed if it does not align with the goals of the project or owner(s). | ||
|
||
## Commit message format | ||
|
||
We use [semantic-release](https://www.npmjs.com/package/semantic-release), which requires commit messages to be in this specific format: `<type>(<scope>): <subject>` | ||
|
||
* Types: | ||
* feat (feature) | ||
* fix (bug fix) | ||
* docs (documentation) | ||
* style (formatting, missing semi colons, …) | ||
* refactor | ||
* test (when adding missing tests) | ||
* chore (maintain) | ||
* Scope: anything that specifies the scope of the commit. Can be blank or `*` | ||
* Subject: description of the commit. For **breaking changes** that require major version bump, add `BREAKING CHANGE` to the commit message. | ||
|
||
**Examples commit messages:** | ||
* Bug fix: `fix: Remove extra space` | ||
* Breaking change: `feat: Add addWebhook method. BREAKING CHANGE: scm plugin need to implement addWebhook method now` | ||
|
||
## Feature Requests | ||
|
||
Make the case for a feature via an issue with a good title. The feature should be discussed and given a target inclusion milestone or closed. | ||
Have a look at our guidelines, as well as pointers on where to start making changes, in our official [documentation](http://docs.screwdriver.cd/about/contributing). |
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 |
---|---|---|
|
@@ -64,23 +64,45 @@ Required parameters: | |
A key-map of data related to the received payload in the form of: | ||
```js | ||
{ | ||
type: 'pr', // can be 'pr' or 'repo' | ||
hookId: '81e6bd80-9a2c-11e6-939d-beaa5d9adaf3', // webhook event uuid | ||
action: 'opened', // can be 'opened', 'reopened', 'closed', or 'synchronized' for type 'pr'; 'push' for type 'repo' | ||
username: 'robin', // should be the actor/creator of the webhook event (not necessarily the author) | ||
checkoutUrl: 'https://[email protected]/batman/test.git', | ||
branch: 'mynewbranch', | ||
sha: '9ff49b2d1437567cad2b5fed7a0706472131e927', | ||
checkoutUrl: 'https://[email protected]/batman/test.git', | ||
hookId: '81e6bd80-9a2c-11e6-939d-beaa5d9adaf3', // webhook event uuid | ||
lastCommitMessage: 'This is the last commit message', // get a message of the last one from commits object | ||
prNum: 3, | ||
prRef: 'pull/3/merge' | ||
prRef: 'pull/3/merge', | ||
prSource: 'fork', // If type is 'pr', prSource is 'fork' or 'branch' | ||
scmContext: 'github:github.com', | ||
sha: '9ff49b2d1437567cad2b5fed7a0706472131e927', | ||
type: 'pr', // can be 'pr' or 'repo' | ||
username: 'robin' // should be the actor/creator of the webhook event (not necessarily the author) | ||
} | ||
``` | ||
|
||
#### Expected Promise response | ||
1. Resolve with a parsed hook object | ||
2. Reject if not able to parse hook | ||
|
||
### getChangedFiles | ||
Required parameters: | ||
|
||
| Parameter | Type | Description | | ||
| :------------- | :---- | :-------------| | ||
| config | Object | Yes | Configuration Object | | ||
| config.type | String | The type of action from Git (can be 'pr' or 'repo') | | ||
| config.payload | Object | The webhook payload received from the SCM service | | ||
| config.token | String | Access token for scm | | ||
|
||
#### Expected Outcome | ||
An array of file paths that were changed: | ||
```js | ||
['README.md', 'folder/screwdriver.yaml'] // array of changed files | ||
``` | ||
|
||
#### Expected Promise response | ||
1. Resolve with an array of files | ||
2. Reject if not able to parse hook | ||
|
||
### getCheckoutCommand | ||
Required parameters: | ||
|
||
|
@@ -374,6 +396,7 @@ To make use of the validation functions, the functions to override are: | |
1. `_addWebhook` | ||
1. `_parseUrl` | ||
1. `_parseHook` | ||
1. `_getChangedFiles` | ||
1. `_getCheckoutCommand` | ||
1. `_decorateUrl` | ||
1. `_decorateCommit` | ||
|
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,13 @@ | ||
{ | ||
"action": "opened", | ||
"branch": "mynewbranch", | ||
"checkoutUrl": "https://[email protected]/batman/test.git", | ||
"hookId": "81e6bd80-9a2c-11e6-939d-beaa5d9adaf3", | ||
"lastCommitMessage": "This is the last commit message", | ||
"prRef": "pull/3/merge", | ||
"prSource": "fork", | ||
"scmContext": "github:github.com", | ||
"sha": "9ff49b2d1437567cad2b5fed7a0706472131e927", | ||
"type": "pr", | ||
"username": "robin" | ||
} |
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