The advent of Generative Artificial Intelligence (Gen AI) has ushered in a new era of technology, mirroring human-like cognitive capabilities in machines.As a leading cloud computing provider, AWS has recently joined the race with its announcement of Amazon Q, a generative AI-powered assistant designed to swiftly provide relevant answers, tackle problems, create content, and execute tasks using a company’s information repositories and systems.
Although the full extent of Amazon Q’s applications is not yet entirely clear, the service is displaying significant promise. The following sections will explore one potential use case for Amazon Q, particularly when integrated with Amazon Code Catalyst, demonstrating its ability to streamline and accelerate software development efforts.
What is Amazon CodeCatalyst?
Amazon CodeCatalyst is an integrated service for software development teams adopting continuous integration and deployment practices into their software development process. CodeCatalyst consolidates essential tools into one unified space. This consolidation facilitates work planning, code collaboration, application building, testing, and deployment using continuous integration/continuous delivery (CI/CD) tools. It also enables the creation of repositories (issues, pull requests, kanban board, etc.) and offers the option to connect with existing repositories from GitHub.
Amazon Q Integration with CodeCatalyst
Amazon Q Integration with Code Catalyst introduces three primary features:
- Generation of a Pull Request directly from the issue title/description.
- Create a single revision based on developers’ review comments.
- Automatic generation of pull request descriptions directly from the code.
- Generation of a comprehensive summary encompassing all review comments.
Additional details on Amazon Q integration features and pricing can be found here.
How to Set Up a Code Catalyst Space and use Amazon Q
To set up a Code Catalyst space and utilize Amazon Q, follow these steps:
Fill out the form:
- Space name: The name entered should be unique
- Region: As of Dec 2023, only 2 regions are available (Oregon and Ireland)
- Your AWS Account ID
A verification token will be generated, prompting you to verify it in AWS.
In the AWS Code Catalyst space page, ensure to check “Authorize paid tiers (Standard, Enterprise)”.
A paid tier is mandatory for utilizing Pull Request generation with Amazon Q.
Click on “Verify Space” to proceed.
3) Click on “Create Project” on the Home Page.
Create your project either from scratch or using a blueprint (e.g., “To Do Web Application”).
Note: As of December 2023, if you connect your GitHub repository using “Bring your own code” Amazon Q features will not be available. This may change in the near future.
Specify a project name and keep other settings as default. Click on “Create project”.
To leverage Generative AI features, enable Preview features by going to Settings > Generative AI and checking “Projects in this space can access generative AI features.”
The setup is complete, and you are now ready to use Amazon Q in Code Catalyst.
Using Amazon Q features
Generating a Pull Request from Issue
- Begin by creating an issue: Issues > Create Issue.
- Write the title and description of the issue.
- Click on “Assign to Amazon Q.” As an example, let’s consider asking Amazon Q to implement Tailwind in an existing project.
Amazon Q will then present a series of steps before initiating the Pull Request:
- Evaluate prerequisites: Amazon Q requests necessary information from the user to guide the generation process.
- Read repository
- Generate background: Amazon Q generates a background (= a context) from the issue information and repository code.
- Generate approach: Amazon Q generates steps outlining what needs to be done
- Generate code: Amazon Q generates the code and the associated pull request
- Create pull request
Note: Generating the pull request may take more than one hour.
In the first step, Amazon Q will ask your preference on whether to wait for your approval and feedback at each generation step. It also seeks permission to modify Code Catalyst workflow files.
After one or more hours, Amazon Q will generate “Background” content (see screenshot below) describing the project, the framework used, and the general project purpose.
Amazon Q will then create an “Approach,” aiding both itself and the developer in understanding the objective. This “Approach” is used for code generation and serves as the Pull Request description.
Subsequently, Amazon Q generates the Pull Request, incorporating changes. However, it may deviate from the outlined approach, skipping several steps.
Note: Below are the changes made by Amazon Q for the example discussed in this article. These changes are not aligned with what was described in the “Approach”. Almost all the steps outlined in the initial approach have been skipped. To avoid this, users can provide a detailed description of what is required. This ensures that Amazon Q has the data it needs to generate a better result.
Generate Pull Request description
Utilize the “Write description for me” feature during the creation of pull requests to leverage Amazon Q’s capability to generate a description of the changes. When opting for this option, Amazon Q analyzes the disparities between the source branch, containing the code changes, and the destination branch where the changes are to be merged. It then produces a summary delineating the nature of these alterations and its best interpretation of their intent and impact.
For instance, consider a scenario where a simple branch is created, and changes are committed, modifying the CSS properties of an application—specifically, removing the keyframes property and adjusting the App Header and link colors.
Upon initiating a Pull request (Code > Pull Requests > Create pull request), a button “Write description for me” with Amazon Q becomes visible.
After a few seconds, Amazon Q generates a succinct description related to the code changes in the pull request. Although the generated description may delve into finer details, it generally aligns with the nature of the changes.
Generate Pull Request reviews summary
When reviewing a pull request and encountering multiple comments from various reviewers, it can be challenging to discern common themes or ensure a thorough review of all comments across revisions. Amazon Q addresses this by offering the “Create comment summary” feature. This functionality allows Amazon Q to analyze all comments left on code changes in a pull request and generate a consolidated summary.
We review the PR and add some comments such as:
- Install tailwind as an npm package
- Move tailwind directives to the top of the file
The following is the comment summary generated by Amazon Q:
Note: As seen in the screenshot above, the generated summary may not precisely align with the intended purpose of the pull request (as a reminder, it was to bootstrap tailwind in the project). However, this functionality will be improved in the future.
Amazon Q introduces features that were previously considered unimaginable. Although the generation of pull requests or review summaries remains somewhat unstable, as outlined in this article, the technology shows promise. Despite being in its early stages, Amazon Q is already showcasing the growing relevance of AI in software development practices. Tools such as Amazon Q in Code Whisperer have the potential to offer increasing support to developers, highlighting the limitless capabilities that lie ahead.
TrackIt is an Amazon Web Services Advanced Tier Services Partner specializing in cloud management, consulting, and software development solutions based in Marina del Rey, CA.
TrackIt specializes in Modern Software Development, DevOps, Infrastructure-As-Code, Serverless, CI/CD, and Containerization with specialized expertise in Media & Entertainment workflows, High-Performance Computing environments, and data storage.
In addition to providing cloud management, consulting, and modern software development services, TrackIt also provides an open-source AWS cost management tool that allows users to optimize their costs and resources on AWS.