Home Backend Development Golang From Friday Hack to Release: Reflections on Creating and Releasing a Open Source Project

From Friday Hack to Release: Reflections on Creating and Releasing a Open Source Project

Sep 12, 2024 pm 06:08 PM

From Friday Hack to Release: Reflections on Creating and Releasing a Open Source Project

From Friday Patch Hack to Release: Reflections on Creating and Releasing a Open Source Project

This is part of a series aimed at beginner and intermediate developers, releasing or intrigued by releasing their ideas as Open Source Projects.
These reflections are biased and personal. More articles are planned. By sharing some reflections, I hope to inspire you to do your own projects

  • Reflections (this)
  • Learning Go lang as a Java Developer (TODO)
  • Open Source Health and Community files (TODO)
  • Open Source Security (TODO)

The needs

It all started years ago. I now and then needed something that seemed to always involve recreating the same old Bash script, either by me or someone else.
The overall requirements were simple, as they often are at a high level.
What we developers mostly do is really just about shuffling information from point A to point B, right?

Here, the goal was to mirror a bunch of Git repositories - to another Git provider, to disk, to an archive format, in a CLI app.
I needed this privately and in my work role. I've seen people struggle, investing a lot of time doing these things manually, and that bothers me.

Yet, it always seemed to stay as a simple Bash script. Quickly done, but as soon as anything extra had to be added - special cases, error handling, modularization, packaging, etc. - Bash scripts don't hold up for bigger tools, as most of us would agree.

So I decided to create a full CLI application for it.

The Pre-Decisions to be Made

Does such a tool exist already?

The first thing to do was to not reinvent the wheel.
There exist a few tools that are Open Source and solve this problem. At least one written in Go, a few Bash scripts, and if counting import functions like the one in Gitea.
I tried them out, but I couldn't find any that worked fully the way I wanted. And as I had other ideas of where I wanted to take the project, I decided not to deep dive into
starting to apply patches to the existing projects.

There also exist a few commercial tools, but I felt this small a tool is something that should also exist in Open Source forms.

Conclusion: There was a place for this CLI tool in this world.

Hacking on it at Work-hackdays or in Private free time?

We have hacking time at work at the end of sprints and on other occasions. One approach would be to hack on it during these occasions over time, crafting it into something useful.
I quickly decided to do it fully in my private spare time instead, for the following reasons:

  • Hack opportunities at work should be used for short bursts of learning and creativity, not long-term carving of a full project.
  • The solution doesn't fit into the core organization's business - it would always be an odd duck there if so.
  • Tying it to work would make it feel like just more work - I'm doing this for fun and learning Go etc - it would put pressure and stress on me.
  • Doing it on the work-hackdays would take forever. A few hours, spread over weeks.

Conclusion: I should do it for fun in my spare time.

Choice of Technology Stack

I've spent most of my time over the years in the Java/Kotlin world, with a few projects in JS/TS, Python/Ruby, and like every senior developer, dabbling in other at times.
For a long time though, I've wanted to really learn Go and/or Rust. So this would be an opportunity to get the motivation to dive into a new languague
The reason I picked Go is that quite a few CLI applications in the Open Source DevOps world are written in it, and I want to be able to submit patches to third-party projects at times. Also, writing in Go means one binary with many target architectures.

I could have done this in Java, for example, with Pico CLI and GraalVM of which of which I had a good impression since earlier tries but I decided that I really wanted to learn Go instead.

Conclusion: I should do it in Go and learn from that.

Other Learning Goals

With this, I also wanted to delve deeper into the subjects of delivering a nicely packaged Open Source project, following most of the Security practices - scorecards, SLSA,

and using tools like GoRelease to create builds of various kinds.

Conclusion: Take the opportunity to learn and delve into topics of your choice.

Keep the Scope

As I planned to experiment a lot, and I was totally new to Go, I knew I would do a lot of unstructured work.
Here it was important to set the scope - when would it be good enough for an alpha release?
I early on decided on what functionality it should have, and as tempting as it would be to sit and refine and expand it further, this was good.
I could sit with this for a long time.

Conclusion: Release the project as alpha when you are equally embarrassed and proud of it.

Estimation - How Hard Can It Be?

Learning a new language is a small part of learning the language itself, but much more about learning the ecosystem and its idioms.
What libraries are used, how are they used, what are the idiomatic ways of doing this and that?
I would have to spend a large amount of time learning and researching during this project, maybe 50% of the time I would
have spent just coding in a language and ecosystem I know.

