<?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: Kapil Rathore</title>
    <description>The latest articles on DEV Community by Kapil Rathore (@kapil_rathore_ef17fa2ce08).</description>
    <link>https://dev.to/kapil_rathore_ef17fa2ce08</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%2F3987034%2Fafc56f23-1755-4dfc-9ddc-042c427127de.png</url>
      <title>DEV Community: Kapil Rathore</title>
      <link>https://dev.to/kapil_rathore_ef17fa2ce08</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kapil_rathore_ef17fa2ce08"/>
    <language>en</language>
    <item>
      <title>How I Found Real Bugs in MoneyPrinterTurbo, CodeceptJS, and Magento — And Got Them Merged</title>
      <dc:creator>Kapil Rathore</dc:creator>
      <pubDate>Tue, 16 Jun 2026 09:10:52 +0000</pubDate>
      <link>https://dev.to/kapil_rathore_ef17fa2ce08/how-i-found-real-bugs-in-moneyprinterturbo-codeceptjs-and-magento-and-got-them-merged-56k3</link>
      <guid>https://dev.to/kapil_rathore_ef17fa2ce08/how-i-found-real-bugs-in-moneyprinterturbo-codeceptjs-and-magento-and-got-them-merged-56k3</guid>
      <description>&lt;h1&gt;
  
  
  How I Found Real Bugs in MoneyPrinterTurbo, CodeceptJS, and Magento — And Got Them Merged
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;A QA engineer's journey into open source contribution&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Problem I Was Trying to Solve
&lt;/h2&gt;

&lt;p&gt;I work as a QA Automation Engineer. Every day I see the same pattern — a developer pushes a commit, QA gets it, and we test... everything. The entire regression suite. Even when only one small thing changed.&lt;/p&gt;

&lt;p&gt;I thought: &lt;em&gt;what if a tool could tell you exactly what to test, based on what actually changed?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;So I started building one. And to validate it, I needed real code. Real commits. Real bugs.&lt;/p&gt;

&lt;p&gt;That's how I ended up contributing to three major open source repositories.&lt;/p&gt;




&lt;h2&gt;
  
  
  Repo 1 — MoneyPrinterTurbo (25k+ ⭐)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Bug: Groq provider had no default model name&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While analyzing a recent commit that added Groq as an LLM provider, I noticed something inconsistent.&lt;/p&gt;

&lt;p&gt;Every other provider in &lt;code&gt;llm.py&lt;/code&gt; had a default model name configured:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Other providers — defaults exist
&lt;/span&gt;&lt;span class="n"&gt;g4f&lt;/span&gt;        &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gpt-3.5-turbo-16k-0613&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;gemini&lt;/span&gt;     &lt;span class="err"&gt;→&lt;/span&gt; &lt;span class="n"&gt;_DEFAULT_GEMINI_MODEL&lt;/span&gt;

&lt;span class="c1"&gt;# Groq — no default ❌
&lt;/span&gt;&lt;span class="n"&gt;groq_model_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The WebUI had a default (&lt;code&gt;llama-3.3-70b-versatile&lt;/code&gt;), but users running via &lt;code&gt;config.toml&lt;/code&gt; only — without the WebUI — would hit a validation error silently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The fix:&lt;/strong&gt; Add a service-side default for Groq in &lt;code&gt;llm.py&lt;/code&gt;, consistent with other providers.&lt;/p&gt;

&lt;p&gt;Harry (the maintainer) reviewed it, agreed, and merged it. ✅&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Bug 2: CLI validation gaps for &lt;code&gt;--video-source local&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A second analysis found two validation gaps in the newly added CLI:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;--stop-at terms&lt;/code&gt; silently returned empty terms when &lt;code&gt;--video-source local&lt;/code&gt; was set — no error, no warning, just &lt;code&gt;{"terms": ""}&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Missing &lt;code&gt;--video-materials&lt;/code&gt; was only caught &lt;em&gt;after&lt;/em&gt; expensive LLM + TTS steps completed — failing at Step 5 with a generic error, wasting all that compute.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Fix — fail fast at parse time
&lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;video_source&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;local&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;video_materials&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;parser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--video-materials is required when --video-source is local&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both guards were added. PR merged. ✅&lt;/p&gt;




