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

Staged rollouts #666

Merged
merged 16 commits into from
Apr 20, 2016
Merged

Staged rollouts #666

merged 16 commits into from
Apr 20, 2016

Conversation

anaisbetts
Copy link
Contributor

@anaisbetts anaisbetts commented Apr 19, 2016

This PR implements staged rollouts, where a certain percentage of your users will get the newest version of your app.

We do this by adding a magic comment to the RELEASES file - unfortunately, because of a bug in the syntax Regex in existing Squirrel.Windows versions, we have to write this in a super ugly way:

A3D8B15ABDB5F2A3D9FEBDB8F55B6D4FB8168828 atom-1.9.0-dev-4e74fb6-full.nupkg 110216564# 10%

Note that there is no space between the filesize and the comment. In the future, you'll able to put a space there of course :)

TODO:

  • Write some tests and what
  • Verify RELEASES format against old version of Squirrel.Windows
  • Verify case where we're not in the beta percentage
  • Rig beta ID, see us get put into the beta

return new ReleaseEntry(m.Groups[1].Value, filename, size, isDelta, baseUrl, query, stagingPercentage);
}

public bool IsStagingMatch(Guid? userId)
Copy link
Contributor

Choose a reason for hiding this comment

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

Some comments on how we define a staging match would be 👌.

@kevinmartin
Copy link
Contributor

@paulcbetts Maybe add Docs to that Todo?

@kenbailey
Copy link
Contributor

@paulcbetts if you can point me to some example code, I'll can create a doc file for you to review.


uint val = BitConverter.ToUInt32(userId.Value.ToByteArray(), 12);

double percentage = ((double)val / (double)UInt32.MaxValue);
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me, that in the absence of tracking actual downloads/installs, it is just assuming an even distribution of guid-to-integer-conversions? So, a hopeful approximation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We create the GUID in a Weird Way by taking random bytes that is more likely to ensure a random distribution, it's not just Guid.Create(). That being said, I am not a statistician, but it doesn't really matter so much

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.

5 participants