8000
Skip to content

fix broken analytics tracking introduced in #1507 & changed default - #1529

Merged
sheerun merged 1 commit into
masterfrom
analytics_fix
Sep 27, 2014
Merged

fix broken analytics tracking introduced in #1507 & changed default#1529
sheerun merged 1 commit into
masterfrom
analytics_fix

Conversation

@rayshan
@rayshan rayshan commented Sep 18, 2014
Copy link
Copy Markdown
Member

This may not be the most elegant approach but it does fix tracking issue.

@rayshan
rayshan commented Sep 19, 2014
Copy link
Copy Markdown
Member Author

I've been thinking about what the default should be for the case of "if no specified value, no stored value, and can't prompt for one". This is most likely in a CI environment (e.g. all Travis CI's test runs), and we probably don't want this case to pollute our data. I changed the default to false and updated the PR.

@rayshan rayshan changed the title fix broken analytics tracking introduced in #1507 fix broken analytics tracking introduced in #1507 & changed default Sep 19, 2014
Comment thread test/util/analytics.js Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

change test name?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good catch, thx

@rayshan
rayshan commented Sep 19, 2014
Copy link
Copy Markdown
Member Author

@sheerun since you mentioned calling commands in programmatic API, I realized that we could have a non-CI scenario that's also non-interactive. I plan to change the default sessionAnalytics back to true and check for process.env.CI in analytics.js.

@sheerun
sheerun commented Sep 19, 2014
Copy link
Copy Markdown
Contributor

Just please add the tests

@sheerun
sheerun commented Sep 19, 2014
Copy link
Copy Markdown
Contributor

Are you sure you want to check for CI in analytics.js? Isn't check for { interactive: true } enough?

@rayshan
rayshan commented Sep 19, 2014
Copy link
Copy Markdown
Member Author

How do tools like Webstorm integrate bower? I assume that would be an environment where process.env.CI = null and interactive = false?

8000

@sheerun
sheerun commented Sep 19, 2014
Copy link
Copy Markdown
Contributor

I think the environment should be irrelevant when calling bower via programmatic API.

Also, currently analytics is enabled when interactive = false. We probably want to track WebStorm?

@rayshan
rayshan commented Sep 19, 2014
Copy link
Copy Markdown
Member Author

I think the environment should be irrelevant when calling bower via programmatic API.

Yes you're right. Let's not check for CI in analytics.js.

Also, currently analytics is enabled when interactive = false. We probably want to track WebStorm?

Yes latest bower version enables analytics when interactive = false. This should enable analytics in WebStorm unless manually disabled. But this also enables analytics for CI environments. Do you think if it'll be an issue?

@sheerun
sheerun commented Sep 19, 2014
Copy link
Copy Markdown
Contributor

Well, we can't distinguish WebStorm from programmatic API on CI without checking CI env variable.

I don't know what to do. It's getting more and more complicated.

@rayshan
rayshan commented Sep 20, 2014
Copy link
Copy Markdown
Member Author

I addressed your inline concerns. This still doesn't address cases when someone pass conflicting values and pass different values at different times, however that wasn't addressed previously either. I'd like to get this patch in because we're loosing valuable data.

To address the last concerns, I propose we introduce a new config option in Insight called sessionOptOut. We just use Insight to deal with any analytics-related configs, and implement a bridge in bower's config.js. That way we don't have to think about keeping track of conflicting config values in 2 modules. I'll get a patch in Insight then submit another patch to Bower.

@sheerun
sheerun commented Sep 23, 2014
Copy link
Copy Markdown
Contributor

I think we should leave analytics only for interactive sessions. It solves a lot of issues.

@rayshan
rayshan commented Sep 23, 2014
Copy link
Copy Markdown
Member Author

Agreed, this is the case now that we defaulted sessionAnalytics to false right? Unless user manually set config.analytics to true. Is this PR ready or would you recommend further edits?

@sheerun
sheerun commented Sep 23, 2014
Copy link
Copy Markdown
Contributor

I'll fix this PR and tests soon.

@sheerun
sheerun commented Sep 23, 2014
Copy link
Copy Markdown
Contributor

@rayshan Mind to log in to IRC?

@sheerun
sheerun commented Sep 23, 2014
Copy link
Copy Markdown
Contributor

@rayshan Please review

Comment thread lib/util/analytics.js Outdated
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

would it be more clear if we check for undefined since that's what the value actually is if not set? i know this works, just for clarification

@rayshan rayshan closed this Sep 24, 2014
@rayshan rayshan reopened this Sep 24, 2014
@sheerun
sheerun commented Sep 26, 2014
Copy link
Copy Markdown
Contributor

@rayshan Could you review my code?

@rayshan
rayshan commented Sep 26, 2014
Copy link
Copy Markdown
Member Author

@sheerun hi, I did already, please see inline comments. I think the biggest issue is checking for null vs. undefined, which makes this patch not work. Let me know what other feedback you'd like.

@sheerun
sheerun commented Sep 26, 2014
Copy link
Copy Markdown
Contributor

@rayshan I fixed your commit again. Sorry I didn't see your feedback.

@rayshan
rayshan commented Sep 27, 2014
Copy link
Copy Markdown
Member Author

@sheerun no prob, it's properly working now, ready to merge. Thanks for all the help on this. I'll let you merge in in the order you prefer.

sheerun added a commit that referenced this pull request Sep 27, 2014
fix broken analytics tracking introduced in #1507 & changed default
@sheerun
sheerun merged commit 4aa0f56 into master Sep 27, 2014
@rayshan
rayshan commented Sep 28, 2014
Copy link
Copy Markdown
Member Author

Working:

screen shot 2014-09-28 at 1 02 04 pm

@sheerun
sheerun deleted the analytics_fix branch November 27, 2015 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0