&lt;h2&gt;
  
  
  Repo 2 — CodeceptJS (10k+ ⭐)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Bug: &lt;code&gt;--shuffle&lt;/code&gt; flag silently ignored&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This one was subtle. A previous PR (#5438) had added &lt;code&gt;this.testFiles.sort()&lt;/code&gt; in &lt;code&gt;run()&lt;/code&gt; to fix worker suite distribution — a correct fix for that problem. But it introduced a regression:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// loadTests() — shuffles correctly when --shuffle is set&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shuffle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;testFiles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;shuffle&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;testFiles&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;// ✅&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// run() — always sorts, silently overwriting the shuffle ❌&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;testFiles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every time &lt;code&gt;--shuffle&lt;/code&gt; was set, the randomized order was immediately overwritten by the unconditional sort. The flag appeared to work — no error, no warning — but tests always ran in the same alphabetical order.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; One guard condition:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;opts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;shuffle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;testFiles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DavertMik — the creator of CodeceptJS — reviewed and merged it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Thank you for catching it!"&lt;/em&gt; — his exact words. ✅&lt;/p&gt;




&lt;h2&gt;
  
  
  Repo 3 — Magento / Adobe Commerce (14k+ ⭐)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Bug: Race condition crashes entire bulk price update batch&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;While reviewing a recent commit (&lt;code&gt;ACP2E-4998&lt;/code&gt;) that fixed a &lt;code&gt;NoSuchEntityException&lt;/code&gt; in &lt;code&gt;TierPriceValidator&lt;/code&gt;, I noticed the fix was incomplete.&lt;/p&gt;

&lt;p&gt;The same race condition existed in a sibling class — &lt;code&gt;InvalidSkuProcessor&lt;/code&gt; — which is used by all three bulk price APIs (base price, special price, tier price).&lt;/p&gt;

&lt;p&gt;The flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;retrieveProductIdsBySkus()&lt;/code&gt; builds a list of valid SKUs&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;productRepository-&amp;gt;get($sku)&lt;/code&gt; is called on each SKU — &lt;em&gt;without a try/catch&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;If a product is deleted between steps 1 and 2 (concurrent catalog modification), &lt;code&gt;NoSuchEntityException&lt;/code&gt; propagates uncaught and &lt;strong&gt;kills the entire batch&lt;/strong&gt; — all other valid SKUs are discarded silently
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Before — crashes entire batch if product deleted between lookup and fetch&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$allowedPriceTypeValue&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$type&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="nc"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;TYPE_BUNDLE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;productRepository&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$sku&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// ⚠️ throws if deleted&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getPriceType&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="nv"&gt;$allowedPriceTypeValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$valueTypeIsAllowed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// After — graceful handling&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$this&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;productRepository&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$sku&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$product&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getPriceType&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="nv"&gt;$allowedPriceTypeValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$valueTypeIsAllowed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;NoSuchEntityException&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$skuDiff&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$sku&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;// treat as invalid SKU and continue&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same pattern was already fixed in &lt;code&gt;TierPriceValidator::checkQuantity()&lt;/code&gt; — &lt;code&gt;InvalidSkuProcessor&lt;/code&gt; was just missed.&lt;/p&gt;

&lt;p&gt;PR submitted and all tests passing (Unit, Static, WebAPI). Under review by the Adobe team. 🤞&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Real bugs hide in plain sight&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;None of these were exotic vulnerabilities. They were logic gaps — a missing guard, a missing default, a flag that silently did nothing. The kind of thing that slips through because the code &lt;em&gt;runs&lt;/em&gt;, it just doesn't &lt;em&gt;work correctly&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. One commit tells a story&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Looking at a commit in isolation is powerful. The Groq bug was visible &lt;em&gt;because&lt;/em&gt; I was focused on just that commit — what changed, what didn't, what &lt;em&gt;should&lt;/em&gt; have changed but wasn't touched.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Open source maintainers are generous&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Every maintainer responded quickly, reviewed carefully, and gave detailed feedback — even when they disagreed. Harry, DavertMik, the Magento team — all professional and kind.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Validation matters&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Not every finding was correct. One security analysis I submitted was rejected — the maintainer showed me defense layers I hadn't seen (framework-level sanitization that wasn't visible from the diff alone). That's part of the process. The goal is to be genuinely helpful, not to rack up PRs.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;I'm continuing to analyze more repositories using the same methodology. If you're a maintainer and want a free regression analysis of a recent PR or commit — feel free to reach out.&lt;/p&gt;

&lt;p&gt;And if you're a QA engineer wondering whether open source contribution is worth your time — it absolutely is. You learn faster, you build credibility, and you contribute something real.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Thanks for reading. If this was useful, I'd love to hear your thoughts in the comments.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>qa</category>
      <category>testing</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
