Contributing to Open Source : Week 6

Photo by “My Life Through A Lens” on Unsplash

Issues and pull requests

  ╔═══════════╦═══════════════════════════════════╦══════════════╗
║ project ║ issue ║ status ║
╠═══════════╬═══════════════════════════════════╬══════════════╣
║ smug ║ Add `create` and `edit` commands ║ PR Opened ║
╚═══════════╩═══════════════════════════════════╩══════════════╝

How I was trying to contribute

func (smug Smug) Create() error {
exists, err := IsFileExists(smug.configPath)
if err != nil {
return err
}
if exists {
return errors.New("File already exists")
}
file, err := os.Create(smug.configPath)
defer file.Close()
return err
}
func (smug Smug) Edit() error {
editor := os.Getenv("EDITOR")
if editor == "" {
editor = "vim"
}
cmd := exec.Command(editor, smug.configPath)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
err := cmd.Run()
return err
}

Any positive or negative results

  • Make the edit test concurrent so all three processes run at the same time. But the C/I still gets blocked with Vim open, even though all the tests pass.
  • Use a goroutine with time.Sleep(), look for the vim process, and terminate it gracefully with: kill -s 15 -p in order to avoid an exit error and continue with the tests.

What did I learn this week?

--

--

--

26 yo. Self-Taught Software Developer. I write about Career Change, Women in Tech and anything exciting I’m working on.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Top Three Ways to Develop a Roku Channel

The Journey to CI/CD

Seven Weeks Later: Applying Lessons From My First Web Application

INTERFACING WITH SEVEN SEGMENT DISPLAY USING AT89C52 MICRO-CONTROLLER.

KOTLIN- THE TRENDING LANGUAGE IN THE ANDROID WORLD!

Sitecore Unit Testing Guide — Part 4 : Mocking ServiceLocator

Episode 10. Sharing Salesforce CRM data with your Partners (PRM)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alejandra Bricio

Alejandra Bricio

26 yo. Self-Taught Software Developer. I write about Career Change, Women in Tech and anything exciting I’m working on.

More from Medium

What do Open Source Maintainers want you to know about contributing to Open Source projects?

Talking About Open Source -Eassy Week 11

Sempo is now listed on the Digital Public Goods Alliance

Users and Organizations in Multi-Tenant SaaS