Cookie Consent by Free Privacy Policy Generator Aktuallisiere deine Cookie Einstellungen ๐Ÿ“Œ Things I wish I knew before I started an open-source project


๐Ÿ“š Things I wish I knew before I started an open-source project


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: dev.to

New to the world of open source? Youโ€™ll likely make a few mistakes in your first open-source project ๐Ÿคทโ€โ™‚๏ธ. In this article, Iโ€™ll share key takeaways from our experience building Latitude, covering what you need to know before launching your first open-source project.

If youโ€™re considering taking the plunge, this article is for you!

https://cdn.hashnode.com/res/hashnode/image/upload/v1716096673448/fc18bf57-5183-48ed-8025-ded490e30e4a.gif?auto=format,compress&gif-q=60&format=webm&auto=format,compress&gif-q=60&format=webm

How to properly set up an OSS project on GitHub

A well-configured project requires more than just a basic setup. It needs detailed information to give potential users and contributors a clear understanding of the projectโ€™s objective and functionality. This can be achieved by crafting a clear and concise project description, accompanied by a comprehensive README file that provides step-by-step guidance on how to use the project. This article offers invaluable insights on what to include in your README files and provides tips on writing an effective one.

Beyond that, itโ€™s also essential to establish a contribution guideline and a code of conduct to maintain a respectful and inclusive community.

A contribution guideline provides clear guidelines for making contributions to the project. This includes instructions for submitting issues and pull requests, as well as outlining coding standards and best practices. A code of conduct, on the other hand, sets the tone for a respectful and inclusive community, covering aspects like language choices, behavioral standards, and more.

Check out Latitude for examples of all these.

Choosing the right license

When I started my first open-source project, I underestimated the importance of choosing a license that fitted my project.

Open-source licenses protect users and contributors and govern how others can use, modify, or distribute an OSS project. There are two broad categories of open-source licenses:ย Copyleft licensesย andย Permissive licenses.

Copyleft Licenses ensure any derivative work inherits the original OSS license and this can protect the original author from bad actors abusing their work. Latitude, for example, uses an LGPL copyleft license, which grants some protections against commercial competitors using Latitude to compete with us. Permissive licenses, on the other hand, are less restrictive and donโ€™t enforce any license reuse in derivative work.

Likewise, it is very important to have all contributors sign a Contributors License Agreement, which stipulates the terms under which intellectual property has been contributed to your project. This ensures contributors cannot easily sue you for code they might have contributed to your project in the past.

To have all contributors sign the CLA, thereโ€™s a handy Gtihub Action that automatically requires new contributors to do so.

Version control and branch protection rules

Open-source collaboration often involves working with contributors whom you donโ€™t necessarily trust. To avoid potential disasters, itโ€™s crucial to set clear boundaries for what contributors can do. Failure to do so could lead to mistakes, such as deleting main branch code, which can be extremely difficult to resolve.

Hereโ€™s a set of sane defaults we use at Latitude:

  • Require a pull request with approval from code owners to merge code to main branch
  • Enforce approval after any code change to pull requests
  • Require all CI status checks to pass before merge
  • Only give permission to merge pull requests to code owners
  • Optionally allow your closest team to bypass some of these restrictions

How to maintain coding standards

In an open-source project, itโ€™s essential to maintain coding standards. When code is written with consistency and clarity, it becomes easier to understand, maintain, and contribute to, ultimately making the project more sustainable.

One effective way to ensure coding standards are upheld is by incorporating linters like ESLint into the development workflow. Linters scrutinize code for syntax errors, formatting inconsistencies, and stylistic issues, providing instant feedback to developers on how to improve their code.

In addition to linters, code formatters like Prettier can further reinforce coding standards. These tools automatically format code according to pre-defined rules, eliminating inconsistencies in indentation, spacing, and syntax.

By combining a linter with a code formatter, open-source projects can establish a unified coding standard that is both easy to enforce and maintain. This not only improves the overall quality of the code but also creates a more welcoming environment for new contributors to join and contribute to the project.

