<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dhruv</title>
    <description>The latest articles on DEV Community by Dhruv (@itsdhruvdp).</description>
    <link>https://dev.to/itsdhruvdp</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F398339%2Fbda7021b-6f48-4b63-8ebe-71e3078b0a71.jpg</url>
      <title>DEV Community: Dhruv</title>
      <link>https://dev.to/itsdhruvdp</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/itsdhruvdp"/>
    <language>en</language>
    <item>
      <title>Actions in Github</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Sun, 27 Dec 2020 09:41:20 +0000</pubDate>
      <link>https://dev.to/itsdhruvdp/actions-in-github-2368</link>
      <guid>https://dev.to/itsdhruvdp/actions-in-github-2368</guid>
      <description>&lt;p&gt;It has been a while now since Github released its much-awaited feature Github Action.&lt;/p&gt;

&lt;p&gt;This post will cover some basics around what actually are Github Actions and how can it be used in the simplest of ways to automate some mundane tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Github Action?
&lt;/h2&gt;

&lt;p&gt;In layman's terms, Github Actions helps in automating software workflows like a PR review, Branch management, Issues tracking, PR labelling, and much more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Now what is workflow?
&lt;/h2&gt;

&lt;p&gt;Workflow gives you the ability to structure your own set of steps/rules/flow to build your own automation process. It can be just one workflow or multiple ones clubbed together.&lt;/p&gt;

&lt;p&gt;For this particular article we will be looking into how can we leverage Github Action to automate the task of PR labelling. I'm very sure anyone who is reading this would've had a difficulty in remembering to label your PR according to the changes done and more often your manager/lead would drop in a comment to remind you about the same.&lt;/p&gt;

&lt;p&gt;The good thing is now you can leave that to the Github actions bot. Let's see how.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First of all, make sure you have created all the necessary labels you want to use for your projects in Github. To do so, navigate to your project repository and click on the pull requests tab.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GBv1kVGP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jvkttfsybtj1u1vd2z07.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GBv1kVGP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jvkttfsybtj1u1vd2z07.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on "Labels" right next to the filter search bar which will straight away take you to the list of labels available from where you can also create new labels as per your requirements.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Djuq5Qbz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/svg9haulajlo963bhpwl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Djuq5Qbz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/svg9haulajlo963bhpwl.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Now, Create a &lt;code&gt;.github&lt;/code&gt; folder in the root of your project if not already created. This will be the directory where all your future workflow files, as well as some useful &lt;code&gt;YML&lt;/code&gt; files, stay.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Withing &lt;code&gt;.github&lt;/code&gt; folder create a file with &lt;code&gt;${your-file-name}.yml&lt;/code&gt; (I have named it &lt;code&gt;assing-label.yml&lt;/code&gt;). Replace &lt;code&gt;your-file-name&lt;/code&gt; with whatever you'll like to have and paste the below code in there.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;Components&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;any&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;src/components/**/*'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;actions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;any&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.github/**/*'&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code is just a yml file that will be used by our workflow to decide which filter should be applied based on any changes.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;any&lt;/code&gt; and &lt;code&gt;all&lt;/code&gt; are two fields defined to match and check for files changed in the paths mentioned against the fields in array respectively.&lt;/p&gt;

&lt;p&gt;It basically translates to this:-&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;If there are ANY changes in the components folder present in the src folder apply the `Components` tag to that PR.&lt;/span&gt;

&lt;span class="s"&gt;Similarly, if there are ANY changes in the `.github` folder apply the `actions` tag to that PR.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://github.com/actions/labeler"&gt;Understand Globs Better&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Okay, So far so good.&lt;/p&gt;

&lt;p&gt;Now, we will create a workflow that will actually bring everything to life when a PR is actually created.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Jump to the &lt;code&gt;Actions&lt;/code&gt; tab and scroll down till you see this.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--35SHl96F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dfcnowl884492pfvv8oo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--35SHl96F--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dfcnowl884492pfvv8oo.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Out of the options available, click on the &lt;code&gt;Setup this workflow&lt;/code&gt; button of the &lt;code&gt;Labeler&lt;/code&gt; Card and soon you'll see a code editor screen with some pre-populated code snippet in it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FPUEHgjs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3qarelrvburszms43wl2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FPUEHgjs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3qarelrvburszms43wl2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can choose to change the file name which is auto-generated as &lt;code&gt;label.yml&lt;/code&gt;. Github will automatically create a workflow folder within the &lt;code&gt;.github&lt;/code&gt; folder that we created for our &lt;code&gt;assign-label.yml&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FPUEHgjs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3qarelrvburszms43wl2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FPUEHgjs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3qarelrvburszms43wl2.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paste this simple code snippet in the editor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;
&lt;span class="c1"&gt;# This workflow will triage pull requests and apply a label based on the&lt;/span&gt;
&lt;span class="c1"&gt;# paths that are modified in the pull request.&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;# To use this workflow, you will need to set up a .github/labeler.yml&lt;/span&gt;
&lt;span class="c1"&gt;# file with configuration.  For more information, see:&lt;/span&gt;
&lt;span class="c1"&gt;# https://github.com/actions/labeler&lt;/span&gt;

&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Labeler&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;triage&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;

    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/labeler@master&lt;/span&gt;
      &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;repo-token&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;${{&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;secrets.GITHUB_TOKEN&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;}}"&lt;/span&gt;
        &lt;span class="na"&gt;configuration-path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;.github/assign-label.yml&lt;/span&gt; &lt;span class="c1"&gt;# Replace this with your ${your-file-name}.yml that we created earlier.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's first understand what the heck is going on in this file.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;code&gt;name&lt;/code&gt;&lt;/em&gt;: This is just a string which is normally the name of the workflow file.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;code&gt;on&lt;/code&gt;&lt;/em&gt;: This one is rather the most important one. &lt;code&gt;on&lt;/code&gt; basically tells the action to listen to a particular event which in our case is a pull_request. It will listen to any and every change on a pull_request and run this particular action every time something is pushed or changed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions"&gt;More about events in Github actions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;jobs&lt;/code&gt; will run your particular job that is triage on the latest ubuntu machine and start completing the steps mentioned. &lt;code&gt;uses&lt;/code&gt; will download the external dependency that is &lt;a href="https://github.com/actions/labeler"&gt;&lt;code&gt;actions/label@master&lt;/code&gt;&lt;/a&gt; and will run the same code with the configuration we wrote in the &lt;code&gt;assign-label.yml&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;A lot of stuff happened, right!? But hang on in there. Once this is done, commit the file either to master directly or create a new Pull Request for the same.&lt;/p&gt;

&lt;p&gt;On creating a pull request you'll see Github action in action literally.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P8XE-cdz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zp25lqs4t6dkujnsfj8x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P8XE-cdz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zp25lqs4t6dkujnsfj8x.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll notice some new comments saying "Github actions bot added some Tag" and a green tick to signify that your checks ran successfully. In case it fails you'll see a red cross there and luckily you also have access to logs for your actions to debug them in case you need to which I'm sure in the beginning you'll have to. That's how we all learn, right !?&lt;/p&gt;

&lt;p&gt;To see logs and the history of actions that were executed earlier you can straight away go to the Actions tab within your repo.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1LvVrMi0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mja2zgdrutba3nprofmz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1LvVrMi0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/mja2zgdrutba3nprofmz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, if you manage to follow the article successfully you'd have successfully automated your Pull Request labelling process, and even if you get stuck on any of the steps feel free to drop down the errors in the comment section. I'll be happy to help as much as I can.&lt;/p&gt;

&lt;p&gt;This is just a very small use case of what Github Actions can do. You might have some other way of doing the same thing too. Feel free to let me know how do you automate your day to day workflows in Github.&lt;/p&gt;

&lt;p&gt;If you want to discuss more on this feel free to DM me on &lt;a href="https://twitter.com/thepunnyhooman"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>github</category>
      <category>tutorial</category>
      <category>actions</category>
    </item>
    <item>
      <title>Engineer vs Developer</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Sat, 03 Oct 2020 09:35:40 +0000</pubDate>
      <link>https://dev.to/itsdhruvdp/engineer-vs-developer-35p1</link>
      <guid>https://dev.to/itsdhruvdp/engineer-vs-developer-35p1</guid>
      <description>&lt;p&gt;It's weekend again and it calls for new food for thought kind of a topic.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What do you mean by the term "Developer" ?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;This is a question that can be answered in a lot of different ways depending on the different viewpoints. According to me if you have a good logical capability and you know what tool to use when and for what use case, that makes a good Developer. I won't bring SYNTAX in between here because it can be easily googled, right?&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What do you mean by the term "Engineer" ?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;An engineer is someone who builds stuff. Building anything requires a lot more knowledge than just programming and logical thinking. One needs to dive into the idea/abstract of the product/tech they are working on in order to know what shortcomings are present currently in product/tech and what solutions might help solve those issues.&lt;/p&gt;




&lt;p&gt;This debate of engineer vs developer can be a long one but one must keep in mind that being an engineer is "holistic development of developer". An all-around development of a developer makes them an Engineer. Being an engineer is more than just coding, it's also about understanding the product, how you perceive a problem statement, and start thinking of a possible solution to it. &lt;/p&gt;

&lt;p&gt;There's a very clear and visible line between a developer and an engineer, to say the least, but this is again my opinion and it can be different for different people based on their experience.&lt;/p&gt;




&lt;p&gt;Tell me what do you think about this comparison of a Developer vs Engineer.&lt;/p&gt;

&lt;p&gt;Twitter - &lt;a href="https://twitter.com/thepunnyhooman"&gt;punnyhooman&lt;/a&gt;&lt;/p&gt;

</description>
      <category>career</category>
    </item>
    <item>
      <title>Lessons learned in a year as a software engineer</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Sat, 26 Sep 2020 13:50:13 +0000</pubDate>
      <link>https://dev.to/itsdhruvdp/lessons-learned-in-a-year-as-a-software-engineer-182i</link>
      <guid>https://dev.to/itsdhruvdp/lessons-learned-in-a-year-as-a-software-engineer-182i</guid>
      <description>&lt;p&gt;1st July 2020 marked the completion of my one year in the tech industry as a full-time front-end engineer. I wanted to write this article on that very day, but not everything happens as you plan, right? Better late than never they say.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;strong&gt;Don't just do, market your work&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I won't be wrong if I say if you don't learn this early in your career chances are your growth might get slowed down or in the worst case, you won't climb that ladder of positions in your organization. It's very important to have this skill to present your work in such a way that the other person understands it all even if they don't have the technical knowledge required to understand your work. One thing that I have noted while working in teams is that every single person on the team is a great engineer (no doubts there!!!) but, they lack presentation skills and hence sometimes their work goes unappreciated because they couldn't explain what they did in laymen terms.&lt;/p&gt;

&lt;p&gt;Learn to shout about your work, that will get you your promotion/bonus/appreciation&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Ask for help when needed&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Juniors out there, you might be able to relate to this more than anyone else. Don't feel ashamed in asking for help when you need it, your teammates understand that you are new to this whole new world and you need a helping hand. It is also important to draw a line in between asking for help and being dependent on that help. Whenever you ask for help just tell the senior folk to point you in the correct direction and try and take it from there but never depend on them to write your code/logic for you because that is not going to help you trust me. So yes don't hesitate in asking for help and senior folks please don't be arrogant and just help juniors because you've been there in that situation.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;With time programming gets easier&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Well, this is a very controversial statement to make probably, but in my honest opinion programming gets easier as time passes by because after some time it just comes naturally to you. Yes, I agree there are some days when you wanna bang your laptop on that wall you've been staring at for a solution of a nasty bug but apart from those days, it will get pretty smooth. But, please don't bang your laptop instead take a pillow and beat the hell out of it. You'll thank me later for this advice.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Mingle with the community&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;The Tech community is the most welcoming community by far and the majority of folks working in tech are so very generous and helpful to everyone that no one feels alone out there. &lt;/p&gt;

&lt;p&gt;There are conferences going around everywhere in the world about the tools modern tech industries are using to build some exciting products, you'll also find folks making some really cool side projects and much more. Make sure to get some time out of your busy schedule and lookup for a small Meet-up happening in your neighborhood or some online tech conference because those are the places you are very much likely to meet some really cool people and who knows they might help you get your next dream job. Isn't that cool? All you have to do is meet people.&lt;/p&gt;




&lt;p&gt;That's it for this time, I promise to make this series of article an annual thing to do if people out there find it interesting and learn from it.&lt;/p&gt;

&lt;p&gt;If you wanna discuss tech or Breaking Bad or just say hi...&lt;/p&gt;

&lt;p&gt;Twitter - &lt;a href="https://twitter.com/thepunnyhooman"&gt;punnyhooman&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
    </item>
  </channel>
</rss>
