Giter VIP home page Giter VIP logo

amazon-codeguru-reviewer-sample-app's Introduction

Amazon CodeGuru Reviewer Example App

This application is intended as a test case for Amazon CodeGuru Reviewer, a service that uses program analysis and machine learning to detect potential defects in code. The implementation of this example is intentionally suboptimal, to demonstrate CodeGuru Reviewer's ability to provide recommendations. This example code should not be used in production.

To get started with CodeGuru Reviewer, follow the steps below.

Try CodeGuru Reviewer

1) Fork this repo

Log in to GitHub and choose Fork to fork this example app to your GitHub account.

Image of Fork button

2) Associate the forked repo

  1. Log in to the CodeGuru dashboard.
  2. Choose Associate repository.
  3. Make sure GitHub is selected and choose Connect to GitHub.
  4. To allow CodeGuru Reviewer to access your account, choose Authorize aws-codesuite. If prompted, confirm your GitHub password.
  5. Select the amazon-codeguru-reviewer-sample-app repository and choose Associate.

Image of Associate view

CodeGuru Reviewer is now associated with the repo and listening for pull requests.

3) Push a change to the code

Clone the forked repo, replacing USER_ID in the URL with your actual user ID:

git clone https://github.com/USER_ID/amazon-codeguru-reviewer-sample-app.git

You can get the URL by choosing the Clone or download button.

Image of Clone button

Note: If you access your GitHub repositories using SSH, use the SSH URL instead of the HTTPS URL shown above.

Check out a new branch:

cd amazon-codeguru-reviewer-sample-app
git checkout -b dev

Copy the Java class at src/main/java/com/shipmentEvents/handlers/EventHandler.java into src/main/java/com/shipmentEvents/demo.

cp src/main/java/com/shipmentEvents/handlers/EventHandler.java src/main/java/com/shipmentEvents/demo/

GitHub and CodeGuru Reviewer will treat this as a new file.

Push your changes:

git add --all
git commit -m 'new demo file'
git push --set-upstream origin dev

4) Create a pull request

  1. In your forked GitHub repo, choose New pull request.
  2. On the left side of the comparison (base), select USER_ID/amazon-codeguru-reviewer-sample-app, where USER_ID is your GitHub user ID. Leave the branch at master.
  3. On the right side of the comparison (compare), change the branch to dev. The branches should be shown as mergeable ("Able to merge"). Image of compare view
  4. Choose Create pull request and, again, Create pull request.

5) Review recommendations

After a few minutes, CodeGuru Reviewer will issue recommendations on the same GitHub page where the pull request was created. You can check the status of the code review in the Code reviews view of the CodeGuru Reviewer Console.

Image of pending status

When the code review is complete and the recommendations appear in GitHub, you can provide feedback on the recommendations using the thumbs up/down icons. Any positive or negative feedback can be used to help improve the performance of CodeGuru Reviewer so that recommendations get better over time.

Image of thumbs up/down icons

6) Clean up

After you're finished with this demo, clean up your resources:

  1. In your GitHub fork of amazon-codeguru-reviewer-sample-app, go to Settings and choose Delete this repository. Follow the instructions to delete the forked repository.
  2. Delete your clone of the forked repository. For example: rm -rf amazon-codeguru-reviewer-sample-app
  3. In the CodeGuru Reviewer Console, select the example repository, choose Actions, and then choose Disassociate repository.

Image of disassociate option

Learn more

To learn more, see the Amazon CodeGuru Reviewer User Guide.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

amazon-codeguru-reviewer-sample-app's People

Contributors

amazon-auto avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.