@ckeditor/ckeditor5-dev-ci 38.1.0 → 38.1.2

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.
@@ -16,6 +16,11 @@ const slackNotify = require( 'slack-notify' );
16
16
  // Described environment variables starting with "CKE5" should be added by the integrator.
17
17
 
18
18
  const {
19
+ /**
20
+ * Required. Value of Circle's `pipeline.number` variable.
21
+ */
22
+ CKE5_PIPELINE_NUMBER,
23
+
19
24
  /**
20
25
  * Required. Token to a Github account with the scope: "repos". It is required for obtaining an author of
21
26
  * the commit if the build failed. The repository can be private and we can't use the public API.
@@ -48,10 +53,10 @@ const {
48
53
  // Variables that are available by default in Circle environment.
49
54
  CIRCLE_BRANCH,
50
55
  CIRCLE_BUILD_NUM,
51
- CIRCLE_BUILD_URL,
52
56
  CIRCLE_PROJECT_REPONAME,
53
57
  CIRCLE_PROJECT_USERNAME,
54
- CIRCLE_SHA1
58
+ CIRCLE_SHA1,
59
+ CIRCLE_WORKFLOW_ID
55
60
  } = process.env;
56
61
 
57
62
  notifyCircleStatus();
@@ -66,6 +71,14 @@ async function notifyCircleStatus() {
66
71
  }
67
72
 
68
73
  const jobData = await getJobData();
74
+ const buildUrl = [
75
+ 'https://app.circleci.com/pipelines/github',
76
+ CIRCLE_PROJECT_USERNAME,
77
+ CIRCLE_PROJECT_REPONAME,
78
+ CKE5_PIPELINE_NUMBER,
79
+ 'workflows',
80
+ CIRCLE_WORKFLOW_ID
81
+ ].join( '/' );
69
82
 
70
83
  const message = await formatMessage( {
71
84
  slackMessageUsername: 'Circle CI',
@@ -73,8 +86,9 @@ async function notifyCircleStatus() {
73
86
  repositoryOwner: CIRCLE_PROJECT_USERNAME,
74
87
  repositoryName: CIRCLE_PROJECT_REPONAME,
75
88
  branch: CIRCLE_BRANCH,
76
- jobUrl: CIRCLE_BUILD_URL,
77
- jobId: CIRCLE_BUILD_NUM,
89
+ buildTitle: 'Workflow ID',
90
+ buildUrl,
91
+ buildId: CIRCLE_WORKFLOW_ID.split( '-' )[ 0 ] + '-...',
78
92
  githubToken: CKE5_GITHUB_TOKEN,
79
93
  triggeringCommitUrl: getTriggeringCommitUrl(),
80
94
  startTime: Math.ceil( ( new Date( jobData.started_at ) ).getTime() / 1000 ),
@@ -109,8 +123,8 @@ function getTriggeringCommitUrl() {
109
123
  let repoSlug, hash;
110
124
 
111
125
  if ( CKE5_TRIGGER_REPOSITORY_SLUG && CKE5_TRIGGER_COMMIT_HASH ) {
112
- repoSlug = CKE5_TRIGGER_REPOSITORY_SLUG;
113
- hash = CKE5_TRIGGER_COMMIT_HASH;
126
+ repoSlug = CKE5_TRIGGER_REPOSITORY_SLUG.trim();
127
+ hash = CKE5_TRIGGER_COMMIT_HASH.trim();
114
128
  } else {
115
129
  repoSlug = [ CIRCLE_PROJECT_USERNAME, CIRCLE_PROJECT_REPONAME ].join( '/' );
116
130
  hash = CIRCLE_SHA1;
@@ -97,8 +97,9 @@ async function notifyTravisStatus() {
97
97
  repositoryOwner,
98
98
  repositoryName,
99
99
  branch: TRAVIS_BRANCH,
100
- jobUrl: TRAVIS_JOB_WEB_URL,
101
- jobId: TRAVIS_JOB_NUMBER,
100
+ buildTitle: 'Job number',
101
+ buildUrl: TRAVIS_JOB_WEB_URL,
102
+ buildId: '#' + TRAVIS_JOB_NUMBER,
102
103
  githubToken: GITHUB_TOKEN,
103
104
  triggeringCommitUrl: SLACK_NOTIFY_COMMIT_URL || `https://github.com/${ TRAVIS_REPO_SLUG }/commit/${ TRAVIS_COMMIT }`,
104
105
  startTime: Number( START_TIME ),
@@ -20,8 +20,9 @@ const REPOSITORY_REGEXP = /github\.com\/([^/]+)\/([^/]+)/;
20
20
  * @param {String} repositoryOwner
21
21
  * @param {String} repositoryName
22
22
  * @param {String} branch
23
- * @param {String} jobUrl
24
- * @param {String} jobId
23
+ * @param {String} buildTitle
24
+ * @param {String} buildUrl
25
+ * @param {String} buildId
25
26
  * @param {String} githubToken
26
27
  * @param {String} triggeringCommitUrl
27
28
  * @param {Number} startTime
@@ -44,8 +45,8 @@ module.exports = async function formatMessage( options ) {
44
45
  value: `<${ repoUrl }|${ options.repositoryName }> (<${ repoUrl }/tree/${ options.branch }|${ options.branch }>)`,
45
46
  short: true
46
47
  }, {
47
- title: 'Build number',
48
- value: `<${ options.jobUrl }|#${ options.jobId }>`,
48
+ title: options.buildTitle,
49
+ value: `<${ options.buildUrl }|${ options.buildId }>`,
49
50
  short: true
50
51
  }, {
51
52
  title: 'Commit',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-dev-ci",
3
- "version": "38.1.0",
3
+ "version": "38.1.2",
4
4
  "description": "Utils for CKEditor5 CI builds.",
5
5
  "keywords": [],
6
6
  "dependencies": {