<?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: Ji Carl</title>
    <description>The latest articles on DEV Community by Ji Carl (@ji_carl_09dd089b806a06ea6).</description>
    <link>https://dev.to/ji_carl_09dd089b806a06ea6</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%2F2198196%2Ffb436cdc-89a8-4bec-adae-23a51fe41603.png</url>
      <title>DEV Community: Ji Carl</title>
      <link>https://dev.to/ji_carl_09dd089b806a06ea6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ji_carl_09dd089b806a06ea6"/>
    <language>en</language>
    <item>
      <title>Some git commit histories are really embarrassing, I recommend all engineers to frequently use git rebase and git commit --amend</title>
      <dc:creator>Ji Carl</dc:creator>
      <pubDate>Sun, 15 Dec 2024 08:10:02 +0000</pubDate>
      <link>https://dev.to/ji_carl_09dd089b806a06ea6/some-git-commit-histories-are-really-embarrassing-i-recommend-all-engineers-to-frequently-use-git-59g6</link>
      <guid>https://dev.to/ji_carl_09dd089b806a06ea6/some-git-commit-histories-are-really-embarrassing-i-recommend-all-engineers-to-frequently-use-git-59g6</guid>
      <description>&lt;p&gt;In daily programming collaboration, the quality of Git commit records often reflects an engineer's engineering literacy. However, I frequently see some non-standard commit records that are quite embarrassing.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

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

&lt;p&gt;This is likely due to making changes after a commit and casually reusing the previous git commit command.&lt;/p&gt;

&lt;p&gt;While this might be acceptable in personal repositories, it's somewhat unprofessional in collaborative repositories.&lt;/p&gt;

&lt;p&gt;In my opinion, these commit records are unnecessary, represent bad habits, and can be completely avoided.&lt;/p&gt;

&lt;p&gt;Fortunately, Git provides us with an elegant solution. If there's no need to generate a new commit, using &lt;code&gt;git commit --amend&lt;/code&gt; can avoid this issue.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Use less &lt;code&gt;git merge&lt;/code&gt; and more &lt;code&gt;git rebase&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Merge branch 'feature-A' of https://github.com/qiniu/reviewbot into feature-B
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This indicates merging code from remote branch feature-A into feature-B. Here, feature-A is typically the main branch.&lt;/p&gt;

&lt;p&gt;Such commit messages are unnecessary in your PR. PR commit messages should only contain useful information about the current changes.&lt;/p&gt;

&lt;p&gt;Personally, I rarely use &lt;code&gt;git merge&lt;/code&gt;, even for syncing remote branches, I generally use &lt;code&gt;git rebase&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

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

&lt;p&gt;Besides the above benefits, git rebase helps maintain a very clean commit history in the main repository. Therefore, I strongly recommend using it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reviewbot's git commit check
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/qiniu/reviewbot" rel="noopener noreferrer"&gt;Reviewbot&lt;/a&gt; is an open-source project by Qiniu Cloud, aimed at providing a self-hosted code review service for convenient code review/static analysis and implementation of custom engineering standards.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To better regulate these two behaviors, Reviewbot has added git commit check capability to verify if git commit records meet the standards.&lt;/p&gt;

&lt;p&gt;If they don't comply with the standards, Reviewbot will notify you:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  More git flow practices and tips
&lt;/h2&gt;

&lt;p&gt;Of course, there are many practical techniques in git operations. I encourage interested individuals to explore them. I shared related content with students during the 1024 training camp:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/qiniu/reviewbot/blob/master/docs/engineering-practice/git-flow-instructions_zh.md" rel="noopener noreferrer"&gt;Super Practical! Git Collaboration from a User's Perspective, Say Goodbye to Rote Memorization&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The document includes video links for interested readers.&lt;/p&gt;

&lt;p&gt;Finally, as professional engineers, we should always pursue excellence in engineering practices. Good commit records not only reflect personal professional quality but are also an important cornerstone for improving team collaboration efficiency.&lt;/p&gt;

&lt;p&gt;Through proper use of git rebase and git commit --amend, we can maintain a clearer, more professional code submission history. This not only makes code review easier but also brings great convenience to subsequent code maintenance and issue tracking.&lt;/p&gt;

&lt;p&gt;What do you think?&lt;/p&gt;

