Slide 1

Slide 1 text

.NET, Open Source & You?! Dominick Baier @leastprivilege https://speakerdeck.com/leastprivilege

Slide 2

Slide 2 text

2 @leastprivilege Me • Independent Consultant – Specializing on Application Security Architectures – Working with Software Development Teams (ISVs and in-house) • Co-Creator of IdentityServer OSS Project – Certified OpenID Connect & OAuth 2.0 Implementation for .NET – https://identityserver.io • Co-Creator of PolicyServer – Modern Authorization Solution – https://policyserver.io email dominick.baier@leastprivilege.com blog http://leastprivilege.com twitter @leastprivilege slides https://speakerdeck.com/leastprivilege

Slide 3

Slide 3 text

3 @leastprivilege My Open Source History

Slide 4

Slide 4 text

4 @leastprivilege My Open Source History • 2009 - 2013 "Open Source Samples" – StarterSTS – IdentityModel – IdentityServer 1 & 2 • 2013 - now "Real Open Source" – IdentityServer3 • 51 contributors / 1,268,903 nuget downloads – IdentityServer4 • 137 contributors / 1,807,751 nuget downloads – IdentityModel • 14 contributors / 7,265,299 nuget downloads • 2016 IdentityServer joins the .NET Foundation • 2017 joined as .NET Foundation Advisory Board Member • 2018 IdentityServer ships with ASP.NET Core 2.2 https://github-contributions.now.sh/

Slide 5

Slide 5 text

5 @leastprivilege Agenda • A little history of open source (in the Microsoft world) • Consuming open source • Producing open source

Slide 6

Slide 6 text

6 @leastprivilege Richard Stallman By Thesupermat - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=37264906 https://www.gnu.org/software/hurd/history.html https://en.wikipedia.org/wiki/GNU_Project https://en.wikipedia.org/wiki/Richard_Stallman

Slide 7

Slide 7 text

7 @leastprivilege https://www.theregister.co.uk/2001/06/02/ballmer_linux_is_a_cancer/

Slide 8

Slide 8 text

8 @leastprivilege

Slide 9

Slide 9 text

9 @leastprivilege

Slide 10

Slide 10 text

10 @leastprivilege https://www.slideshare.net/openstack_kr/microsoft-loves-linux

Slide 11

Slide 11 text

11 @leastprivilege https://www.zdnet.com/article/why-microsoft-is-turning-into-an-open-source-company/

Slide 12

Slide 12 text

12 @leastprivilege Consuming Open Source

Slide 13

Slide 13 text

13 @leastprivilege Create an Open Source Company Culture • Decide on suitable licenses – permissive vs non-permissive vs viral • Employees should be allowed to contribute (back) – during business hours • Consider "sponsoring" the projects you depend on – money or time "In layman's terms, this means that our employees are free to create any sort of open source outside of business hours (as long as it doesn't compete with our business), are free to contribute to open source we depend on at any time, and they own the copyright to that work (or whatever the terms are of the project they contribute to). The only real stipulation is that the project's licence must allow us to use it in our commercial software." http://dhickey.ie/2014/11/our-open-source-policy-at-evision/

Slide 14

Slide 14 text

14 @leastprivilege Producing Open Source

Slide 15

Slide 15 text

15 @leastprivilege Why? • You want to help out other people – open issues when you find bugs or unexpected behavior – create pull requests to fix bugs – contribute to documentation • Start your own project – for fun – for improving your skills – develop your own brand – company sponsored OSS James Newton-King: "Open Source from the Trenches" https://www.youtube.com/watch?v=uEq-rivegew

Slide 16

Slide 16 text

16 @leastprivilege IDEs • Visual Studio Community Edition – https://www.visualstudio.com/vs/community/ • JetBrains Rider – https://www.jetbrains.com/buy/opensource/ • Misc – VS Code, Sublime, Vim…

Slide 17

Slide 17 text

17 @leastprivilege Source Control • Learn git! – get posh-git and/or zsh • Git for Windows – https://git-scm.com/download/win • SourceTree – https://www.sourcetreeapp.com/ • Github Desktop – https://desktop.github.com/ • Alternatives – https://git-scm.com/download/gui/windows

Slide 18

Slide 18 text

18 @leastprivilege My Favourite https://github.com/jesseduffield/lazygit

Slide 19

Slide 19 text

19 @leastprivilege Source Hosting • Github • Bitbucket • GitLab

Slide 20

Slide 20 text

20 @leastprivilege Github • Organization vs single repo • Select a LICENSE https://choosealicense.com/

Slide 21

Slide 21 text

