Cookie Consent by Free Privacy Policy Generator ๐Ÿ“Œ AI-Powered Pull Requests: CodiumAI vs GitHub Copilot

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š AI-Powered Pull Requests: CodiumAI vs GitHub Copilot


๐Ÿ’ก Newskategorie: Programmierung
๐Ÿ”— Quelle: dev.to

In the past year, AI has become an essential part of developersโ€™ lives. Back then, it could only write simple code snippets, now it can analyze and refactor whole codebases. With the rapid development of AI, weโ€™ve raised our expectations and weโ€™re now waiting for something even better.

With our eyes on the horizon for the next features in Copilot X, a representative from CodiumAI reached out to me, suggesting the creation of an article showcasing features that we can try out right away. Particularly an AI copilot for writing and reviewing pull requests.

Imagine there was an AI copilot that could help in describing PR changes, reviewing them, and suggesting improvements to them. The life of many open-source contributors and maintainers could be so much easier. Well, CodiumAI PR-Agent is exactly that tool!

Overview

Alright, so hereโ€™s how it works. Add a comment to any public pull request on GitHub with the following text:

@CodiumAI-Agent /review

After ~30 seconds youโ€™ll see a comment from CodiumAI-Agent with bullet points about the PR (such as theme, summary, type, estimated effort to review, etc.) and some feedback on it.

In the same way, you can replace /review with one of many other commands to get various descriptions, suggestions, and feedback from the agent.

Write better PR descriptions with the help of AI

Find me a developer who had dedicated a substantial amount of time to implementing a feature or resolving a challenging bug and then didnโ€™t feel want to finally send the code to production. In that moment of exhaustion, all you want to do is hit the merge button and take a well-deserved break.

Although itโ€™s quite understandable, this often results in PRs like:

Fixed some things

I made some changes to improve the data processing in the data_handler.py file.

It doesnโ€™t provide any specific details about what improvements were made. The pull request lacks context about the motivation behind the changes. Neither does it mention whether the changes have been tested.

Both GitHub Copilot and CodiumAI aim to fix this problem by generating PR descriptions with a summary and a detailed list of changes.

Letโ€™s take the previous example, where I had a pull request that improves the logic of habit status computation in a habit-tracking app. Hereโ€™s the CodiumAI Agentโ€™s review of the PR:

PR Analysis
  • ๐ŸŽฏ Main theme: Refactoring and improving the logic of habit status computation
  • ๐Ÿ“ PR summary: This PR refactors the 'Routine' class to 'Habit' and rewrites the logic of habit status computation. It replaces 'HistoricalStatus' and 'PlanningStatus' with 'HabitStatus' and adds additional statuses for clarity. The computation of historical and future statuses is now done on the go instead of being cached in the database.
  • ๐Ÿ“Œ Type of PR: Enhancement
  • ๐Ÿงช Relevant tests added: No
  • โฑ๏ธ Estimated effort to review [1-5]: 4, because the PR contains a significant amount of changes in the logic of habit status computation and renaming of classes and variables, which requires a thorough understanding of the existing codebase to review effectively.
  • ๐Ÿ”’ Security concerns: No security concerns found

First, it determines the main theme, which may serve as a title. It suggests the PR summary that indeed matches what is done. Then, it determines the type of PR and whether the relevant tests were added. In addition, it estimates the effort to review and tells if there are any security concerns.

If you choose one of the different ways to use the agent, which weโ€™ll cover later on in the article, it will be able to automatically update the title and description and also add labels to the PR. Use /describe command for that:

CodiumAIโ€™s PR-Agent can also write a detailed list of changes and update your CHANGELOG.md. For that, use the update_changelog command:

Among the mentioned features, GitHub Copilotโ€™s abilities are limited to crafting titles and descriptions with the help of copilot:summary. It also can write a detailed list of changes through copilot:walkthrough command.

Get feedback and suggestions

Alongside PR analysis, the agent gave the following PR feedback upon running the /review command:

๐Ÿ’กย General suggestions:ย The PR includes a significant amount of refactoring and changes in the logic of habit status computation. It would be beneficial to include unit tests to ensure the new logic works as expected and to prevent potential regressions in the future. Additionally, it would be helpful to provide more context in the PR description about why these changes were necessary and how they improve the codebase.

