Code Review, hosted on Google App Engine

Overview

Welcome to Rietveld

GitHub Wiki: https://github.com/rietveld-codereview/rietveld/wiki Google Group: http://groups.google.com/group/codereview-discuss

This project shows how to create a somewhat substantial web application using Django on Google App Engine. It requires Python 2.7 and Django version 1.3 (although a previous version using Python 2.5 and Django 1.2 can still be found in the py25 branch in the repository).

In addition, I hope it will serve as a practical tool for the Python developer community, and hopefully for other open source communities. As I've learned over the last two years at Google, where I developed a similar tool named Mondrian, proper code review habits can really improve the quality of a code base, and good tools for code review will improve developers' life.

Some code in this project was derived from Mondrian, but this is not the full Mondrian tool.

--Guido van Rossum, Python creator and Google employee

Links

License

The license is Apache 2.0. See the file COPYING.

Running

To run the app locally (e.g. for testing), download the Google App Engine SDK from http://code.google.com/appengine/downloads.html. You can then run the server using

  make serve

(assuming you're on Linux or Mac OS X). On Windows just use Google App Engine Launcher.

Please make sure that you have the most recent version of the App Engine SDK installed when running Rietveld locally. That's the version that runs in the production environment too and Rietveld often uses new features.

The server is only accessible on http://localhost:8080. The server in the Google App Engine SDK is not designed for serving real traffic. The App Engine FAQ at https://developers.google.com/appengine/kb/general says about this: "You can override this using the -a flag when running it, but doing so is not recommended because the SDK has not been hardened for security and may contain vulnerabilities."

To deploy your own instance of the app to Google App Engine:

  1. Register your own application ID on the App Engine admin site.
  2. Edit app.yaml to use this app ID instead of 'codereview-hr'.
  3. Upload using
      make update VERSION=123f
    

Don't forget step 2! If you forget to change the application ID, you'll get a error message from "appcfg.py update" (called by "make update") complaining you don't have the right to administer this app.

The VERSION=xxx argument sets the version; the version from the app.yaml is not used. This is to support a convention used for the main Rietveld instance (codereview.appspot.com) whereby we never deploy to the same version twice; the version must be manually picked by the developer doing the deployment. If you don't like this, just edit the Makefile to remove "--version $(VERSION)" and edit app.yaml to hardcode a version number.

Administration

Various jobs to administer an instance are collected in admin_tasks.py. These jobs can be run by an instance administrator by visiting http://your-instance/mapreduce/.

Comments
  • upload.py should use OAuth 2.0

    upload.py should use OAuth 2.0

    ClientLogin is deprecated; see 
    https://developers.google.com/accounts/docs/AuthForInstalledApps
    
    upload.py should switch to using OAuth 2.0 instead.
    

    Original issue reported on code.google.com by [email protected] on 2 Jun 2012 at 1:13

    Priority-Medium auto-migrated Type-Task 
    opened by GoogleCodeExporter 29
  • Python 2.7 support

    Python 2.7 support

    Rietveld should support Python 2.7 on App Engine both with and without 
    threading.
    
    
    

    Original issue reported on code.google.com by albrecht.andi on 2 Dec 2011 at 1:09

    Priority-Medium auto-migrated Type-Enhancement 
    opened by GoogleCodeExporter 29
  • Rietveld code review requests and updates don't send email notifications

    Rietveld code review requests and updates don't send email notifications

    What steps will reproduce the problem?
    1. run upload.py
    2. start a review in the URL returned by upload.py
    
    What is the expected output? What do you see instead?
    
    Until recently the people from whom you requested a review would get an email 
    notification. Now they don't.
    
    This problem happens for the original review request as well as when you upload 
    changes in response to a review. Strangely, when the reviewer finishes 
    reviewing the code, the code author does seem to get that notification.
    
    What browser are you using?  What version? On what operating system?
    
    Chrome 16.0.912.36 beta running on Linux.
    
    At what URL are you accessing Rietveld?  (e.g. codereview.appspot.com)
    Please note if you are using the Google Apps Labs version (e.g.
    codereview.<yourdomain>).
    
    codereview.appspot.com
    
    
    *** If you are a Google employee please say so or mail me (Guido van
    Rossum) directly. ***
    
    I am a Google employee: [email protected]
    
    
    Please provide any additional information below.
    
    

    Original issue reported on code.google.com by [email protected] on 18 Nov 2011 at 5:15

    Priority-Medium Type-Defect auto-migrated 
    opened by GoogleCodeExporter 18
  • 500 Server Error on Publish if issue is without the base file

    500 Server Error on Publish if issue is without the base file

    What steps will reproduce the problem?
    1. Make comments
    2. Click publish
    
    Obviously this doesn't always happen. Issue 161467 is the culprit.
    
    What is the expected output? What do you see instead?
    Be allowed to publish comments. Instead I get 500 Internal Service error.
    
    What version of the product are you using? On what operating system?
    
    
    *** If you are a Google employee please say so or mail me (Guido van
    Rossum) directly. ***
    
    
    Please provide any additional information below.
    
    

    Original issue reported on code.google.com by [email protected] on 8 Oct 2009 at 11:45

    Priority-Medium Type-Defect auto-migrated 
    opened by GoogleCodeExporter 18
  • Keyboard shortcut keys have no effect

    Keyboard shortcut keys have no effect

    What steps will reproduce the problem?
    1. Open Chrome 22, navigate to: 
    https://chromiumcodereview.appspot.com/10928043/ (or any other issue)
    2. Click on "View" link next to first file in a multiple-file patch set.
    3. Press 'j' (or any other shortcut key).
    
    
    What is the expected output? What do you see instead?
    
    I'd expect the 'j' key would go on to the next file.  However, nothing happens. 
     None of the other shortcut keys do anything, either.  I've tried clicking 
    around on the page to maybe change the keyboard focus, but that doesn't help.
    
    No errors show up in the JavaScript console.
    
    Nothing appears in the "Settings" page to turn keyboard shortcuts on or off.
    
    
    What browser are you using?  What version? On what operating system?
    
    Google Chrome   22.0.1229.26 (Official Build 153823) beta
    OS  Linux
    WebKit  537.4 (@126825)
    JavaScript  V8 3.12.19.5
    Flash   11.3.31.318
    User Agent  Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.4 (KHTML, like 
    Gecko) Chrome/22.0.1229.26 Safari/537.4
    Command Line     /opt/google/chrome/google-chrome --flag-switches-begin 
    --enable-experimental-extension-apis --flag-switches-end
    
    
    At what URL are you accessing Rietveld?  (e.g. codereview.appspot.com)
    Please note if you are using the Google Apps Labs version (e.g.
    codereview.<yourdomain>).
    
    chromiumcodereview.appspot.com
    
    
    *** If you are a Google employee please say so or mail me (Guido van
    Rossum) directly. ***
    
    Yes, I am a Google employee.  ;-)
    
    
    Please provide any additional information below.
    
    The keyboard shortcuts *do* work for my teammate.  He's using Chrome 22 on a 
    Mac laptop.  I have no idea why it isn't working for me.  One guess: I'm using 
    the Dvorak keyboard layout, not Qwerty; but trying other keys doesn't work 
    either.
    
    

    Original issue reported on code.google.com by [email protected] on 7 Sep 2012 at 12:27

    Priority-Medium Type-Defect auto-migrated 
    opened by GoogleCodeExporter 16
  • Dataloss with

    Dataloss with "Invalid XSRF token" error

    If you leave a review page open too long (24+ hours?) and then try to write a 
    reply, after submission you get "Invalid XSRF token."  Then if you hit back, 
    your reply is gone, because it was composed in some AJAXy box that no longer 
    appears.
    
    There are several possible mitigations.
    
    First, the full submitted reply (or other mail) could be pasted on the "invalid 
    xsrf token" page so you could copy it and paste it back in when going back.
    
    Second, the page could be structured such that when you go back, the browser 
    can successfully persist the relevant form data.
    
    Third, the page could do JS requests every few hours to keep the token alive.
    

    Original issue reported on code.google.com by [email protected] on 12 Jan 2012 at 8:39

    Priority-Medium Type-Defect auto-migrated Component-Server 
    opened by GoogleCodeExporter 16
  • Patch to fix upload.py -r N:M failure on new directories

    Patch to fix upload.py -r N:M failure on new directories

    We use Rietveld as post-commit review tool - upload.py -r N:M.
    It will fail with
    Failed to get status for some/dir/filename
    when invoking "svn list" when some/dir does not yet exist at revision N.
    Please apply attached patch.
    

    Original issue reported on code.google.com by [email protected] on 2 Apr 2010 at 2:56

    Attachments:

    Type-Defect auto-migrated Priority-High 
    opened by GoogleCodeExporter 15
  • upload fails if there is no diff.exe in your path

    upload fails if there is no diff.exe in your path

    upload runs svn diff like this:
      data = RunShell("svn diff --diff-cmd=diff", args)
    It makes sense to override any GUI diffing program, but this also means 
    that upload fails if you don't have a diff in your path.  However, "svn 
    diff" works fine as it uses its own built-in differ.
    
    (This is on Windows, where it's not common to have "diff" available.)
    
    Perhaps there's some way to tell svn to use its internal diff 
    implementation?  Or perhaps there's some way to test whether svn's default 
    implementation has been overriden?
    
    

    Original issue reported on code.google.com by [email protected] on 9 Jul 2008 at 9:32

    Priority-Medium Type-Defect auto-migrated 
    opened by GoogleCodeExporter 15
  • upload.py: certificate verify failed

    upload.py: certificate verify failed

    I can't upload review to https://codereview.chromium.org What's wrong with this certificate stuff? It is Python 2.7.10

    >python upload.py -s https://codereview.chromium.org -t "Don't fail hash validation"
    The following files are not added to version control:
    upload.py
    Are you sure to continue?(y/N) y
    Upload server: https://codereview.chromium.org (change with -s/--server)
    Email (login for uploading to https://codereview.chromium.org) [[email protected]]:
    Password for [email protected]:
    Traceback (most recent call last):
      File "upload.py", line 2719, in <module>
        main()
      File "upload.py", line 2711, in main
        RealMain(sys.argv)
      File "upload.py", line 2667, in RealMain
        response_body = rpc_server.Send("/upload", body, content_type=ctype)
      File "upload.py", line 446, in Send
        self._Authenticate()
      File "upload.py", line 501, in _Authenticate
        super(HttpRpcServer, self)._Authenticate()
      File "upload.py", line 381, in _Authenticate
        auth_token = self._GetAuthToken(credentials[0], credentials[1])
      File "upload.py", line 325, in _GetAuthToken
        response = self.opener.open(req)
      File "C:\Python27\lib\urllib2.py", line 431, in open
        response = self._open(req, data)
      File "C:\Python27\lib\urllib2.py", line 449, in _open
        '_open', req)
      File "C:\Python27\lib\urllib2.py", line 409, in _call_chain
        result = func(*args)
      File "C:\Python27\lib\urllib2.py", line 1240, in https_open
        context=self._context)
      File "C:\Python27\lib\urllib2.py", line 1197, in do_open
        raise URLError(err)
    urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)>
    
    opened by techtonik 14
  • upload.py fails with 302

    upload.py fails with 302

    This is Rietveld instance hosted on Google Apps. Let's say the server is
    cr.mycorp.com. We have svn+ssh://svn.mycorp.com repository but for the sake
    of Rietveld I had to configure it with a dummy http://svn.mycorp.com
    repository link (since it insists on having it).
    
    I do:
    python ${path-to-upload}/upload.py -s cr.mycorp.com -e [email protected] -r
    [email protected]
    
    I get:
    
    Traceback (most recent call last):
      File "/Users/kkowalczyk/.bin/upload.py", line 1387, in <module>
        main()
      File "/Users/kkowalczyk/.bin/upload.py", line 1379, in main
        RealMain(sys.argv)
      File "/Users/kkowalczyk/.bin/upload.py", line 1347, in RealMain
        response_body = rpc_server.Send("/upload", body, content_type=ctype)
      File "/Users/kkowalczyk/.bin/upload.py", line 326, in Send
        f = self.opener.open(req)
      File
    "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.
    py",
    line 380, in open
        response = meth(req, response)
      File
    "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.
    py",
    line 491, in http_response
        'http', request, response, code, msg, hdrs)
      File
    "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.
    py",
    line 418, in error
        return self._call_chain(*args)
      File
    "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.
    py",
    line 353, in _call_chain
        result = func(*args)
      File
    "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/urllib2.
    py",
    line 499, in http_error_default
        raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    urllib2.HTTPError: HTTP Error 302: Found
    
    Note: it might or might not matter but DNS CNAME mapping of cr.mycorp.com
    to ghs.google.com isn't set up yet (as per instructions of setting this app
    with Google Apps account) so I have a local over-ride in my /etc/hosts on
    my mac:
    
    209.85.171.121 cr.mycorp.com
    
    (209.85.171.121 is ghs.google.com).
    
    I can access cr.mycorp.com through the web and submit diffs through web
    interface but previewing such diffs in web ui doesn't work due to lack of
    svn+ssh support repositories (see issue 80)
    
    upload.py was downloaded yesterday from
    http://codereview.appspot.com/static/upload.py
    

    Original issue reported on code.google.com by [email protected] on 3 Feb 2009 at 7:18

    Priority-Medium Type-Defect auto-migrated 
    opened by GoogleCodeExporter 12
  • Switch to NDB

    Switch to NDB

    Follow up to issue #348 (which is about switching to Python 2.7).
    
    What steps will reproduce the problem?
    The problem was that Python 2.5 is outdated and we miss optional features from 
    Python 2.7 (multi-threading) that potentially increase performance and coding 
    speed.
    
    It was believed (by me at least) that Python 2.7 is required to switch to NDB 
    and get rid of caching clutches we've implementing in static classes. NDB comes 
    with caching included. But it appeared that NDB works with 2.5 as well (and 
    Python 2.7 doesn't require NDB or multi-threading to work).
    https://groups.google.com/d/msg/codereview-list/R14YbZU1Qdo/Z9PR0foLjQsJ
    
    
    So a switch to NDB will definitely help to turn on threading and clean up the 
    code.
    
    What is the expected output? What do you see instead?
    As Guido mentioned "where parents and or references/keys are used to link 
    between entities it's better to stick to one library". But some models (like 
    Account?) doesn't seem to be linked. It would be nice to see graph of all 
    Rietveld models though to make sure.
    
    Is there a way to extract model relationships (graph) from the configured 
    database layer at run-time in AppEngine and NDB?
    

    Original issue reported on code.google.com by [email protected] on 4 Jul 2012 at 3:15

    • Blocked on: #429
    Priority-Medium auto-migrated Type-Other 
    opened by GoogleCodeExporter 11
  • Can not update backends

    Can not update backends

    I can not update the application because it fails when updating the backend:

    ---[Updating backend tryton-rietveld-hrd]---
    ../google_appengine/appcfg.py  backends update . --application `cat app.yaml | sed -n 's/^application: *//p'` --version `git log --pretty=format:'%h' -n 1`"-tainted"
    08:31 PM Application: tryton-rietveld-hrd
    08:31 PM Warning: This application uses Backends, a deprecated feature that has been replaced by Modules, which offers additional functionality. Please convert your backends to modules as described at: https://developers.google.com/appengine/docs/python/modules/converting
    08:31 PM Host: appengine.google.com
    08:31 PM Starting update of app: tryton-rietveld-hrd, backend: mapreduce-backend
    08:31 PM Getting current resource limits.
    08:31 PM Scanning files on local disk.
    Could not guess mimetype for static/autocomplete/README.  Using application/octet-stream.
    Error 400: --- begin server output ---
    The version field in the app.yaml file must match the version provided as a GET parameter.
    --- end server output ---
    make: *** [Makefile:73: update_backend] Error 1
    

    I think it is because backends API has been shutdown: https://cloud.google.com/appengine/docs/deprecations/backends-api

    opened by cedk 0
  • Issue with closing idle DB connections automatically

    Issue with closing idle DB connections automatically

    We are using the database/sql package for interaction with MySQL DB along with golang MySQL driver. We are noticing that the idle connections are not getting closed even though they have exceeded the max number of allowed idle connections. Below are the settings that we are using in our application.

    dbController.Db.SetConnMaxLifetime(time.Second*60); dbController.Db.SetMaxIdleConns(10); dbController.Db.SetMaxOpenConns(300);

    Any help in this regard will be greatly appreciated.

    Regards, Satish

    opened by satishchandra76 0
  • can this use for google cloud repository

    can this use for google cloud repository

    hey i want a code review, like rietveld-codereview, for google cloud repository. can i use this, if yes then how to reconfigure this to make compatible with google cloud repository.

    opened by praveeno 0
  • [Chromium] BadValueError from Patch Set Delta

    [Chromium] BadValueError from Patch Set Delta

    badvalueerror

    I am working on a research project in which we are manually annotating code review comments on specific code review patches in the Chromium Project. We use the difference in a file between two subsequent patchsets (i.e. patch set delta) in our analysis. Over the last couple of weeks, we have been observing an increase in frequency of BadValueError unhandled exceptions.

    As suggested on the error page, I have created a post (https://groups.google.com/forum/#!topic/codereview-discuss/V56Rcut7ruM) on the discussion group. I am opening this issue because I was not certain if the error is in Rietveld (the product) or Chromium's instance of Rietveld.

    Here are some URLs that can be used replicate the issue:

    • https://codereview.chromium.org/1128903010/diff2/20001:40001/mojo/devtools/common/devtoolslib/android_shell.py
    • https://codereview.chromium.org/1909353002/diff2/80001:100001/src/messages.cc
    • https://codereview.chromium.org/1398553002/diff2/1:20001/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
    • https://codereview.chromium.org/345173002/diff2/20001:40001/chrome/chrome_tests.gypi
    • https://codereview.chromium.org/2093953002/diff2/80001:100001/chrome/browser/notifications/notification_platform_bridge_mac.mm
    • https://codereview.chromium.org/19239002/diff2/6001:13001/chrome/browser/resources/net_internals/waterfall_view.js
    opened by nuthanmunaiah 0
Various code metrics for Python code

Radon Radon is a Python tool that computes various metrics from the source code. Radon can compute: McCabe's complexity, i.e. cyclomatic complexity ra

Michele Lacchia 1.4k Jan 7, 2023
A Python application for tracking, reporting on timing and complexity in Python code

A command-line application for tracking, reporting on complexity of Python tests and applications. wily [a]: quick to think of things, having a very g

Anthony Shaw 1k Dec 29, 2022
Product-Review-Summarizer - Created a product review summarizer which clustered thousands of product reviews and summarized them into a maximum of 500 characters, saving precious time of customers and helping them make a wise buying decision.

Product-Review-Summarizer - Created a product review summarizer which clustered thousands of product reviews and summarized them into a maximum of 500 characters, saving precious time of customers and helping them make a wise buying decision.

Parv Bhatt 1 Jan 1, 2022
AI-powered literature discovery and review engine for medical/scientific papers

AI-powered literature discovery and review engine for medical/scientific papers paperai is an AI-powered literature discovery and review engine for me

NeuML 819 Dec 30, 2022
Explorer is a Autonomous (self-hosted) Bittorrent Network Search Engine.

Explorer Explorer is a Autonomous (self-hosted) Bittorrent Network Search Engine. About The Project Screenshots Supported features Number Feature 1 DH

null 51 Jun 14, 2022
Small, fast HTTP client library for Python. Features persistent connections, cache, and Google App Engine support. Originally written by Joe Gregorio, now supported by community.

Introduction httplib2 is a comprehensive HTTP client library, httplib2.py supports many features left out of other HTTP libraries. HTTP and HTTPS HTTP

null 457 Dec 10, 2022
A website application running in Google app engine, deliver rss news to your kindle. generate mobi using python, multilanguages supported.

Readme of english version refers to Readme_EN.md 简介 这是一个运行在Google App Engine(GAE)上的Kindle个人推送服务应用,生成排版精美的杂志模式mobi/epub格式自动每天推送至您的Kindle或其他邮箱。 此应用目前的主要

null 2.6k Jan 6, 2023
Google Kubernetes Engine (GKE) with a Snyk Kubernetes controller installed/configured for Snyk App

Google Kubernetes Engine (GKE) with a Snyk Kubernetes controller installed/configured for Snyk App This example provisions a Google Kubernetes Engine

Pas Apicella 2 Feb 9, 2022
First Party data integration solution built for marketing teams to enable audience and conversion onboarding into Google Marketing products (Google Ads, Campaign Manager, Google Analytics).

Megalista Sample integration code for onboarding offline/CRM data from BigQuery as custom audiences or offline conversions in Google Ads, Google Analy

Google 76 Dec 29, 2022
official ( API ) for the zAmericanEnglish app in [ Google play ] and [ App store ]

official ( API ) for the zAmericanEnglish app in [ Google play ] and [ App store ]

Plugin 3 Jan 12, 2022
:sparkles: Surface lint errors during code review

✨ Linty Fresh ✨ Keep your codebase sparkly clean with the power of LINT! Linty Fresh parses lint errors and report them back to GitHub as comments on

Lyft 183 Dec 18, 2022
An extensible and friendly code review tool for projects and companies of all sizes.

Review Board Review Board is an open source, web-based code and document review tool built to help companies, open source projects, and other organiza

Review Board 1.5k Jan 2, 2023
A terminal UI dashboard to monitor requests for code review across Github and Gitlab repositories.

A terminal UI dashboard to monitor requests for code review across Github and Gitlab repositories.

Kyle Harrison 150 Dec 14, 2022
Learning source code review, spot vulnerability, find some ways how to fix it.

Learn Source Code Review Learning source code review, spot vulnerability, find some ways how to fix it. WordPress Plugin Authenticated Stored XSS on C

Shan 24 Dec 31, 2022
A custom prime algorithm, implementation, and performance code & review

Colander A custom prime algorithm, implementation, and performance code & review Pseudocode Algorithm 1. given a number of primes to find, the followi

Finn Lancaster 3 Dec 17, 2021
Infrastructure as Code (IaC) for a self-hosted version of Gnosis Safe on AWS

Welcome to Yearn Gnosis Safe! Setting up your local environment Infrastructure Deploying Gnosis Safe Prerequisites 1. Create infrastructure for secret

Numan 16 Jul 18, 2022
A Tensorflow model for text recognition (CNN + seq2seq with visual attention) available as a Python package and compatible with Google Cloud ML Engine.

Attention-based OCR Visual attention-based OCR model for image recognition with additional tools for creating TFRecords datasets and exporting the tra

Ed Medvedev 933 Dec 29, 2022
geemap - A Python package for interactive mapping with Google Earth Engine, ipyleaflet, and ipywidgets.

A Python package for interactive mapping with Google Earth Engine, ipyleaflet, and folium

Qiusheng Wu 2.4k Dec 30, 2022
Simple CLI for Google Earth Engine Uploads

geeup: Simple CLI for Earth Engine Uploads with Selenium Support This tool came of the simple need to handle batch uploads of both image assets to col

Samapriya Roy 79 Nov 26, 2022
Get Landsat surface reflectance time-series from google earth engine

geextract Google Earth Engine data extraction tool. Quickly obtain Landsat multispectral time-series for exploratory analysis and algorithm testing On

Loïc Dutrieux 50 Dec 15, 2022