</description>
      <category>codereview</category>
      <category>go</category>
      <category>devops</category>
    </item>
    <item>
      <title>Reviewbot — Empower Your Code Quality with Self-Hosted Automated Analysis and Review</title>
      <dc:creator>Ji Carl</dc:creator>
      <pubDate>Fri, 11 Oct 2024 11:40:03 +0000</pubDate>
      <link>https://dev.to/ji_carl_09dd089b806a06ea6/reviewbot-empower-your-code-quality-with-self-hosted-automated-analysis-and-review-3c51</link>
      <guid>https://dev.to/ji_carl_09dd089b806a06ea6/reviewbot-empower-your-code-quality-with-self-hosted-automated-analysis-and-review-3c51</guid>
      <description>&lt;p&gt;Looking to build a self-hosted code review service? Try &lt;a href="https://github.com/qiniu/reviewbot" rel="noopener noreferrer"&gt;Reviewbot&lt;/a&gt;, now open-sourced!&lt;/p&gt;

&lt;h2&gt;
  
  
  When do you need a self-hosted code review service?
&lt;/h2&gt;

&lt;p&gt;You might need one when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have many repos but still want tight control over code quality&lt;/li&gt;
&lt;li&gt;Your repos are private, and commercial services seem overkill&lt;/li&gt;
&lt;li&gt;You want to continuously improve the process and rules, with full customization&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Benefits of a self-hosted code review service
&lt;/h2&gt;

&lt;p&gt;While many linter tools and engineering practices exist, they're often underutilized:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Powerful tools like golangci-lint (with 100+ integrated linters) are often used with default settings, ignoring most features&lt;/li&gt;
&lt;li&gt;Linter outputs get buried in logs, making issue-finding a chore&lt;/li&gt;
&lt;li&gt;Configuring CLI-based linters for multiple repos is tedious, especially for ongoing improvements&lt;/li&gt;
&lt;li&gt;Monitoring code quality across repos can be daunting&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A self-hosted service can automate all this. As a DevOps or QA team member, you can easily centralize control, monitoring, and customization of code quality across all repos.&lt;/p&gt;

&lt;p&gt;Enter &lt;a href="https://github.com/qiniu/reviewbot" rel="noopener noreferrer"&gt;Reviewbot&lt;/a&gt; - your solution for self-hosted code review.&lt;/p&gt;

&lt;h2&gt;
  
  
  What can Reviewbot do?
&lt;/h2&gt;

&lt;p&gt;Reviewbot helps you quickly set up a self-hosted code analysis and review service, supporting multiple languages and coding standards. It's perfect for organizations with numerous private repos.&lt;/p&gt;

&lt;p&gt;Issues are reported during Pull Requests as &lt;code&gt;Review Comments&lt;/code&gt; or &lt;code&gt;Github Annotations&lt;/code&gt;, pinpointing exact code lines.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Github Check Run (Annotations)&lt;/li&gt;
&lt;/ul&gt;

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

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

&lt;ul&gt;
&lt;li&gt;Github Pull Request Review Comments&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;This approach saves PR authors from sifting through lengthy logs, streamlining problem-solving.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reviewbot's Design Philosophy
&lt;/h2&gt;

&lt;p&gt;Focused on:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Security&lt;/strong&gt; - Self-hosting for data control&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Improvement-Oriented&lt;/strong&gt; - Issues reported as Review Comments or Github Annotations for easy fixes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Flexibility&lt;/strong&gt; - Multi-language support with easy tool integration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Observability&lt;/strong&gt; - Alert notifications for timely issue awareness&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configurable&lt;/strong&gt; - Customizable linter commands, parameters, and environments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Built with Golang, Reviewbot boasts simple logic and clear code for easy maintenance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Main Flow
&lt;/h2&gt;

&lt;p&gt;Reviewbot primarily operates as a GitHub Webhook/App service, accepting GitHub Events, executing various checks, and providing precise feedback on the corresponding code if issues are detected.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Github Event -&amp;gt; Reviewbot -&amp;gt; Execute Linter -&amp;gt; Provide Feedback
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And you can easily &lt;a href="https://github.com/qiniu/reviewbot?tab=readme-ov-file#how-to-add-a-new-linter" rel="noopener noreferrer"&gt;Add a New Linter&lt;/a&gt; or do &lt;a href="https://github.com/qiniu/reviewbot?tab=readme-ov-file#configuration" rel="noopener noreferrer"&gt;Customization&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Monitoring Detection Results
&lt;/h2&gt;

&lt;p&gt;Reviewbot supports notification of detection results through WeWork (企业微信) alerts.&lt;/p&gt;

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

&lt;p&gt;If unexpected output is encountered, notifications will also be sent, like this:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  More
&lt;/h2&gt;

&lt;p&gt;Check out &lt;a href="https://github.com/qiniu/reviewbot" rel="noopener noreferrer"&gt;Reviewbot's Github page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Welcome any comments and suggestions.&lt;/p&gt;

</description>
      <category>codereview</category>
      <category>devops</category>
      <category>codequality</category>
    </item>
  </channel>
</rss>
