{"id":1829,"date":"2025-08-28T09:28:55","date_gmt":"2025-08-28T16:28:55","guid":{"rendered":"http:\/\/10kdev.net\/?p=1829"},"modified":"2025-09-05T06:33:53","modified_gmt":"2025-09-05T13:33:53","slug":"amazon-q-reviews-with-github-repos","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=1829","title":{"rendered":"Amazon Q Reviews with GitHub Repos"},"content":{"rendered":"<p>This is about hooking up Amazon Q to GitHub, so it can code review your pull requests.\u00a0 Also, to see what happens if you have an unsupported language reviewed (Groovy, and for supported looking at Java).<\/p>\n<p>List of Q supported code review languages as of today is here:<\/p>\n<p>https:\/\/docs.aws.amazon.com\/amazonq\/latest\/qdeveloper-ug\/q-language-ide-support.html<\/p>\n<p>Here is a printout of the receipt:<\/p>\n<p><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/20250828-Supported-languages-for-Amazon-Q-Developer-in-the-IDE-Amazon-Q-Developer.pdf\">20250828 Supported languages for Amazon Q Developer in the IDE &#8211; Amazon Q Developer<\/a><\/p>\n<h4>Language support for code reviews with \/review<\/h4>\n<p>Amazon Q can create\u00a0<a href=\"https:\/\/docs.aws.amazon.com\/amazonq\/latest\/qdeveloper-ug\/code-reviews.html\">code reviews<\/a>\u00a0and provide automatic code fixes for files and projects written in the following languages:<\/p>\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\">Java \u2010 Java 17 and earlier<\/li>\n<li class=\"listitem\">JavaScript \u2010 ECMAScript 2021 and earlier<\/li>\n<li class=\"listitem\">Python \u2010 Python 3.11 and earlier, within the Python 3 series<\/li>\n<li class=\"listitem\">C# \u2010 All versions (.NET 6.0 and later recommended)<\/li>\n<li class=\"listitem\">TypeScript \u2010 All versions<\/li>\n<li class=\"listitem\">Ruby \u2010 Ruby 2.7 and 3.2<\/li>\n<li class=\"listitem\">Go \u2010 Go 1.18<\/li>\n<li class=\"listitem\">C \u2010 C11 and earlier<\/li>\n<li class=\"listitem\">C++ \u2010 C++17 and earlier<\/li>\n<li class=\"listitem\">PHP \u2010 PHP 8.2 and earlier<\/li>\n<li class=\"listitem\">Kotlin \u2010 Kotlin 2.0.0 and earlier<\/li>\n<li class=\"listitem\">Scala \u2010 Scala 3.2.2 and earlier<\/li>\n<li class=\"listitem\">JSX \u2010 React 17 and earlier<\/li>\n<li class=\"listitem\">Infrastructure as Code (IaC) languages\n<div class=\"itemizedlist\">\n<ul class=\"itemizedlist\">\n<li class=\"listitem\">AWS CloudFormation \u2010 2010-09-09<\/li>\n<li class=\"listitem\">Terraform \u2010 1.6.2 and earlier<\/li>\n<li class=\"listitem\">AWS CDK \u2010 TypeScript and Python<\/li>\n<\/ul>\n<\/div>\n<p>&nbsp;<\/li>\n<\/ul>\n<p>Also, in the list if the current supported languages is Java, but not Groovy<\/p>\n<\/div>\n<p>First, you will need a GitHub account, a repository, and an Amazon Q Account.<\/p>\n<p>Add the Amazon Q App to your GitHub account:<\/p>\n<p>Go to settings (menu under your profile), then Applications:<\/p>\n<p><a href=\"http:\/\/10kdev.net\/?attachment_id=1830\" rel=\"attachment wp-att-1830\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1830\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.16.31\u202fPM.png\" alt=\"\" width=\"351\" height=\"220\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.16.31\u202fPM.png 351w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.16.31\u202fPM-300x188.png 300w\" sizes=\"(max-width: 351px) 100vw, 351px\" \/><\/a><\/p>\n<p>Visit the <a href=\"https:\/\/github.com\/marketplace\">Github Marketplace<\/a> in Applications and install Amazon Q Developer:<\/p>\n<p><a href=\"http:\/\/10kdev.net\/?attachment_id=1832\" rel=\"attachment wp-att-1832\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1832\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.27.52\u202fPM.png\" alt=\"\" width=\"490\" height=\"116\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.27.52\u202fPM.png 490w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.27.52\u202fPM-300x71.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/a><\/p>\n<p>When you install, it should be for Free.\u00a0 It asks for a billing address &#8212; but don&#8217;t need a card or anything.\u00a0 You can also choose all or just particular repositories for Q access.<\/p>\n<p>Q App should now be installed in your GitHub.<\/p>\n<p>&nbsp;<\/p>\n<p>Next connect the GitHub in Amazon Q Developer.\u00a0 Log in and go to Amazon Q Developer, then click into the GitHub portion to Register Installations.<\/p>\n<p><a href=\"http:\/\/10kdev.net\/?attachment_id=1833\" rel=\"attachment wp-att-1833\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1833\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.37.51\u202fPM.png\" alt=\"\" width=\"1477\" height=\"702\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.37.51\u202fPM.png 1477w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.37.51\u202fPM-300x143.png 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.37.51\u202fPM-1024x487.png 1024w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-27-at-1.37.51\u202fPM-768x365.png 768w\" sizes=\"(max-width: 1477px) 100vw, 1477px\" \/><\/a><\/p>\n<p>Authorize Q, then Register.\u00a0 You&#8217;ll get a confirmation.<\/p>\n<p>Now everything is connected, and it&#8217;s time to do a code review.<\/p>\n<p>You can go out to an AI (Gemini in this case) and generate some bad code test files.\u00a0 I generated two &#8212; one for Groovy, and one for Java.\u00a0 SOme of the project I am on now is Groovy and the Amazon reps said it would work even though as of this date Groovy is not a supported language for Q.<\/p>\n<p>&nbsp;<\/p>\n<p>The prompts:<\/p>\n<ol>\n<li>can you generate a Groovy file that has security and syntax issues so that I can test my code review process<\/li>\n<li>generate this same thing but as a java file<\/li>\n<\/ol>\n<p>Here are the groovy and java test files to look at (printed as pdf):<\/p>\n<p><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/badcode.groovy.pdf\">badcode.groovy<\/a> <a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/badcode.java_.pdf\">badcode.java<\/a><\/p>\n<p>These files have errors in them, which AWS should catch.\u00a0 I am not going to do an in-depthstudy of which errors it might see, just if the review works, and decorates, the code in GitHub or not.<\/p>\n<p>&nbsp;<\/p>\n<p>Isn&#8217;t AI great? you don&#8217;t even need to hire a real developer to get bad code.<\/p>\n<p>&nbsp;<\/p>\n<p>Here is a list of things that are wrong in these files, from Gemini.<\/p>\n<p>Bad Groovy:<\/p>\n<h3><b>Security Issues<\/b><\/h3>\n<ul>\n<li><b>Command Injection:<\/b> The <code>insecureMethod()<\/code> concatenates user input directly into a shell command, which can allow an attacker to execute arbitrary commands.<\/li>\n<li><b>SQL Injection:<\/b> The <code>vulnerableSql()<\/code> method builds a SQL query string by concatenating data, leaving it open to SQL injection attacks.<\/li>\n<li><b>Directory Traversal:<\/b> The <code>insecureFileAccess()<\/code> method uses user input to access a file path without proper validation, which could allow an attacker to read sensitive files outside of the intended directory.<\/li>\n<\/ul>\n<h3><b>Syntax and Style Issues<\/b><\/h3>\n<ul>\n<li><b>Missing Semicolon:<\/b> In Groovy, while semicolons are optional, their absence can sometimes lead to unexpected behavior, especially when combining multiple statements on a single line. The provided example shows a simple case where a missing semicolon could be a point of review.<\/li>\n<li><b>Misspelled Keyword:<\/b> The <code>reutrn<\/code> keyword is misspelled, which will cause a compilation error.<\/li>\n<li><b>Unmatched Parenthesis:<\/b> A parenthesis is missing in the <code>println<\/code> statement, which will also cause a compilation error.<\/li>\n<li><b>Redundant Comparison:<\/b> The <code>if (flag == true)<\/code> statement is redundant. A more concise and idiomatic Groovy style would be <code>if (flag)<\/code>.<\/li>\n<li><b>Unused Variable:<\/b> The <code>unusedVariable<\/code> is declared but never used, which is a common code smell that a good code review should identify.<\/li>\n<\/ul>\n<p>Bad Java:<\/p>\n<p>&nbsp;<\/p>\n<h3><b>Security Issues<\/b><\/h3>\n<ul>\n<li><b>Command Injection:<\/b> The <code>insecureMethod()<\/code> concatenates user input into a shell command using <code>Runtime.getRuntime().exec()<\/code>. This is a classic <b>command injection<\/b> vulnerability, as an attacker could provide input that executes malicious commands on the system.<\/li>\n<li><b>SQL Injection:<\/b> The <code>vulnerableSql()<\/code> method builds a SQL query string by directly concatenating an <code>int<\/code> and <code>String<\/code> into the query. This leaves the application open to <b>SQL injection<\/b> attacks, where an attacker could manipulate the query to gain unauthorized access to data.<\/li>\n<li><b>Directory Traversal:<\/b> The <code>insecureFileAccess()<\/code> method uses a user-controlled path to create a <code>File<\/code> object. Without proper validation, this is a <b>directory traversal<\/b> vulnerability, allowing an attacker to access sensitive files outside the intended directory, such as <code>\/etc\/passwd<\/code>.<\/li>\n<\/ul>\n<h3><b>Syntax and Style Issues<\/b><\/h3>\n<ul>\n<li><b>Compiler Errors:<\/b> Unlike Groovy, Java is a strictly typed and compiled language. Missing semicolons, misspelled keywords (<code>reutrn<\/code>), and unmatched parentheses will cause the program to fail to compile, which is a major red flag in a code review.<\/li>\n<li><b>Redundant Comparison:<\/b> The condition <code>flag == true<\/code> is redundant and considered bad practice in Java. A more idiomatic and concise style is simply <code>if (flag)<\/code>. This is a common <b>style issue<\/b> that a good code review should catch.<\/li>\n<li><b>Unused Variable:<\/b> The <code>unusedVariable<\/code> is declared but never used. Most IDEs and compilers will issue a warning about this, as it indicates potentially dead code or a mistake. This is also a key <b>code smell<\/b> to identify during a review.<\/li>\n<\/ul>\n<p>In my repository I have two branches, one for groovy and one for java, I&#8217;ll pull separate PRs and then wait for Q&#8217;s code review.<\/p>\n<p><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.09.26\u202fAM.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1840\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.09.26\u202fAM.png\" alt=\"\" width=\"335\" height=\"247\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.09.26\u202fAM.png 335w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.09.26\u202fAM-300x221.png 300w\" sizes=\"(max-width: 335px) 100vw, 335px\" \/><\/a><\/p>\n<p>Java PR:<\/p>\n<p><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.11.28\u202fAM.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1841\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.11.28\u202fAM.png\" alt=\"\" width=\"332\" height=\"159\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.11.28\u202fAM.png 332w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.11.28\u202fAM-300x144.png 300w\" sizes=\"(max-width: 332px) 100vw, 332px\" \/><\/a><\/p>\n<p>Groovy PR:<a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.12.31\u202fAM.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1843\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.12.31\u202fAM.png\" alt=\"\" width=\"287\" height=\"48\" \/><\/a><\/p>\n<p>Q is thinking about the review:<\/p>\n<p><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.10.59\u202fAM.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1842\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.10.59\u202fAM.png\" alt=\"\" width=\"937\" height=\"169\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.10.59\u202fAM.png 937w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.10.59\u202fAM-300x54.png 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.10.59\u202fAM-768x139.png 768w\" sizes=\"(max-width: 937px) 100vw, 937px\" \/><\/a><\/p>\n<p>It takes a little time and here are the results for Java, which is finds many issues (more than listed here):<\/p>\n<p><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.06\u202fAM.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1844\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.06\u202fAM.png\" alt=\"\" width=\"923\" height=\"397\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.06\u202fAM.png 923w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.06\u202fAM-300x129.png 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.06\u202fAM-768x330.png 768w\" sizes=\"(max-width: 923px) 100vw, 923px\" \/><\/a> <a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.15\u202fAM.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1845\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.15\u202fAM.png\" alt=\"\" width=\"927\" height=\"411\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.15\u202fAM.png 927w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.15\u202fAM-300x133.png 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.15\u202fAM-768x341.png 768w\" sizes=\"(max-width: 927px) 100vw, 927px\" \/><\/a><\/p>\n<p>But with Groovy, an unsupported language, finds nothing:<\/p>\n<p><a href=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.50\u202fAM.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-1846\" src=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.50\u202fAM.png\" alt=\"\" width=\"944\" height=\"189\" srcset=\"http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.50\u202fAM.png 944w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.50\u202fAM-300x60.png 300w, http:\/\/10kdev.net\/wp-content\/uploads\/2025\/08\/Screenshot-2025-08-28-at-11.15.50\u202fAM-768x154.png 768w\" sizes=\"(max-width: 944px) 100vw, 944px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>Conclusion<\/h2>\n<p>It works rather well for a supported language, almost as good as my experience with SonarQube decoration.\u00a0 If you are working in a low quality environment, you could turn this on and force PRs and get good code reviews for free at point of merge.<\/p>\n<p>As for the Groovy\/unsupported &#8212; be careful as Amazon might write off your code base and say &#8220;be patient.&#8221;\u00a0 Doesn&#8217;t matter how cheap a tool is if it sucks time.\u00a0 I have found the Groovy support kind of OK in the IDE with Q, just, the review doesn&#8217;t work.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is about hooking up Amazon Q to GitHub, so it can code review your pull requests.\u00a0 Also, to see what happens if you have an unsupported language reviewed (Groovy, and for supported looking at Java). List of Q supported code review languages as of today is here: https:\/\/docs.aws.amazon.com\/amazonq\/latest\/qdeveloper-ug\/q-language-ide-support.html Here is a printout of the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[95,96],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1829"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1829"}],"version-history":[{"count":7,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1829\/revisions"}],"predecessor-version":[{"id":1851,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/1829\/revisions\/1851"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1829"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}