Conclusion: Multiply your time estimate by three when learning new core stacks and involving experimentation. The language syntax will be the small thing.

The Creation Process

Initial Commit

The basic implementation was done in a day - it had no builds, error handling, documentation, edge cases, maintainability, etc.
This is where most Friday hacks end up, and most of them never goes further.

But as all senior developers know, making something work is many miles from releasing a product.

Soon done, eh? Not really.

Finding the Time

At times it was really hard finding the time to spend with the project, especially as I had an exhausting spring at work.
It's not every night that you feel like reading a book for 2 hours about something specific, or learning a new tech.
Or spending time writing documentation. I have kids and a house, and I couldn't afford to let a private project consume me more than other hobbies.
But something always has to give - I ended up watch fewer series, and any gaming has been almost non-existent during this period.

With that said, while I wish I could spend more time on the project, it was almost always motivating - I had a few night sessions where I slept less and coded or studied,
because I was so excited to get further. Also, when something is fun, it is fun, whether it's lifting weights, writing a book, developing, etc.

The Things I Forgot

I've been so used to working in teams for a long time. With a solo project, you have to manage a lot more hats and be quite good in every part of them, not often technical.
I spent quite a lot of time digging into good CLI design and idiomatic choices. Another area was the release process and building binaries for different platforms.
Following SLSA and other standards in Open Source also took time. And we want good test coverage, right?
Working in a team, someone else will hopefully do the logo you wanted, the documentation needed to be written.
Working solo, it's only you or it won't happen.
Writing code is not even 50% of delivering a project. And there's the rest.

The Impostor Syndrome Strikes

Impostor Syndrome is common in our knowledge-based developer world. Everyone has different skills, and at any given time, there will always be someone that knows more than you.
Being in a team, you have someone to discuss things with.
Alone, not as much.

But, it is all about accepting that one will do some stupid things in the code at times.
And, that Open Source isn't about being perfect. It's about learning, solving and releasing things that might be of use to others.

The Grind

Well, what can I say - it is done when it is done.

There were a few late nights debugging, refactoring, but also countless moments of flow and dopamine.

For me, the release time came when I felt the overall architecture in the project would not radically move - I had identified the interfaces, and felt that is extendable.
The codebase is OK.
Most of the basic features are there, and while everything is up for improvements, it is still a base to work on.

The Aftermath and Lessons Learned

  1. Set the scope early: Decide where to stop. Set up your project structure, documentation, releases, pipelines, and community guidelines early. Future you will thank past you.

  2. Don't stress, enjoy the learning process: It is done when it is done.

  3. Be persistent: Open source is a marathon, not a sprint. Don't burn out. It is a hobby, not your life. However be persistent. Do a small thing every day.

  4. Learn, learn, learn: See everything as an opportunity for learning and improving, not as a problem.

  5. Coding is the easy part: The main code is what will take you the least time; everything else, like documentation, tests, etc., is where time is spent.

  6. Do the extras: They are as fun as coding. Yes, even documentation can save you hours of explaining and re-explaining. Make it fun if bores you. Docs-as-code, vim-pong, etc.

  7. Take breaks: Burnout is real. Step back when you need to. Just like every other creative learning process, do it in batches.

  8. Use the system: Use your own dogfood in practice and in the real world as early as possible. Even better, find a person/community to give feedback.

  9. Enjoy the journey: It is wonderful to create.

  10. Complete it: There are a zillions half done projects in this world. Complete it.

  11. Use AI as a help: I save hours by delegating a bit of extras to it, like asking for code improvements code reviews, doc structures, summarizing, etc. However, don't ever trust it blindly. Review and criticize the answers.

Well, happy hacking and now go and think about what you want to make next!!

Links

The project: Git Provider Sync

The above is the detailed content of From Friday Hack to Release: Reflections on Creating and Releasing a Open Source Project. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Understanding the Performance Differences Between Golang and Python for Web APIs Understanding the Performance Differences Between Golang and Python for Web APIs Jul 03, 2025 am 02:40 AM

Golangofferssuperiorperformance,nativeconcurrencyviagoroutines,andefficientresourceusage,makingitidealforhigh-traffic,low-latencyAPIs;2.Python,whileslowerduetointerpretationandtheGIL,provideseasierdevelopment,arichecosystem,andisbettersuitedforI/O-bo

Is golang frontend or backend Is golang frontend or backend Jul 08, 2025 am 01:44 AM

