Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

MM-13027: Don't include a diagnostics segment key in dev builds. #2131

Merged
merged 1 commit into from
Dec 11, 2018

Conversation

grundleborg
Copy link
Contributor

Summary

Don't include a diagnostics segment key in dev builds.

Ticket Link

https://mattermost.atlassian.net/browse/MM-13027

@grundleborg grundleborg added the 2: Dev Review Requires review by a core commiter label Dec 4, 2018
@grundleborg grundleborg requested review from lieut-data, mkraft and jespino and removed request for lieut-data December 4, 2018 11:39
@@ -146,7 +146,7 @@ export default class Root extends React.Component {
const diagnosticId = this.props.diagnosticId;

/*eslint-disable */
if (segmentKey != null && segmentKey !== '' && this.props.diagnosticsEnabled) {
if (segmentKey != null && segmentKey !== '' && !segmentKey.startsWith('placeholder') && this.props.diagnosticsEnabled) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the purpose of this code.

The segmentKey is obtained from a constant, so, It'll never be null, and maybe, It'll be an empty string (if somebody modify the code to "disable" segment removing the key), but then, the placeholder approach is "redundant" and a bit confusing for me. For me is easier to set the constant to an empty string (so the purpose is clear). Anyway, it is a constant, so we can remove the entire block, or move it to a config setting in the server.

I'm ok on merging this as is, because I understand the idea behind, but I think is a confusing way to write it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done this way because Jenkins runs a sed s/placeholder_segment_key/$real_segment_key/g over the codebase, to update that constant to an appropriate value depending on the build type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, that sounds sensible

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth an inline command as such?

@grundleborg grundleborg added this to the v5.8.0 milestone Dec 5, 2018
@grundleborg grundleborg added 4: Reviews Complete All reviewers have approved the pull request and removed 2: Dev Review Requires review by a core commiter labels Dec 11, 2018
@grundleborg grundleborg merged commit 5ec394c into mattermost:master Dec 11, 2018
@grundleborg grundleborg removed the 4: Reviews Complete All reviewers have approved the pull request label Dec 11, 2018
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation and removed Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Dec 11, 2018
@lindy65 lindy65 added the Tests/Not Needed Does not require new release tests label Jan 10, 2019
@JtheBAB JtheBAB mentioned this pull request Jan 15, 2019
9 tasks
@amyblais amyblais added Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation labels Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Changelog/Not Needed Does not require a changelog entry Docs/Not Needed Does not require documentation Tests/Not Needed Does not require new release tests
Projects
None yet
6 participants