@ckeditor/ckeditor5-dev-ci 37.0.1 → 38.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -34,11 +34,10 @@ module.exports = async function notifyTravisStatus( options ) {
34
34
  notifyCommitUrl: options.notifyCommitUrl,
35
35
  repositorySlug: options.repositorySlug
36
36
  } );
37
- const commitDetails = await getCommitDetails( commitUrl, options.githubToken );
37
+ const { githubAccount, commitAuthor, commitMessage } = await getCommitDetails( commitUrl, options.githubToken );
38
38
 
39
39
  const [ buildRepoOwner, buildRepoName ] = options.repositorySlug.split( '/' );
40
-
41
- const slackAccount = members[ commitDetails.author ];
40
+ const slackAccount = members[ githubAccount ] || null;
42
41
  const shortCommit = commitUrl.split( '/' ).pop().substring( 0, 7 );
43
42
  const repoMatch = commitUrl.match( REPOSITORY_REGEXP );
44
43
 
@@ -46,7 +45,8 @@ module.exports = async function notifyTravisStatus( options ) {
46
45
  username: 'Travis CI',
47
46
  text: getNotifierMessage( {
48
47
  slackAccount,
49
- githubAccount: commitDetails.author,
48
+ githubAccount,
49
+ commitAuthor,
50
50
  shouldHideAuthor: options.shouldHideAuthor
51
51
  } ),
52
52
  icon_url: 'https://a.slack-edge.com/66f9/img/services/travis_36.png',
@@ -80,7 +80,7 @@ module.exports = async function notifyTravisStatus( options ) {
80
80
  },
81
81
  {
82
82
  title: 'Commit message',
83
- value: getFormattedMessage( commitDetails.message, repoMatch[ 1 ], repoMatch[ 2 ] ),
83
+ value: getFormattedMessage( commitMessage, repoMatch[ 1 ], repoMatch[ 2 ] ),
84
84
  short: false
85
85
  }
86
86
  ]
@@ -189,8 +189,9 @@ function getCommitDetails( commitUrl, githubToken ) {
189
189
  return fetch( apiGithubUrlCommit, options )
190
190
  .then( response => response.json() )
191
191
  .then( json => ( {
192
- author: json.author.login,
193
- message: json.commit.message
192
+ githubAccount: json.author ? json.author.login : null,
193
+ commitAuthor: json.commit.author.name,
194
+ commitMessage: json.commit.message
194
195
  } ) );
195
196
  }
196
197
 
@@ -199,8 +200,9 @@ function getCommitDetails( commitUrl, githubToken ) {
199
200
  *
200
201
  * @param {Object} options
201
202
  * @param {Boolean} options.shouldHideAuthor
202
- * @param {String} options.slackAccount
203
- * @param {String} options.githubAccount
203
+ * @param {String|null} options.slackAccount
204
+ * @param {String|null} options.githubAccount
205
+ * @param {String} options.commitAuthor
204
206
  * @returns {String}
205
207
  */
206
208
  function getNotifierMessage( options ) {
@@ -208,8 +210,9 @@ function getNotifierMessage( options ) {
208
210
  return '_The author of the commit was hidden. <https://github.com/ckeditor/ckeditor5/issues/9252|Read more about why.>_';
209
211
  }
210
212
 
213
+ // If the author of the commit could not be obtained, let's ping the entire team.
211
214
  if ( !options.slackAccount ) {
212
- return '_The author of the commit could not be obtained._';
215
+ return `@channel (${ options.commitAuthor }), could you take a look?`;
213
216
  }
214
217
 
215
218
  // Slack and GitHub names for bots are equal.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-dev-ci",
3
- "version": "37.0.1",
3
+ "version": "38.0.0",
4
4
  "description": "Utils for CKEditor5 CI builds.",
5
5
  "keywords": [],
6
6
  "dependencies": {