How to manage new releases

Managing releases in an OSS project can be complicated, especially when publishing versioned packages of your software. In contrast to software-as-a-service, where you control the version users access, OSS users can install a particular package version and never update it. This increases the importance of shipping stable and bug-free software.

As a general rule, I recommend against completely automating the release of your software and instead have a manual approval step required at some point in the process. Tools like changesets, the one we use at Latitude, greatly help with this. Changesets takes care of publishing new packages, updating changelogs, and tagging releases, yet it can only do so via automatic pull requests that have the same approval requirements as any other PR at Latitude.

Some more recommendations include maintaining proper human-readable changelogs, tagging releases, and making sure you follow semantic versioning โ€“ย package managers rely on it for safely keeping project dependencies up to date.

Lastly, a word on prereleases. If you publish versioned packages of your software I greatly encourage you to QA new versions in alpha release. When properly tagged, package managers will ignore these package versions, allowing you to properly and safely test new features in production-like environments. Changesets can also help you with prereleases.

Security best practices

Security practices in OSS projects are not much different from the ones youโ€™d follow in a closed-source project. So hereโ€™s a somewhat comprehensive list we follow at Latitude:

  • Update dependencies regularly: Make use of automated tracking of minor dependency updates with tools like Dependabot, and try to update any major version of your dependencies every so often โ€“ at Latitude we review all our dependencies once a month or so.
  • Code Reviews: Implement a code review process, especially for the sensitive areas of your code that might deal with production secrets.
  • Access control: Implement role-based access control to restrict access to sensitive parts of your project, control who can trigger new releases, and who can push code to your main branch. GitHub provides tools for all of these.
  • Secure storage: Never share production secrets in OSS code, ensure only code owners and administrators have access to sensitive areas of your org like shared password managers, PaaS providers and whatnot.

These practices will only strengthen your projectโ€™s security; itโ€™s best to keep up with them.

Conclusion

In conclusion, launching a successful open-source project requires careful consideration of several key factors, including defining the projectโ€™s purpose and goals, choosing the right license, setting up a proper project on GitHub, understanding version control, maintaining coding standards, managing new releases, and implementing security best practices.

By learning from the mistakes and experiences shared in this article, first-time open-source contributors can avoid common pitfalls and set their projects up for success.

Thanks for making it to the end of this article. I hope you found the article helpful!

Do well to help me

Latitude isย an open-source framework for embedding analytics into your application using code.

Please consider giving it aย Star on GitHub.

https://cdn.hashnode.com/res/hashnode/image/upload/v1716228754111/1997d703-0998-4c10-a48f-f2aff7738818.gif?auto=format,compress&gif-q=60&format=webm&auto=format,compress&gif-q=60&format=webm

Lastly, if you have any questions about what I've shared in this article, you can drop a comment below.

I hope to have you read my next piece! ๐Ÿ˜ƒ

...



๐Ÿ“Œ The one Diablo 4 tip I wish I knew before I started playing


๐Ÿ“ˆ 47.77 Punkte

๐Ÿ“Œ 25 Things I Wish I Knew When I Started to Code ๐Ÿ’ป๐Ÿ“š


๐Ÿ“ˆ 46.95 Punkte

๐Ÿ“Œ 24 Things I wish I knew when I started learning how to code


๐Ÿ“ˆ 46.95 Punkte

๐Ÿ“Œ Iโ€™ve worked in IT for over 10 years. Here are 5 things I wish I knew when I started


๐Ÿ“ˆ 46.95 Punkte

๐Ÿ“Œ 3 things you wish you knew about before moving to Azure (Microsoft Ignite)


๐Ÿ“ˆ 45.94 Punkte

๐Ÿ“Œ Things I Wish I Knew Before Starting A Tech Blog


๐Ÿ“ˆ 45.94 Punkte

๐Ÿ“Œ Things I Wish I Knew Before Becoming a Web Developer