21 @leastprivilege What should be in a Repo? • Code • Tests • Self-contained way to build that code – e.g. build.cmd – don't require Visual Studio • README – super important • Code of Conduct – https://www.contributor-covenant.org/

Slide 22

Slide 22 text

22 @leastprivilege Milestones

Slide 23

Slide 23 text

23 @leastprivilege Labels

Slide 24

Slide 24 text

24 @leastprivilege Projects

Slide 25

Slide 25 text

25 @leastprivilege Dealing with issues • Issue/bug tracker vs support forum • Require useful information – good error messages – logging output • Use StackOverflow (get a tag) • Don't – Email – Twitter – …

Slide 26

Slide 26 text

26 @leastprivilege ISSUE_TEMPLATE.MD

Slide 27

Slide 27 text

27 @leastprivilege Brand new: Multiple Templates

Slide 28

Slide 28 text

28 @leastprivilege Gitter • Free chat room for your users

Slide 29

Slide 29 text

29 @leastprivilege Tests • The more tests, the better you sleep – especially when "strangers" start adding code • High code coverage is nice, but not the most important thing – I prefer integration tests over 100% unit test coverage • Demand a test for every PR

Slide 30

Slide 30 text

30 @leastprivilege Dealing with Pull Requests • Do you want to accept PRs at all? • If you do – the code will become YOUR code, and you have to maintain it for a long time – require test coverage of the changes/additions – require same coding style as rest of project (e.g. using editorconfig.json) • Add a CONTRIBUTING.MD • Consider a Contribution License Agreement (CLAs)

Slide 31

Slide 31 text

31 @leastprivilege CONTRIBUTING.MD • File describing how people can get involved

Slide 32

Slide 32 text

32 @leastprivilege

Slide 33

Slide 33 text

33 @leastprivilege PULL_REQUEST_TEMPLATE.MD

Slide 34

Slide 34 text

34 @leastprivilege Build Automation • Job of build is – restore packages – build code – run tests – publish artifacts • Should run automatically – check-ins – pull requests • Many options – Rake, Fake, PSake, MSBuild – commercial products

Slide 35

Slide 35 text

35 @leastprivilege Build Servers • AppVeyor – https://www.appveyor.com/ • Travis CI – https://travis-ci.org/

Slide 36

Slide 36 text

36 @leastprivilege Azure DevOps

Slide 37

Slide 37 text

37 @leastprivilege Versioning • GitVersion

Slide 38

Slide 38 text

38 @leastprivilege Publishing

Slide 39

Slide 39 text

39 @leastprivilege Release Notes • https://github.com/ GitTools/GitReleaseManager

Slide 40

Slide 40 text

40 @leastprivilege Documentation • Github Pages / Wiki – https://guides.github.com/features/pages/ • Read The Docs – https://readthedocs.org/ • Microsoft DocFX – https://dotnet.github.io/docfx/

Slide 41

Slide 41 text

41 @leastprivilege GhostDoc • https://submain.com/products/ghostdoc.aspx

Slide 42

Slide 42 text

42 @leastprivilege Sharing Secrets • Accounts • Nuget keys • Signing certificates • … • 1Password – https://github.com/1Password/1password-teams-open-source

Slide 43

Slide 43 text

43 @leastprivilege Promote your Project • Twitter • Blog posts • Conference/Usergroup/Meetup talks • Submit to Microsoft – ASP.NET Community Standup – On .NET • StackOverflow – help other people that have problems (with your library) – link back to github/docs/nuget

Slide 44

Slide 44 text

44 @leastprivilege .NET Foundation • IP, legal and "business continuity" support • Useful services – CLA management – HTTPS certificates – Code/nuget signing – Forums – Hosting/software – Sponsoring – CI/CD https://dotnetfoundation.org/

Slide 45

Slide 45 text

45 @leastprivilege Sustainability • Provide commercial services – consulting – training – developer / production support – commercial add-ons • Sponsorship – https://opencollective.com/ – https://www.patreon.com/ https://hueniverse.com/a-new-social-contract-for-open-source

Slide 46

Slide 46 text

46 @leastprivilege Attract new Contributors • Create small and easy to implement issues – label them – register label at http://up-for-grabs.net

Slide 47

Slide 47 text

47 @leastprivilege Closing thoughts • The "new" .NET ecosystem is definitely better than the "old" one – easier access to development teams – more "development in the open" • Microsoft has not turned into a charity – be prepared that they can compete with your OSS project any time they want • "Every open source project needs a business plan" – Microsoft's is selling Azure – what's yours?

Slide 48

Slide 48 text

48 @leastprivilege thank you!