-
Notifications
You must be signed in to change notification settings - Fork 357
SCI Embedding of git metadata #3118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Overall package sizeSelf size: 4.11 MB Dependency sizes
🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report
@@ Coverage Diff @@
## master #3118 +/- ##
==========================================
- Coverage 87.33% 84.81% -2.53%
==========================================
Files 325 275 -50
Lines 11830 10587 -1243
Branches 33 33
==========================================
- Hits 10332 8979 -1353
- Misses 1498 1608 +110
... and 63 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| } | ||
| } | ||
|
|
||
| addRepositoryMetadata (spans) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like something the formatter should do since it's responsible for knowing how to use the trace from the span. It's also already handling similar other tags.
| const tagger = require('./tagger') | ||
| const { isTrue, isFalse } = require('./util') | ||
| const uuid = require('crypto-randomuuid') | ||
| const { GIT_REPOSITORY_URL, GIT_COMMIT_SHA } = require('./plugins/util/tags') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like these are expected to be set by users? If that's the case they should probably be moved to ext/tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that makes sense. I'll do this in another PR though, because there are multiple files to change and I don't want to make this harder to review
packages/dd-trace/src/config.js
Outdated
| this.isGitUploadEnabled = this.isCiVisibility && | ||
| (this.isIntelligentTestRunnerEnabled && !isFalse(DD_CIVISIBILITY_GIT_UPLOAD_ENABLED)) | ||
|
|
||
| this.isTraceGitMetadataEnabled = isTrue(DD_TRACE_GIT_METADATA_ENABLED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep it consistent, so gitMetadataEnabled.
03302f1 to
8201501
Compare
|
|
||
| tagGitMetadata (spanContext) { | ||
| if (this._config.gitMetadataEnabled) { | ||
| spanContext._trace.tags[SCI_COMMIT_SHA] = this._config.commitSHA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these trace tags are only added to the local root in format.js via extractChunkTags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks!
What does this PR do?
DD_TRACE_GIT_METADATA_ENABLEDconfig env var, with a default oftrueDD_GIT_REPOSITORY_URLandDD_GIT_COMMIT_SHAenv vars.git.repository_urlandgit.commit.shafromDD_TAGS.Motivation
Allow some products to provide source code related features.
Additional Notes
Unrelated fix: warp
esbuild.spec.jstest in adescribe.