So what itโ€™s just done is address two main issues that may prevent this pull request from being merged:

  1. The PR does not include unit tests.
  2. The motivation behind the changes is missing.

Additionally, it provided detailed code feedback with references to specific files and even lines of code:

๐Ÿค– Code feedback

relevant file core/database/src/main/java/com/rendox/routinetracker/core/database/routine/RoutineLocalDataSourceImpl.kt
suggestion Consider using a data mapping layer or a mapper function to convert between the database entity and the domain model. This can help to keep the conversion logic in one place and make the code more maintainable. [important]
relevant line https://github.com/DanielRendox/RoutineTracker/pull/4/files#diff-96a0c9cda6be7f77af13589758d30c625a761d0b1aca0e4fc5980b966fb8baecR13
relevant file core/domain/src/main/java/com/rendox/routinetracker/core/domain/completion_history/use_cases/GetRoutineStatusUseCase.kt
suggestion It would be better to separate the logic of prepopulating history with missing dates into a separate function or use case. This would make the code more modular and easier to test. [important]
relevant line https://github.com/DanielRendox/RoutineTracker/pull/4/files#diff-a8044fd1c82f20ee81e28bdab1ff37151be709abc2ce52f5d96fba1e645de6f6R58
relevant file core/domain/src/test/java/com/rendox/routinetracker/core/domain/routine/schedule/ScheduleIsDueTest.kt
suggestion Consider using parameterized tests or data-driven tests for testing the same logic with different inputs. This can help to reduce the amount of repetitive test code and make the tests more readable. [medium]
relevant line https://github.com/DanielRendox/RoutineTracker/pull/4/files#diff-41e217a89b141d2ec28631d7767ce69b186ef4bdb61ded70ad6e5af91af09007R4
relevant file core/domain/src/main/java/com/rendox/routinetracker/core/domain/completion_history/use_cases/GetRoutineStatusUseCase.kt
suggestion Consider using a strategy pattern or a similar design pattern for computing future statuses. This can help to make the code more flexible and easier to extend in the future. [medium]
relevant line https://github.com/DanielRendox/RoutineTracker/pull/4/files#diff-a8044fd1c82f20ee81e28bdab1ff37151be709abc2ce52f5d96fba1e645de6f6R90

But hold on, there is something even more impressive. You can ask follow-up questions! Check this out:

Image description

Moreover, it can also modify the code that needs to be improved with the help of the improve command. This can be something simple such as a naming inconsistency that your IDE has not been able to detect:

Rename the variable 'routineId' to 'habitId' to match the new naming convention:

Existing code:

val previousStreak = streakRepository.getStreakByDate(
    routineId = habit.id!!,
    dateWithinStreak = date.minus(DatePeriod(days = 1)),
)

Improved code:

val previousStreak = streakRepository.getStreakByDate(
    habitId = habit.id!!,
    dateWithinStreak = date.minus(DatePeriod(days = 1)),
)

Or it may point to a missing test case:

Image description

Isnโ€™t that cool? It now motivates me to submit pull requests for my personal projects, where I'm the only contributor because there is no one else to review my code.

With all this automatic feedback, people can not only learn how to write good pull requests but also learn about programming practices that they might otherwise overlook. Take, for instance, one of the code feedback suggestions that recommended utilizing parameterized tests. One might be unaware that such a thing exists.

GitHub Copilot currently does not provide any of the functionality described in this section.

Even more commands!

Unlike Copilot, CodiumAI also supports commands like:

similar_issue: retrieves and presents similar issues;

generate_labels: suggests custom labels based on the PR code changes.

add_doc: adds documentation to undocumented functions/classes.

Moreover, commands can be appended with a parameter from the configuration.toml file. For example,

/describe --extra_instructions = "Emphasize that ..."

Supported platforms and different ways to use

For simple usage, it may be enough to call @CodiumAI-Agent every time. However, this approach has several limitations, such as:

  • Multiple comments from the agent can potentially clutter the conversation. You may want to write everything on your behalf so that you can easily delete these comments.
  • CodiumAI-Agent canโ€™t edit comments, files, and PRs.
  • It can't be used for private repositories.

Fortunately, there are solutions to all the listed cases, as well as numerous other scenarios where a more nuanced control is desired. To cater to any of these situations, youโ€™ll need to install the agent in one of the following ways:

Locally

GitHub specific methods

GitLab specific methods

BitBucket specific methods

BTW, you may have noted that in contrast to Copilot, CodiumAI's availability is not limited to GitHub. It also gives you a choice between different AI models, such as GPT-4, GPT-3.5, Anthropic, Cohere, and Llama2 models.

However, itโ€™s important to note that in order to install the PR agent, an API key of one of the supported models is required. In this case, CodiumAIโ€™s services stay free, but the requests to the model itself may require additional fees.

Itโ€™s also possible to run the PR-Agent in VS Code or any of JetBrains IDEs. This functionality is included in the CodiumAI IDE plugin. But note that it requires a CodiumAI Teams subscription.

Response time

Both Copilot and CodiumAI respond in approximately 30 seconds on average. Roughly 10 seconds after submitting a command, the ๐Ÿ‘€ emoji appears to indicate that the result is loading.

Among the things I didnโ€™t like is that when some exception occurs, you donโ€™t see any response at all. Youโ€™re left wondering whether itโ€™s still loading or not. It would also be great if the generated part of the response was visible while it was being constructed.

Nevertheless, this differs when it comes to the CodiumAI PR-Agent within the IDE. It does display partial responses, so you donโ€™t need to wait. Additionally, I noticed that its response time is a lot quicker in the IDE, typically taking 15โ€“20 seconds.

Generating tests

One of the most common things that donโ€™t allow PRs to get merged is the lack of necessary unit tests, which makes generating them directly in pull requests one of the most promising things AI tools can provide.

GitHub plans to solve this problem by introducing a GenTest feature that will offer suggestions on resolving issues that would analyze the PR for missing tests and then create another pull request that suggests the necessary unit tests. Unfortunately, this feature is still not released publicly.

For now, CodiumAI does not have such a feature either, although the PR-Agent does address the absence of unit tests.

However, you can use the /ask command to get detailed test suggestions and then go back to your IDE and write them there. Thatโ€™s exactly what they specialize in when it comes to their IDE code assistant.

Ghost text

This one is actually where the GitHub Copilot is most likely to win. Itโ€™s about the subdued, inline suggestions that appear as you type in the editor.

When it comes to the Copilot IDE plugin, these suggestions have been proven to be one of the most convenient ways AI can integrate into the development workflow. Now they are working on bringing this UX to the pull request experience.

Image description

So what is better?

Alright, so both assistants have great potential to improve our workflow, save time, and automate tedious tasks. Iโ€™m looking toward the future where such tools integrate seamlessly into the development process.

As we are waiting for the new cool AI features, let's now determine which of these two is currently superior.

Letโ€™s address the elephant in the room, from all the described features, GitHub Copilot only has PR summaries available at the moment. To get access to this tool, you must sign up for a waitlist for Copilot Enterprise, which costs 39$ per user/month. But to sign up, you need GitHub Enterprise Cloud, which, in turn, costs 21$ per user/month. Other GitHub Copilot features are currently not available at all! For now, they are only planned as a part of the Copilot X prototype.

But letโ€™s not underestimate it. According to GitHub Next, the planned features are quite promising and it may be great for user experience in the future.

CodiumAI, on the other hand, lets us try the cutting-edge technology right now. It provides more commands, is open-source, and is well-documented. It also gives us ample opportunities for customization. In terms of pricing, we can use it for free, or opt for one of theย paid plansย that offer more features.

CodiumAI has plans on its roadmap too. For example, enforcing CONTRIBUTING.md guidelines.

Conclusion

Iโ€™m quite impressed with the power of these tools. We can now automate AI responses for our repositories however we want. I can see such PR agents operate in tandem with tools like CI/CD pipelines in the future, and serve as efficient and quick-to-respond intermediaries for creating and reviewing PRs.

...



๐Ÿ“Œ Unveiling CodiumAI PR-Agent: A Comparative Analysis Against GitHub Copilot for Pull Requests


๐Ÿ“ˆ 71.57 Punkte

๐Ÿ“Œ CodiumAI's PR-Agent vs. GitHub Copilot: The Battle of the Pull Request AI Assistants.


๐Ÿ“ˆ 59.51 Punkte