๐Ÿ“ˆ 45.94 Punkte

๐Ÿ“Œ Work from home? Things I wish someone had told me before I started


๐Ÿ“ˆ 40.06 Punkte

๐Ÿ“Œ Resources I wish I knew when I started my career


๐Ÿ“ˆ 39.09 Punkte

๐Ÿ“Œ One thing I wish I knew when I first started to code is... : CodeNewbie Podcast


๐Ÿ“ˆ 39.09 Punkte

๐Ÿ“Œ 7 Palworld tips and tricks for beginners I wish I knew before starting the game


๐Ÿ“ˆ 38.07 Punkte

๐Ÿ“Œ 7 tips and tricks for Persona 3 Reload I wish I knew before playing


๐Ÿ“ˆ 38.07 Punkte

๐Ÿ“Œ 7 Enshrouded beginner tips, tricks, and mistakes to avoid I wish I knew before starting


๐Ÿ“ˆ 38.07 Punkte

๐Ÿ“Œ Helldivers 2 guide: 7 tips and tricks I wish I knew before I got sent to the galactic front lines


๐Ÿ“ˆ 38.07 Punkte

๐Ÿ“Œ 7 Nightingale tips and tricks for beginners I wish I knew before playing the game


๐Ÿ“ˆ 38.07 Punkte

๐Ÿ“Œ 3 robot vacuum shopping tips I wish I knew before buying one


๐Ÿ“ˆ 38.07 Punkte

๐Ÿ“Œ 4 Little Nightmares 2 tips and tricks I wish I knew before playing


๐Ÿ“ˆ 38.07 Punkte

๐Ÿ“Œ Resident Evil Village beginner's guide: 5 tips I wish I knew before playing


๐Ÿ“ˆ 38.07 Punkte

๐Ÿ“Œ 10 things CIOs wish they knew from the start


๐Ÿ“ˆ 37.25 Punkte

๐Ÿ“Œ Things I wish I knew earlier that would have helped me be a better coder...


๐Ÿ“ˆ 37.25 Punkte

๐Ÿ“Œ Things I Wish I Had Known About Angular When I Started


๐Ÿ“ˆ 31.38 Punkte

๐Ÿ“Œ Three things I love about Samsung's Galaxy Z Fold 4 (and two things I wish were better)


๐Ÿ“ˆ 29.55 Punkte

๐Ÿ“Œ What I wish I knew about React


๐Ÿ“ˆ 29.39 Punkte

๐Ÿ“Œ Whatโ€™s an opportunity you wish you knew about as a student? #Shorts


๐Ÿ“ˆ 29.39 Punkte

๐Ÿ“Œ 7 ๐Ÿ”ฅ programming repos you'll wish you knew sooner ๐Ÿ‘ฉโ€๐Ÿ’ป


๐Ÿ“ˆ 29.39 Punkte

๐Ÿ“Œ What Purple Teams Wish Companies Knew


๐Ÿ“ˆ 29.39 Punkte

๐Ÿ“Œ What I Wish I Knew About Working In Development Right Out Of School


๐Ÿ“ˆ 29.39 Punkte

๐Ÿ“Œ Data Science Advice I Wish I Knew Sooner


๐Ÿ“ˆ 29.39 Punkte

๐Ÿ“Œ React Essentials: What I Wish I Knew When Starting Out


๐Ÿ“ˆ 29.39 Punkte

๐Ÿ“Œ What I wish I knew ... about being a computer scientist


๐Ÿ“ˆ 29.39 Punkte

๐Ÿ“Œ What I wish I knew ...about being a computer scientist


๐Ÿ“ˆ 29.39 Punkte

๐Ÿ“Œ What I Wish I Knew ... about finding your passion


๐Ÿ“ˆ 29.39 Punkte

๐Ÿ“Œ What I Wish I Knew ... about what you do as a software engineer


๐Ÿ“ˆ 29.39 Punkte











matomo