Skip to content

Commit

Permalink
Bugfixes (#14)
Browse files Browse the repository at this point in the history
* Fix broken code and readme

* Update version
  • Loading branch information
eliatcodecov authored Jun 22, 2022
1 parent 0385959 commit 9aac5cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const codecov = new CodeCovOpenTelemetry(
filters: {
allowedSpanKinds: [SpanKind.SERVER],
},
codecovEndpoint: "https://api.codecov.io",
codecovEndpoint: "api.codecov.io",
sampleRate,
untrackedExportRate,
code
Expand Down
9 changes: 5 additions & 4 deletions lib/runtime-insights.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ class CodeCovOpenTelemetry {
const sampleRate = config.sampleRate;
const untrackedExportRate = config.untrackedExportRate;
const versionIdentifier = config.versionIdentifier || null;
if (needsVersionCreation && versionIdentifier && environment) {
if (needsVersionCreation && versionIdentifier && environment && code) {
this._createVersion(
codecovEndpoint,
versionIdentifier,
environment,
repositoryToken
repositoryToken,
code
);
}
let storageManager = new CoverageStorageManager();
Expand All @@ -48,7 +49,8 @@ class CodeCovOpenTelemetry {
codecovEndpoint,
versionIdentifier,
environment,
repositoryToken
repositoryToken,
code
) {
const data = JSON.stringify({
version_identifier: versionIdentifier,
Expand Down Expand Up @@ -81,7 +83,6 @@ class CodeCovOpenTelemetry {
);
throw "Unable to create version at codecov: bad status code";
}
console.log("Started profiling version at Codecov");
});
})
.on("error", (err) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@codecov/node-codecov-opentelemetry",
"version": "0.0.6",
"version": "0.0.7",
"license": "MIT",
"description": "",
"main": "lib/runtime-insights.js",
Expand Down

0 comments on commit 9aac5cc

Please sign in to comment.