This repository was archived by the owner on Oct 3, 2023. It is now read-only.
Add validation for tagkey & tagvalue. Fix issue #268#280
Merged
mayurkale22 merged 6 commits intocensus-instrumentation:masterfrom Jan 16, 2019
vigneshtdev:add-validation-for-tags
Merged
Add validation for tagkey & tagvalue. Fix issue #268#280mayurkale22 merged 6 commits intocensus-instrumentation:masterfrom vigneshtdev:add-validation-for-tags
mayurkale22 merged 6 commits intocensus-instrumentation:masterfrom
vigneshtdev:add-validation-for-tags
Conversation
Codecov Report
@@ Coverage Diff @@
## master #280 +/- ##
==========================================
- Coverage 94.81% 94.57% -0.24%
==========================================
Files 110 106 -4
Lines 7771 7434 -337
Branches 714 694 -20
==========================================
- Hits 7368 7031 -337
Misses 403 403
Continue to review full report at Codecov.
|
mayurkale22
reviewed
Jan 13, 2019
| * @param tags The tags to be checked | ||
| */ | ||
| private invalidTags(tags: Tags): boolean { | ||
| return this.invalidPrintableCharacters(tags) || this.invalidLength(tags); |
Member
There was a problem hiding this comment.
I think we should log the warn or error, in case of invalid tags. WDYT?
Contributor
Author
There was a problem hiding this comment.
How about modifying the method like this:
private invalidTags(tags: Tags): boolean {
const result: boolean = this.invalidPrintableCharacters(tags) || this.invalidLength(tags);
if(result) {
console.log('Unable to create tagkey/tagvalue with the specified tags. Check Tag specifications here: https://github.com/census-instrumentation/opencensus-specs/blob/master/tags/TagMap.md');
}
return result;
}
Member
There was a problem hiding this comment.
s/console.log/this.logger.warn and no need to add specs link.
draffensperger
approved these changes
Jan 14, 2019
mayurkale22
approved these changes
Jan 14, 2019
Member
|
Thanks @vigneshtdev for contribution... 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Validates tagkey & tagvalues as per the specification given in https://github.com/census-instrumentation/opencensus-specs/blob/master/tags/TagMap.md#tagkey
ran
npm test&npm run compliewith no errors.