Developers’ Collaborative Playlist

My Workflow

What inspired me?

I spend most of my free time with coding and I need fairy of inspiration during these times of intense thinking.

Focusing on the same issue for a long time can be very tiring sometimes. Especially if…


This content originally appeared on DEV Community and was authored by oz9un

My Workflow

What inspired me?

I spend most of my free time with coding and I need fairy of inspiration during these times of intense thinking.

Focusing on the same issue for a long time can be very tiring sometimes. Especially if the target problem doesn't have a single solution.

Every time I feel burnout, I want to take my mind on different adventures. And often the easiest way to start such an adventure is with a 'Shuffle Play' button.

need_vacation

The same algorithm can be written differently by each developer. The developer's code style becomes their signature.

So the question in my mind was:

Coding is an art, so what do artists listen to while performing this art?

code_n_music

I thought it might be a pretty fun and elegant way to answer: creating a developers' collaborative playlist, all automated using GitHub Actions.

How I created the workflow?

If I could, I would like to automate everything in this life. I may never be able to automate dealing with people, but this project has been a good medicine for my automatization addiction.

addiction

First I had to overcome some problems before reaching my final goal:

  1. Communication with Spotify API, refreshing OAuth tokens, searching for songs and adding a track to the target playlist...
  2. Evaluating the issues opened by the users and returning an appropriate result. Answering and closing issues.
  3. To make things a little wackier, picking random gifs from various categories and using them.
  4. The name of the developer who opened the issue and their favorite song should be stored as a contributor and written in the README.

Solution workflow for problem 1: dealing with Spotify API

Let's be honest, Spotify has pretty good API documentation. But things can get complicated as you get involved.

I didn't want to have a lot of code in this repository I created for GitHub Actions Hackathon and make the situation even more complicated. For this reason, I created a different public repository and kept all the tools I wrote to communicate with the Spotify API in there. Thus, I would be able to effectively use GitHub actions' ability to communicate with a different repository.

My two different repository will communicate like:
communicate

The constantly talking kid on the left would represent the repository where I used GitHub Actions and submitted for this Hackathon, while the kid on the right that would just listen and execute the commands would represent the repository where I kept my auxiliary Spotify API functions.

In this scenario, the string itself would of course be GitHub Actions.

Solution workflow for problem 2: issues, issues...

In order for the developers to make a song request, they should open an issue with the title 'song request' and the body of the issue should have a text in - format.

song_request

Thus, it was necessary to correctly evaluate the issues opened by the users and to produce the necessary actions accordingly.

In this process, I explored the unlimited features of GitHub Actions and had to use many features from if-checks to environment variables.

Solution workflow for problem 3: random wacky gifs

Generating random gifs was very useful in two ways:

  • Responses to issues opened by developers would be more fun and varied.
  • There couldn't have been a better opportunity for me to learn about environment variables and cross-jobs data sharing.

Therefore I did it. do i regret it? No. Was that wacky? Maybe.

wacky

Solution workflow for problem 4: contributors

It was a good idea to view the songs added by each user. Until you try to code it.

GitHub Actions does not keep any persistent data by nature. So I had to overcome this nature and keep contributors' information:

contributions

I created files for every single contributor. Each time a new song was added, these files and the README_template would be concatenated and a new README file would be created. At this point, I used the code push feature to the target repository, which is readily available in the GitHub Actions marketplace.

Frankly, without GitHub Actions, this project would not have been easy to realize and popularize among developers.

In this process, I also had the opportunity to explore and use many ready-made works in the GitHub Actions market:

  • actions/checkout@v2 đź’–
  • actions/download-artifact@v1 đź’–
  • actions/github-script@v5 đź’–
  • peter-evans/close-issue@v1 đź’–
  • actions/upload-artifact@v1 đź’–
  • actions/setup-python@v2 đź’–
  • ad-m/github-push-action@master đź’–

Submission Category:

Wacky Wildcards

wackyw

Yaml File or Link to Code

Here is the repository:

GitHub logo oz9un / Developers-Playlist

A drop of musical taste from every contributor... Welcome to the developer's collaborative playlist.

Developers' Playlist \(đź“€_đź’ż)/

A drop of musical taste from every contributor... Welcome to the developers' collaborative playlist.

Description🤖:

The same algorithm can be written differently by each developer. The developer's code style becomes their signature.

Coding is an art, so what do artists listen to while performing this art?

The Developer's Playlist analyzes opened issues on this repository using GitHub Actions and collects developers' favorite songs into a collaborative playlist.

Usageđź“–:

  • Open an issue with title 'song request'
  • Write your favorite track to issue's body in format: -
  • Wait for the Github Action Bot's response
  • Enjoy the developers' collaborative playlist!
  • You can also keep track of who added which songs by checking out the contributors section!

Okay... but why?

I love the power of Github Actions. 2021 Github Actions Hackathon created an excellent opportunity for me to learn this technology.

…

You can also view the YAML file: devs_playlist_action.yaml

Additional Resources / Info

GitHub Actions Workflow:
github_workflow

Developers:
1- oz9un
2- 1
3- 2
devs

It's the song request time!

Let's open an issue with your favorite song and enjoy the Developers' Favorite Playlist!

hey

Playlist: Spotify Link


This content originally appeared on DEV Community and was authored by oz9un


Print Share Comment Cite Upload Translate Updates
APA

oz9un | Sciencx (2021-12-07T23:28:31+00:00) Developers’ Collaborative Playlist. Retrieved from https://www.scien.cx/2021/12/07/developers-collaborative-playlist/

MLA
" » Developers’ Collaborative Playlist." oz9un | Sciencx - Tuesday December 7, 2021, https://www.scien.cx/2021/12/07/developers-collaborative-playlist/
HARVARD
oz9un | Sciencx Tuesday December 7, 2021 » Developers’ Collaborative Playlist., viewed ,<https://www.scien.cx/2021/12/07/developers-collaborative-playlist/>
VANCOUVER
oz9un | Sciencx - » Developers’ Collaborative Playlist. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/12/07/developers-collaborative-playlist/
CHICAGO
" » Developers’ Collaborative Playlist." oz9un | Sciencx - Accessed . https://www.scien.cx/2021/12/07/developers-collaborative-playlist/
IEEE
" » Developers’ Collaborative Playlist." oz9un | Sciencx [Online]. Available: https://www.scien.cx/2021/12/07/developers-collaborative-playlist/. [Accessed: ]
rf:citation
» Developers’ Collaborative Playlist | oz9un | Sciencx | https://www.scien.cx/2021/12/07/developers-collaborative-playlist/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.