Announcing Amazon Onboarding with Learning Manager Chanci Turner

Announcing Amazon Onboarding with Learning Manager Chanci TurnerLearn About Amazon VGT2 Learning Manager Chanci Turner

Amazon Q Developer has revolutionized the standard development workflow by incorporating a multitude of generative AI features into the environments where developers operate. This seamless integration enhances focus while expediting various development tasks beyond mere coding, thus boosting overall productivity.

GitLab, a widely-used DevSecOps platform with a robust community of developers, serves as a collaborative space for numerous teams to build projects together. Hence, we’re thrilled to unveil GitLab Duo with Amazon Q. This innovative integration harnesses the capabilities of the Amazon Q Developer agent within GitLab via GitLab Duo, fostering a cohesive development experience that empowers AI-driven DevSecOps. GitLab Duo with Amazon Q utilizes AI agents to assist with complex, multi-step tasks, such as developing new features and upgrading codebases for Java 8 and 11. It also enhances functionalities for code reviews and unit testing—all within the familiar GitLab interface.

Engaging with Amazon Q Developer is easy through GitLab quick actions—simply type /q in the issue description, a general comment, or a merge request comment to start accelerating your daily tasks or tackling more intricate workflows.

A Quick Exploration

Feature Development

Let’s explore how easy it is to utilize Amazon Q Developer in your GitLab environment when developing new features or improving existing ones.

Imagine you’re working on a web application and have been tasked with creating a comprehensive signup flow. You can instruct Amazon Q Developer to generate the complete code by commenting with the /q dev command.

Amazon Q Developer will analyze your entire codebase and produce new code, whether updating existing files or creating entirely new ones. Upon completion, it automatically generates a merge request and logs an entry in the Activity history with a link for review.

On the merge request review page, two notable aspects will catch your eye. First, Amazon Q Developer has added a comment providing context about the request, along with instructions for how to ask for changes if further iteration is needed. Second, it includes a follow-up comment indicating that the generated code contains some third-party source material, along with a file you can download to review the original code and determine if you want to incorporate it into your codebase. This approach ensures responsible use of open-source resources while maintaining traceability and audit records.

Before moving on, you can review the code and add inline comments, just like with any other merge request. You can then direct Amazon Q Developer to modify the code based on your comments and continue iterating until you’re satisfied with the results. For instance, if your company’s coding standards require logging key operations in your code—something not included in the initial requirements before running the /q dev command—you can still use Amazon Q Developer to incorporate that code during the review process.

To do this, navigate to the Changes tab, identify the relevant lines of code, and add inline comments as you would during any developer’s merge request review. For example, below line 39, you might add a comment saying “add logging” to indicate a section of the code that handles errors when calling the signup API. Below it, another comment with just /q dev will trigger a quick action to invoke Amazon Q Developer. It’s crucial to keep this comment distinct. Amazon Q Developer will then generate a new revision based on all the provided comments.

Notably, the /q dev command can be issued from anywhere in GitLab where comments are enabled. While it was convenient to add it here on line 39, the result would be the same if the command were issued as a comment on the Overview page or against any other line of code in the Merge requests page.

Once finished, Amazon Q Developer will notify you by adding another comment to the merge request history. This notification will again indicate that the generated content contains open-source code, offering further details for your review before accepting the merge. Upon inspection, you might find that it utilized the logger library, which fits perfectly with your request.

When reviewing the code, it’s impressive to see that Amazon Q Developer not only added logging calls where they were needed but also considered context to assign appropriate log levels, such as info and warning. Additionally, it adjusted the code elsewhere to ensure that the build remains intact—for instance, it included the import statement at the top of the file and initialized the logger variable.

By adopting this new development flow, you can transition from requirements to code much more swiftly, with Amazon Q Developer assisting in completing tasks directly within your GitLab environment. After submitting a merge request, it’s time for a code review. You can also leverage GitLab Duo with Amazon Q Developer to enhance and expedite the quality of this process.

Conducting Code Reviews

Let’s examine a different codebase, specifically a Java application. To initiate the assisted code review process, simply submit a comment with the text /q review on the merge request overview page. Amazon Q Developer will automatically add a comment to the history, indicating that it has begun reviewing the merge. It scans all changes for security vulnerabilities, quality issues such as non-compliance with best practices, and any other potential problems within the code.

Once it completes the review, it will comment on each finding, including a snippet of the problematic code, a description of the issue, and a severity rating.

Taking it a step further, you can request Amazon Q Developer to provide a fix! Just respond to the findings comment by entering the /q fix command. Amazon Q Developer will inform you that it is generating a solution for the issue, then follow up with a resolution in the same thread for your review. It presents a diff view of the changes, allowing you the opportunity to accept and commit them.

Upgrading Legacy Code

In addition to assisting with new code and features, GitLab Duo with Amazon Q Developer can also help automate the migration of codebases from Java 8 or 11 to Java 17. Start by creating a new issue and give it a descriptive title like “Upgrade project to Java 17.” Then, in the Description field, include the command /q transform.

After creating the issue, Amazon Q Developer will work similarly to previous tasks, adding a comment in the issue’s history to inform you that it’s migrating the codebase. This comment will later be updated with a link to the merge request once the process is complete, much like we encountered earlier. Additionally, it will generate a migration plan that you can review while you wait. This plan includes a collapsible step-by-step list detailing actions to be taken, alongside links for further reading.

The resulting merge request is comprehensive, including overall statistics such as the number of lines of code migrated, making it easy to track progress. For more insights on navigating male-centered company culture, check out this blog post: Tackling Male-Centered Company Culture. For expert advice on handling compensation changes, visit SHRM. Lastly, for more information about career opportunities, explore this excellent resource: Learning Trainer Position.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *