<?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: Yuto Takakura</title>
    <description>The latest articles on DEV Community by Yuto Takakura (@yutotakakura).</description>
    <link>https://dev.to/yutotakakura</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%2F1279399%2F1abc7b9c-e5d7-4598-9486-d2a47835de35.jpg</url>
      <title>DEV Community: Yuto Takakura</title>
      <link>https://dev.to/yutotakakura</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yutotakakura"/>
    <language>en</language>
    <item>
      <title>I contributed to OSS for the first time</title>
      <dc:creator>Yuto Takakura</dc:creator>
      <pubDate>Sat, 24 Feb 2024 10:54:14 +0000</pubDate>
      <link>https://dev.to/yutotakakura/i-contributed-to-oss-composer-for-the-first-time-3p6l</link>
      <guid>https://dev.to/yutotakakura/i-contributed-to-oss-composer-for-the-first-time-3p6l</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;I am in my third year of engineering, and ever since I became an engineer as a new graduate, I had a goal to contribute to OSS someday.&lt;/p&gt;

&lt;p&gt;Finally, I was able to contribute to the repositories and functions that I usually use, so I would like to summarize the background of my contribution.&lt;/p&gt;

&lt;h1&gt;
  
  
  Contents of Contribute
&lt;/h1&gt;

&lt;p&gt;The merged PR is as follows&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/composer/composer/pull/11816" rel="noopener noreferrer"&gt;https://github.com/composer/composer/pull/11816&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The repository is &lt;a href="https://getcomposer.org/" rel="noopener noreferrer"&gt;Composer&lt;/a&gt;.&lt;br&gt;
It is a package management tool, familiar to anyone who uses PHP.&lt;/p&gt;

&lt;p&gt;It is almost always used in modern PHP development.&lt;br&gt;
I also use PHP and Laravel in my work, and I use Composer every day as a matter of course.&lt;/p&gt;

&lt;p&gt;The content of the contribution is to add test code.&lt;br&gt;
There is a command called "self-update" that allows version control of Composer itself, and I created a test case for that command from scratch.&lt;/p&gt;

&lt;p&gt;The coverage was about 40%.&lt;br&gt;
I tried to increase the coverage a little more, but with my ability, it would have taken a lot of time to do more, so I decided to call it a day and submitted a PR.&lt;/p&gt;

&lt;h1&gt;
  
  
  How I found a contrib opportunity.
&lt;/h1&gt;

&lt;p&gt;I found it on a website called &lt;a href="https://goodfirstissue.dev/" rel="noopener noreferrer"&gt;Good First Issue&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It is a site that summarizes recent issues labeled &lt;code&gt;good first issue&lt;/code&gt;, which means for beginners in OSS activities, by language.&lt;/p&gt;

&lt;p&gt;I first came across this site about two months ago, and I have been visiting it every few days since then. One day I found this Issue posted on the site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/composer/composer/issues/10796" rel="noopener noreferrer"&gt;https://github.com/composer/composer/issues/10796&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This issue said that "We don't have enough coverage of command test code at all, so please write more and more test code!"&lt;/p&gt;

&lt;p&gt;I thought I could do it if I add test codes.&lt;br&gt;
I had been investigating PHPUnit for the introduction of test codes at work, so I also wanted to try to output some test codes.&lt;/p&gt;

&lt;p&gt;I learned that there is no test code yet for the self-update command, which I use frequently in my daily work, so I decided to write a test for this command. I thought it would be easy to write tests for this command since I use it regularly and know how it behaves.&lt;/p&gt;

&lt;h1&gt;
  
  
  Background to the merge
&lt;/h1&gt;

&lt;p&gt;I wrote the test code after work, and it took about 3 days.&lt;br&gt;
I was really nervous when I submitted the PR.&lt;/p&gt;

&lt;p&gt;After about two weeks, I received two suggestions.&lt;br&gt;
The first was that I should use PHPUnit's &lt;a href="https://docs.phpunit.de/en/11.0/writing-tests-for-phpunit.html#data-providers" rel="noopener noreferrer"&gt;data provider&lt;/a&gt;. You are right. You are right....&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F711yrbafk2ghtscsi366.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F711yrbafk2ghtscsi366.png" alt="Image description" width="800" height="459"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The second point you made was that I should have made sure to write the canned text that I write in every file. I missed it. My apologies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpg8zbxnjrotjmkekb53v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpg8zbxnjrotjmkekb53v.png" alt="Image description" width="800" height="692"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After I made the correction, they merged the files. it took about a month from the time I submitted the PR to the time of the merge, including the waiting time.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;I am honestly happy to have achieved one of my goals as an engineer.&lt;br&gt;
It makes me a little bit proud to think that my code, even if it's just a little bit, is now available to PHP developers all over the world as a part of Composer.&lt;/p&gt;

&lt;p&gt;Also, Composer recently underwent a &lt;a href="https://github.com/composer/composer/security/advisories/GHSA-7c6p-848j-wh5h" rel="noopener noreferrer"&gt;major vulnerability patching&lt;/a&gt;.&lt;br&gt;
When upgrading Composer, the self-update command is one of the most commonly used commands in the world. I am glad that I was able to make even a small contribution to improving the stability of the operation of the command.&lt;/p&gt;

&lt;p&gt;I highly recommend the &lt;a href="https://goodfirstissue.dev/" rel="noopener noreferrer"&gt;Good First Issue&lt;/a&gt; site to anyone interested in OSS activities.&lt;br&gt;
I will continue to check it regularly to see if there are any Issues that I can respond to.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
