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 Logo

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

ehHd9DuMquInV4xP69gQndbEgxgZMix8ujUyeaz8mVC

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:

1) Create an AWS Builder account.

2) Go to Code Catalyst, sign in with your AWS Builder Account and click on  “Create space”.

CC7 NHWVsaKe4bqVIr u33e3d9zunsh510pDksrX8Qy8A7epimjtUZAowVq PNZcinliss7wxfEFB5yv4lvCeLXJD0OhVxvEgoihR55AsLwow6qv0H3Ppx9TNV2Vp3oap RLqjU1Q45L3RMaaYdpuBk


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.

HCKwIti9veRWCR1fEIePmVpGd A6VnECYqhi6Q2yEZOEE22zAMZXGv1VDco91pCzC7PQ6nRwea30z3kO9pJUd54h3cA 2XyK2shvZsiGttozReFxn FHplOPkxpKv t13pI 2cR6eOhph8QmanHF52s

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.

Lo9ccaLTFhtu

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.

js c0LvvDHgmD8g SpN4L8mJedJq0FZiOkC bshQKUydT8zXiGBlKdIFXDIhBZo2h 4nI BMVI1gQ0OafO9EzpGFNoS AybpKlT dpN0svM1MCZXZgTbwtVQODITMQwbOCTkuGQjbkAjPXrMhQ7rrjY

Specify a project name and keep other settings as default. Click on “Create project”.

cNdf1SGCrJrNXOwvmHS6ryV7fqR77In8q7rnkRWzrZhn kqx0C17AoNFmDuYFAsO2O4lY8vFjJZSnK YueOag83aPbFYVDhUJ5jcPf 3CXIQ2HqbzaNY04NgOKqdZnUOOWvS9L8ubC03khdAZC4ioM4

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.

8x600BIpEqLYqX5NQsY Npd 8ghVpT64 JMzkuhLNN9qlBPwfBv1ff OzceajT9Xc2Ig9H3ktxQ0P3UsxEhibgjhNru3hNNZ

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.

iKjDof3G0eIyWl0PzCSWa L0mWqxPJt7wrjil KxpPra2V 4yLZmjjcoA5OShbUaGTquYu2FB0VIeefSslnIIAT kkgfb7D3BZtdF16C6Mc2iMB0PeS9JExd9v KzmOOvGvnD13Y67rRvaJj suk2cA

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.

FdYU4kvVoxut5EaWf2QrWiuz8cYbXuUKmcw5r4mJ4kmvLjVe jhOlZTE6K2 Jxws7YMqlabRortaM2a6cF3 PgbzTifc2pZ6COZdl4A7LWGzbnTmoFpaHo95br0Z7B96Gp TqKPcZt6KWzE2u1aEDS8

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.

Ho4zHRcDFOa3TcgH6cZDlkIGOPOZ1ysTXVqusIJpNSU9qohcySmqTfTBZgX9zRqP1buudFfoLd6zV03TXijUmnhHmDlPv7oH6uPIBecmsy GYWV7RliXtv No4k1 VXIfjdCMrm5c3s0yEW pcOcBWI

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.

snQInP xMe4tO mckQ1rmAZP6YAavDqZ3sdt1N6Xu76KEQcI8fahyy07bXwNHkQGtUtjzGApRQCo51Rd97FVs9lfwXlESJMs3rSw5cdke G8f59LzwO6wpJmi 84DCzYS igJCZ1L07BobGkgSlUX4

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.

nCRT4szlBpsoRve9Nibi4qlQvwH48ivNeOwbSwbv

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.

rA4Q42u2 xT6sBgdXETRaAU9o53x 9Zw9SmPvEn7xm t9oEnSul7f7Sse9 k4B8asAVjGpEDD8Lgp5NgcZ9AeqAhNG i2Hs1mz5gjFQR9lQaEKwHbwr6o ZjWitSolUUnRbhviMyx3nMCLi4OTP vg8

Upon initiating a Pull request (Code > Pull Requests > Create pull request), a button “Write description for me” with Amazon Q becomes visible.

PNFums5rP1vp7aI8mL0p6xXvJlDUC5n64TuDTtCALB 0Gif 0SqCamPhOusJ5S5jm eodQbfDXgSC59F4wKfQHKEq4Ic6kBYjJNaZG2 smpFeQ9ERNAV8PpRznbi7DIH8Ny1djGHoL1PwIEZTWVvXg

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.

XpAkCDOiCg DDxkOjHz226zkiV13xzsLmEbJnqs7Az5YABfUqEIv Hj4Vc9NB3bjKsF8P5rhJPCI7EUFaUc4wCOWuxZhHE7ksHz7aCm6zd2T vwnz8eEY YZUhTTf24Md kRz5iSWLQ XVVuvALzMQ4

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

n9tGWwRHHMx0fJ2vXFDNfCpftkEF2wSW7vbIlHg8tR oIdK0ABOlgr7vOIzgTZxEFSI P45hqaLCPGDxDGGTcGVptYaZY6Kt7XFOI6nDCT7QzTeWDCK4G kIAdNSzL29beBpZR1SOvQCDrm0OAviMTE

The following is the comment summary generated by Amazon Q:

oGAMqYeiT6Rgj4EnMNTXuMbL pn5M8I9XwM7A5mcSELeVeUNZcsn6GMNa0f2yjQh6ifv8JyPJuU JgHap1ELKrK8ZwmXJK4jyZEjXpt8ar GrfVNkhtL5BhG3gB3BN Z2 sclQUMM5QRkXwl4F1BZo

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.

Conclusion

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.

About TrackIt

TrackIt is an international AWS cloud consulting, systems integration, and software development firm headquartered in Marina del Rey, CA.

We have built our reputation on helping media companies architect and implement cost-effective, reliable, and scalable Media & Entertainment workflows in the cloud. These include streaming and on-demand video solutions, media asset management, and archiving, incorporating the latest AI technology to build bespoke media solutions tailored to customer requirements.

Cloud-native software development is at the foundation of what we do. We specialize in Application Modernization, Containerization, Infrastructure as Code and event-driven serverless architectures by leveraging the latest AWS services. Along with our Managed Services offerings which provide 24/7 cloud infrastructure maintenance and support, we are able to provide complete solutions for the media industry.

Additional Resources

An Introduction to Generative AI on AWS

AWS Resources for Generative AI

Amazon Q – Generative AI-Powered Assistant

5 Generative AI Use Cases for E-Commerce

7 Generative AI Use Cases for Media & Entertainment