Golang is mainly used for back-end development, but it can also play an indirect role in the front-end field. Its design goals focus on high-performance, concurrent processing and system-level programming, and are suitable for building back-end applications such as API servers, microservices, distributed systems, database operations and CLI tools. Although Golang is not the mainstream language for web front-end, it can be compiled into JavaScript through GopherJS, run on WebAssembly through TinyGo, or generate HTML pages with a template engine to participate in front-end development. However, modern front-end development still needs to rely on JavaScript/TypeScript and its ecosystem. Therefore, Golang is more suitable for the technology stack selection with high-performance backend as the core.

How to build a GraphQL API in golang How to build a GraphQL API in golang Jul 08, 2025 am 01:03 AM

To build a GraphQLAPI in Go, it is recommended to use the gqlgen library to improve development efficiency. 1. First select the appropriate library, such as gqlgen, which supports automatic code generation based on schema; 2. Then define GraphQLschema, describe the API structure and query portal, such as defining Post types and query methods; 3. Then initialize the project and generate basic code to implement business logic in resolver; 4. Finally, connect GraphQLhandler to HTTPserver and test the API through the built-in Playground. Notes include field naming specifications, error handling, performance optimization and security settings to ensure project maintenance

How to install Go How to install Go Jul 09, 2025 am 02:37 AM

The key to installing Go is to select the correct version, configure environment variables, and verify the installation. 1. Go to the official website to download the installation package of the corresponding system. Windows uses .msi files, macOS uses .pkg files, Linux uses .tar.gz files and unzip them to /usr/local directory; 2. Configure environment variables, edit ~/.bashrc or ~/.zshrc in Linux/macOS to add PATH and GOPATH, and Windows set PATH to Go in the system properties; 3. Use the government command to verify the installation, and run the test program hello.go to confirm that the compilation and execution are normal. PATH settings and loops throughout the process

Resource Consumption (CPU/Memory) Benchmarks for Typical Golang vs Python Web Services Resource Consumption (CPU/Memory) Benchmarks for Typical Golang vs Python Web Services Jul 03, 2025 am 02:38 AM

Golang usually consumes less CPU and memory than Python when building web services. 1. Golang's goroutine model is efficient in scheduling, has strong concurrent request processing capabilities, and has lower CPU usage; 2. Go is compiled into native code, does not rely on virtual machines during runtime, and has smaller memory usage; 3. Python has greater CPU and memory overhead in concurrent scenarios due to GIL and interpretation execution mechanism; 4. Although Python has high development efficiency and rich ecosystem, it consumes a high resource, which is suitable for scenarios with low concurrency requirements.

Go sync.WaitGroup example Go sync.WaitGroup example Jul 09, 2025 am 01:48 AM

sync.WaitGroup is used to wait for a group of goroutines to complete the task. Its core is to work together through three methods: Add, Done, and Wait. 1.Add(n) Set the number of goroutines to wait; 2.Done() is called at the end of each goroutine, and the count is reduced by one; 3.Wait() blocks the main coroutine until all tasks are completed. When using it, please note: Add should be called outside the goroutine, avoid duplicate Wait, and be sure to ensure that Don is called. It is recommended to use it with defer. It is common in concurrent crawling of web pages, batch data processing and other scenarios, and can effectively control the concurrency process.

Go embed package tutorial Go embed package tutorial Jul 09, 2025 am 02:46 AM

Using Go's embed package can easily embed static resources into binary, suitable for web services to package HTML, CSS, pictures and other files. 1. Declare the embedded resource to add //go:embed comment before the variable, such as embedding a single file hello.txt; 2. It can be embedded in the entire directory such as static/*, and realize multi-file packaging through embed.FS; 3. It is recommended to switch the disk loading mode through buildtag or environment variables to improve efficiency; 4. Pay attention to path accuracy, file size limitations and read-only characteristics of embedded resources. Rational use of embed can simplify deployment and optimize project structure.

Evaluating Code Readability and Maintainability: Golang vs Python Perspectives Evaluating Code Readability and Maintainability: Golang vs Python Perspectives Jul 03, 2025 am 02:40 AM

WhenchoosingbetweenGolangandPythonforcodereadabilityandmaintainability,thedecisionhingesonteampriorities.1.Golangoffersstrictconsistencywithminimal,opinionatedsyntaxandbuilt-intoolinglikegofmt,ensuringuniformcodestyleandearlyerrordetection.2.Pythonpr

See all articles