Skip to content
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

do not send diagnostics if organization is cockroach labs #20790

Merged
merged 1 commit into from
Feb 10, 2018

Conversation

dianasaur323
Copy link
Contributor

@dianasaur323 dianasaur323 commented Dec 18, 2017

Not too sure if this is the right approach, but basically adding logic where we check for whether or not a user has enabled diagnostics to also check for if the user has an organization that contains Cockroach Labs. This way, we can stop counting backup / restores that are related to internal work.

Fixes https://github.com/cockroachlabs/registration/issues/91

@dianasaur323 dianasaur323 requested a review from a team December 18, 2017 06:04
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dt
Copy link
Member

dt commented Dec 18, 2017

I think we might actually want to report from our own clusters but just want to indicate that they are ours, so we can filter them server-side. That way we can validate that our reporting is working as expected?

@dianasaur323
Copy link
Contributor Author

dianasaur323 commented Dec 18, 2017

Well, the reason I didn't go with that approach was because then we would have to send everyone's organization with each update? If that's not a big deal, I guess we could just send it and then filter on the server side? In that case, we might even want to add a column or something to mark if a cluster is Cockroach or not? That seems heavy handed.

@dt
Copy link
Member

dt commented Dec 18, 2017

discussed offline and think sending a testing flag is the way to go, and we can set that client side if the org contains "Cockroach Labs" or whatever, then exclude testing=true rows server side when doing analytics in a follow up.

@dianasaur323
Copy link
Contributor Author

dianasaur323 commented Dec 19, 2017

Cool, also going to do a schema change on the reg cluster by adding in a testing column in both the clusters and updates table.

@nstewart
Copy link
Contributor

small nit, any reason not to call this internal (or something else)? Only because we have user stories around testing clusters that aren't limited to CRL. Just thinking about understandability for future employees.

@dianasaur323
Copy link
Contributor Author

Correction, I don't think we need to also include this in updates, since if at any point, a cluster becomes a CRL cluster, we should just omit it.

Okay on calling this column internal.

@dianasaur323 dianasaur323 requested review from a team January 28, 2018 20:23
@dianasaur323 dianasaur323 requested a review from a team as a code owner January 28, 2018 20:23
@dianasaur323 dianasaur323 requested a review from a team January 28, 2018 20:23
@dianasaur323 dianasaur323 requested a review from a team as a code owner January 28, 2018 20:23
@dianasaur323 dianasaur323 requested review from a team and removed request for a team January 28, 2018 20:23
@dianasaur323 dianasaur323 removed request for a team January 28, 2018 20:24
@dianasaur323 dianasaur323 force-pushed the update-diagnostics branch 4 times, most recently from c9422c2 to e2443fd Compare January 28, 2018 20:32
@andreimatei
Copy link
Contributor

last commit is badly named and superfluous?


Review status: 0 of 2 files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@dianasaur323
Copy link
Contributor Author

@andreimatei I'll fix and squash that last commit with a better message once this passes tests - I botched a rebase and pulled a hail mary to get rid of a bunch of random commits.

@dianasaur323 dianasaur323 force-pushed the update-diagnostics branch 5 times, most recently from 3ccf11f to 04ac51a Compare January 31, 2018 12:50
@dianasaur323
Copy link
Contributor Author

@dt could I get a review on this? thank you!

@@ -224,6 +233,9 @@ func TestReportUsage(t *testing.T) {
if minExpected, actual := len(params.StoreSpecs), len(r.last.Stores); minExpected > actual {
return errors.Errorf("expected at least %v stores got %v", minExpected, actual)
}
if expected, actual := "true", r.last.internal; expected != actual {
Copy link
Contributor

Choose a reason for hiding this comment

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

probably want to have a test case where this is false

@dianasaur323
Copy link
Contributor Author

Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


pkg/server/updates_test.go, line 236 at r1 (raw file):

Previously, couchand (Andrew Couch) wrote…

probably want to have a test case where this is false

So the reason why I do it this way is that in this TestReportUsage function, I actually set the organization to Cockroach Labs, and once that's done, it can't go back to false anymore. I do test whether or not things are initialized as false in the test case above under TestCheckVersion? Is that adequate?


Comments from Reviewable

@couchand
Copy link
Contributor

couchand commented Feb 5, 2018

Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


pkg/server/updates_test.go, line 236 at r1 (raw file):

Previously, dianasaur323 (Diana Hsieh) wrote…

So the reason why I do it this way is that in this TestReportUsage function, I actually set the organization to Cockroach Labs, and once that's done, it can't go back to false anymore. I do test whether or not things are initialized as false in the test case above under TestCheckVersion? Is that adequate?

Oh, I had missed that. Thanks!


Comments from Reviewable

@dianasaur323
Copy link
Contributor Author

ok for me to merge? Could I get an LGTM from someone? thanks!


Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


Comments from Reviewable

@bdarnell
Copy link
Contributor

bdarnell commented Feb 9, 2018

:lgtm:, although this starts the long process of updating all our tools that create clusters to set this setting.


Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion, all commit checks successful.


Comments from Reviewable

@dianasaur323
Copy link
Contributor Author

Awesome, thanks! I'm going to go ahead and merge this, and perhaps we can start that process after code freeze.

@dianasaur323 dianasaur323 merged commit 058a964 into cockroachdb:master Feb 10, 2018
@dianasaur323 dianasaur323 deleted the update-diagnostics branch February 10, 2018 13:58
@knz
Copy link
Contributor

knz commented Feb 10, 2018

This broke master, looking into it

knz added a commit to knz/cockroach that referenced this pull request Feb 10, 2018
- server: fix TestReportUsage (broken by cockroachdb#20790)
- cli/interactive_tests: do not check for proper termination
  by `cockroach quit` until cockroachdb#22536 is fixed.

Release note: none
@dianasaur323
Copy link
Contributor Author

thanks, @knz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants