Skip to content

Commit 2978cfd

Browse files
committed
feat(babel-plugin-canyon): add buildID
1 parent b8de173 commit 2978cfd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

plugins/babel-plugin-canyon/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "babel-plugin-canyon",
3-
"version": "2.0.11",
3+
"version": "2.0.12",
44
"description": "",
55
"scripts": {
66
"release": "babel src --extensions \".ts\" --out-dir lib",

plugins/babel-plugin-canyon/src/index.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ export default declare((api, config, dirname) => {
6262
const env_sha = envs.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA || envs.CI_BUILD_REF || envs.CI_COMMIT_SHA
6363
const env_projectID = envs.CI_PROJECT_ID
6464
const env_branch = envs.CI_COMMIT_BRANCH
65+
const env_buildID = envs.CI_JOB_ID
66+
const env_buildProvider = 'gitlab_runner'
6567

6668
const servePa:{provider?:string,compareTarget?:string}&any = trim({
6769
...config,
@@ -74,6 +76,8 @@ export default declare((api, config, dirname) => {
7476
dsn: config.dsn || process.env['DSN'] || 'http://localhost:3000',
7577
reporter: config.reporter || process.env['REPORTER'] || '-',
7678
ci: config.ci || process.env['CI'] || false,
79+
buildID: config.buildID || env_buildID || '-',
80+
buildProvider: config.buildProvider || env_buildProvider,
7781
})
7882

7983
if (onlyOne){
@@ -109,6 +113,8 @@ export default declare((api, config, dirname) => {
109113
REPORTER: servePa.reporter,
110114
COMPARE_TARGET: servePa.compareTarget||'-',
111115
INSTRUMENT_CWD: servePa.instrumentCwd,
116+
BUILD_ID: servePa.buildID,
117+
BUILD_PROVIDER: servePa.buildProvider,
112118
}
113119
if (config.debug){
114120
console.log('Canyon:', __canyon__)
@@ -130,10 +136,11 @@ export default declare((api, config, dirname) => {
130136
reportID: 'initial_coverage_data',
131137
compare_target: __canyon__.COMPARE_TARGET,
132138
instrumentCwd: __canyon__.INSTRUMENT_CWD,
133-
// buildID: __canyon__.BUILD_ID
139+
buildID: __canyon__.BUILD_ID,
140+
buildProvider: __canyon__.BUILD_PROVIDER,
134141
}, {
135142
headers: {
136-
Authorization: 'Bearer ' + __canyon__.REPORTER,
143+
Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InR6aGFuZ21AdHJpcC5jb20iLCJpZCI6Ijg0MTciLCJpYXQiOjE3NDEyNDEyOTQsImV4cCI6MjA1NjgxNzI5NH0.5R8HQ5ag_HG8_brkFJiSXMZXGTso9bwpLsQ58MQm0zw',
137144
},
138145
timeout: 15000,
139146
...proxy

0 commit comments

Comments
 (0)