๐Ÿ“Œ Navigating the Code: A Comparative Analysis of CodiumAI PR-Agent and GitHub Copilot in Code Assistance and Review


๐Ÿ“ˆ 44.64 Punkte

๐Ÿ“Œ Comparing CodiumAI PR Agent To GitHub Copilot


๐Ÿ“ˆ 44.64 Punkte

๐Ÿ“Œ The power of GitHub Copilot Chat for pull requests (PART 2)


๐Ÿ“ˆ 43.53 Punkte

๐Ÿ“Œ The power of GitHub Copilot Chat for pull requests (PART 1)


๐Ÿ“ˆ 43.53 Punkte

๐Ÿ“Œ GitHub announces the preview of GitHub Copilot Enterprise and general availability of GitHub Copilot Chat


๐Ÿ“ˆ 40.6 Punkte

๐Ÿ“Œ GitHub fรผhrt Reaktionen auf Pull Requests, Issues und Kommentare ein


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ GitHub Pull Requests for VS Code


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Introducing GitHub Pull Requests for Visual Studio Code


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Git your patches here! GitHub offers to brew automatic pull requests loaded with vuln fixes


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Introducing GitHub Pull Requests for Visual Studio Code


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ GitHub Mobile 1.2 รผberarbeitet den Review-Prozess bei Pull Requests


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Mit GitHub Enterprise Server 2.21 Pull Requests in Drafts umwandeln


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Visual Studio Code 1.51 setzt Arbeit an GitHub Pull Requests and Issues fort


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Visual Studio Code 1.51 setzt Arbeit an GitHub Pull Requests and Issues fort


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ GitHub fรผhrt Reaktionen auf Pull Requests, Issues und Kommentare ein


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ GitHub rolls out dependency review, vulnerability alerts for pull requests


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ GitHub Security Lab: 3,880 Pull Requests Generated to fix JHipster RNG Vulnerability CVE-2019-16303


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Microsoft GitHub Pull Requests and Issues Extension on Visual Studio Remote Code Execution


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ GitHub fรผr iOS: Pull-Requests lassen sich jetzt auch schnell mobil bearbeiten


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ GitHub Desktop 3.2 bietet lokale Vorschau fรผr Pull Requests


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ GitHub Desktop 3.2: Vorschau fรผr deine Pull Requests


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Brave browser AI assistant Leo can now generate summaries for GitHub pull requests


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ actions-hottest๐Ÿš€: GitHub Actions for Commenting on Golang Unit Test Results in Pull Requests


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Otimize seu fluxo de desenvolvimento no GitHub: Criando Templates de Pull Requests para uma Colaboraรงรฃo Mais Eficiente


๐Ÿ“ˆ 34.3 Punkte

๐Ÿ“Œ Learning AI w GitHub Copilot: Analyzing Computer Vision PyTorch Notebook w GitHub Copilot Labs [5/6]


๐Ÿ“ˆ 33.22 Punkte

๐Ÿ“Œ Learning AI with GitHub Copilot: Computer vision and PyTorch with GitHub Copilot [Part 4 of 6]


๐Ÿ“ˆ 33.22 Punkte

๐Ÿ“Œ Learning AI with GitHub Copilot: Building a classifier model with GitHub Copilot [Part 3 of 6]


๐Ÿ“ˆ 33.22 Punkte

๐Ÿ“Œ Learning AI with GitHub Copilot: Exploring machine learning fundamentals w GitHub Copilot [Part 2/6]


๐Ÿ“ˆ 33.22 Punkte

๐Ÿ“Œ GitHub Copilot X: GPT-4-Assistent von der Kommandozeile bis zum Pull Request


๐Ÿ“ˆ 31.48 Punkte

๐Ÿ“Œ Future of AI Development: CodiumAI's VSCode extension


๐Ÿ“ˆ 28.03 Punkte

๐Ÿ“Œ Effortless PR Handling: CodiumAI's PR-Agent for Developers


๐Ÿ“ˆ 28.03 Punkte

๐Ÿ“Œ How To Generate Tests Using CodiumAI


๐Ÿ“ˆ 28.03 Punkte

๐Ÿ“Œ Boosting Code Security with Generative AI Coding Assistants for Buffer Overflow Attack Prevention - CodiumAI


๐Ÿ“ˆ 28.03 Punkte











matomo