Web Site Project Page: Difference between revisions

From GCD
Jump to navigation Jump to search
m (new technical issues)
 
(48 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== GCD Web Site Project Master Page ==
== GCD Web Site Project Master Page ==


The GCD is currently implementing a new web site to reflect the growth of the project and changes in available technology. This page summarizes the project status and provides links to information on various aspects of the work.
The GCD has recently moved to an entirely new server and code base! This page documents the ongoing work to implement more features and improve the new system, the initial deployment of which was somewhat rushed by the abrupt demise of our prior technical arrangement.
 
Our top priorities are:
* Improving our ability to credit and document contributions
* Improving the structure of our data for better display and search
* Improving our user interface (*we need a web designer for this*)
* Improving our search capabilities


We welcome assistance from programmers and non-programmers alike (yes, we have tasks for non-technical people!).
We welcome assistance from programmers and non-programmers alike (yes, we have tasks for non-technical people!).
== Releases and Status ==
Projected releases are named after comic books, and are planned in detail on their own pages.  Release numbering is tentative as intermediate releases may be added or removed as plans and features are revised.
{| border="1"
|+ '''GCD Site Releases by Code Name'''
|-
! Name !! # !! Purpose !! Status !! Next Milestone !! Next Date !! Comments
|-
| [[Release New Fun|New Fun]] || 1.0 || First functional, production-ready release. Will contain the minimum functionality needed to migrate from the old site.|| Planning || Detailed Requirements || 2008-11-02 || Named for the first U.S. comic book with all-new content.
|-
| [[Release More Fun|More Fun]] || 1.1 || Minor release for small items that are not critical for inclusion in New Fun, or that require us to already have control of the database. || Planning || || || As the comic "New Fun" became "More Fun", this release is just a small next step.
|-
| [[Release The Dandy|The Dandy]] || TBD || First release to include major steps towards the new schema.  There may be one or more small releases between More Fun and The Dandy || || || || Named for the very long-running British Weekly comic.  Also, this release should be quite [http://en.wiktionary.org/wiki/dandy dandy] :-)
|}


== Development Environment ==
== Development Environment ==


* Mailing List: [http://groups.google.com/group/gcd-tech gcd-tech at Google Groups]
* Mailing List: [http://groups.google.com/group/gcd-tech gcd-tech at Google Groups]
* Bug Tracking: [http://maelstrom.walton.uark.edu/bugs Bugzilla (GCD Tech version)]
* Source Code: [https://github.com/GrandComicsDatabase/gcd-django gcd-django at github]
* Source Code: [http://sourceforge.net/projects/grandcomic-book Subversion hosted by SourceForge]
* Bug Tracking: GitHub Issues (new work), with some old reports still in [http://dev.comics.org/bugs Bugzilla (GCD Tech version)]
* Code Reviews: [http://maelstrom.walton.uark.edu/reviewboard/ Review Board (GCD Tech installation)] (please read the [http://code.google.com/p/reviewboard/wiki/UserBasics User Documentation] and [http://code.google.com/p/reviewboard/wiki/Using_PostReview How to Use post-review])
* Code Reviews: [http://reviews.comics.org/ Review Board (GCD Tech installation)] (please read the [http://www.review-board.org/docs/manual/dev/users/ Users' Guide])


Note that the first Review Board documentation page tells you (buried in the text) how to get <code>post-review</code>, and the second tells you how to use it.  But they're not linked.  The docs need a bit of work, so we might put some tips here soon.
Figuring out what all that stuff in GitHub actually is, and which parts we're really using:
* [[Developer's Guide to the Code]]


How to set up a development environment:
How to set up a development environment:
* [http://grandcomic-book.svn.sourceforge.net/viewvc/grandcomic-book/pydjango/docs/Getting_Started_on_MacOS.txt MacOS ]
 
* [http://grandcomic-book.svn.sourceforge.net/viewvc/grandcomic-book/pydjango/docs/Getting_Started_on_Windows.txt Windows]
Please use the [https://github.com/GrandComicsDatabase/gcd-django-vagrant-install GCD Vagrant-based development environment]


Please join the mailing list and email us if you would like to help out!
Please join the mailing list and email us if you would like to help out!
Line 41: Line 32:
* [http://docs.djangoproject.com/ Django]
* [http://docs.djangoproject.com/ Django]
* [http://dev.mysql.com/doc/refman/5.0/en/ MySQL]
* [http://dev.mysql.com/doc/refman/5.0/en/ MySQL]
* [http://selenium.openqa.org/ Selenium]
* [http://www.elasticsearch.org/guide/ Elasticsearch]
* [http://django-haystack.readthedocs.org/en/latest/ Haystack]
 
== Bug/Issue Tracking and Workflow Management ==
 
New issues should be filed and tracked in GitHub.
 
Issues are available for anyone to work on. If someone is assigned to an issue contact that person before on it.
 
The following issues were voted on in 2018 and have not yet been implemented:
*Company Credits - https://www.comics.org/voting/ballot/335/
* Story Credits - https://www.comics.org/voting/ballot/337/


== Standards and Best Practices ==
== Standards and Best Practices ==


Code submitted to the project should follow these standards.  We intend to use [[http://www.review-board.org/ Review Board]] for code reviews as soon as we have a chance to set it up (It's up and running, but email seems to not be working et. Stay tuned).  Some of this is covered in places such as the Django documentation but is important enough to be specifically called out here.
Code submitted to the project should follow these standards.  All changes go through code review and must be approved '''before''' being checked in.  Some of these guidelines are covered in places such as the Django documentation, but the ones restated below are items we feel are important enough to be called out here.
 
=== Using Pull Requests ===
 
See [https://help.github.com/articles/about-pull-requests/ pull requests on github]


=== For Python ===
=== Standards For Python Code ===
; Write Python 2.4 compatible code.
; Write Python 2.7 compatible code.
: This is in part because of compatibility problems with a dependent package on Mac OS 10.4But also because hosting environments might not all be up to 2.5 yet (although that is less of a concern as time goes on).  Your code should be compatible with Python 2.4-2.6.
: This is our current production environmentPython 3 is not yet supported.


; Follow the [http://www.python.org/dev/peps/pep-0008/ Python Style Guide]. Read the whole thing, as it is full of useful advice.
; Follow the [http://www.python.org/dev/peps/pep-0008/ Python Style Guide]. Read the whole thing, as it is full of useful advice.
Line 64: Line 70:


; When breaking a statement across two lines, if there is no obvious way to indent it, indent '''two''' characters '''more''' than the start of the statement.
; When breaking a statement across two lines, if there is no obvious way to indent it, indent '''two''' characters '''more''' than the start of the statement.
: This makes it clear that the continued statement is not another indented block.  When possible, line up continued statements by lining up arguments vertically, or the continued operand in an expression with the operand on the previous line.  But when no such rule applies, use two extra spaces.
: This makes it clear that the continued statement is not another indented block.  When possible, line up continued statements by lining up arguments vertically, or the continued operand in an expression with the operand on the previous line.  But when no such rule applies, use two extra spaces. Examples:
 
Breaking with an "obvious" indentations scheme of lining up operands vertically:
<pre>
    foo = (bar.some_numeric_thingy +
          some_other_number)
</pre>
 
Breaking when there is no obvious indentations scheme (so two spaces are used):
<pre>
    SomeClass.some_list_of_things[indexy_bit].big_long_method_call(
      some_long_variable_name)
</pre>
 
Note that it's often better to just break things up into multiple statements by using a few local varaibles in these situations:
<pre>
    thingy = SomeClass.some_list_of_things[indexy_bit]
    thingy.big_long_method_call(some_long_variable_name)
</pre>


; Do not use global variables.  Ever.
; Do not use global variables.  Ever.
Line 70: Line 94:


; Make everything portable, and especially use <code>os.path</code> when working with files and directories.
; Make everything portable, and especially use <code>os.path</code> when working with files and directories.
: The project currently has only three active developers and a shared test are, but already needs to run on MacOS, Windows and Linux.  We also do not yet know what our hosting environment will be.  So don't do anything that will limit us.
: The project currently has only three active developers and a shared test area, but already needs to run on MacOS, Windows and Linux.  We also do not yet know what our hosting environment will be.  So don't do anything that will limit us.
 
; When capturing from regular expressions, use named capture groups, not positional groups.
: This make regular expressions more robust if the string ever changes and capture groups get reordered.  Additionally, while the regexp itself is a bit more cluttered, the intention of the capture groups is much more clear.  Examples:
 
Bad:
<pre>
    m = re.search(r'foo:\s*(\w*), (\w*)', target)
    foo = m.groups()[1]
    bar = m.groups()[2]
</pre>
 
Good:
<pre>
    m = re.search(r'foo:\s*(?P<foo>\w*), (?P<bar>\w*)', target)
    foo = m.group('foo')
    bar = m.group('bar')
</pre>
 
=== For Perl Code ===
; Where possible, be compatible with the Python standards listed above.
: Exceptions are obvious language community differences such as packages being CamelCase in Perl while they are lower_case in Python.  Use Perl-style package names for Perl packages.  Other exceptions should be documented here as they are noted.


=== For Django Models ===
=== For Django Models ===
; Do not refer to Views, Templates or site URLs.
; Do not refer to Views, Templates or site URLs.
: Models are pure data representation.  They should present what is in the database, and sometimes expose methods that make that data easier to work with.  But they should essentially be unaware of the higher layers of the application.  Note that model fields that contain URLs because the database contains URLs are OK.  These are generally external links anyway (like the URL field for publishers).
: Models are pure data representation.  They should present what is in the database, and sometimes expose methods that make that data easier to work with.  But they should essentially be unaware of the higher layers of the application.  Note that model fields that contain URLs because the database contains URLs are OK.  These are generally external links anyway (like the URL field for publishers).
:There is one notable exception to this rule, which is the get_absolute_url() method which is a Django convention for models.  The Head Programmer does not like this method, because it ties the model representation to a single URL when we may wish to have several different URLs (for instance, one for display purposes, and one for REST API purposes).  However, given that parts of Django expect this convention, it may be implemented and the basic display URL for the model should be used.


=== For Django Views ===
=== For Django Views ===
Line 84: Line 131:


=== For Django Templates ===
=== For Django Templates ===
; We need a style guide for templates!
; We are still developing our template style
: Suggestions appreciated.  For now, stick with the following rules:
: Suggestions appreciated.  For now, stick with the following rules, and when you're working on a template that doesn't already conform, please try to leave it in better shape than you found it.
 
; Template tags should have exactly one space inside of the enclosing punctuation
: Example: <tt>{% if bar %} &lt;span class="data"&gt;<nowiki>{{ foo }}</nowiki>&lt;/span&gt; {% endif %}</tt>
 
; Use two-space indentations
: It's easy to get a lot of indentations in these things, so let's not get carried away.
 
; Indent HTML and Django template tags independently
: Trying to keep up with one indentation scheme results in weird misalignments when you just look at HTML or just look at template tags.  So don't try.  Indent all of your template tags consistently with each other.  Indent all of your HTML tags consistently with each other.  Don't worry if they don't make indentation sense together.


; Please try to keep content within 80 columns, but do not go through confusing contortions in the process.
; Please try to keep content within 80 columns, but do not go through confusing contortions in the process.
: In other words, if you've got long URLs or if you need to string things together due to the vagaries of how Django's template engine performs substitutions, go ahead and let the line be as long as it needs to be.  However, don't put
: In other words, if you've got long URLs or if you need to string things together due to the vagaries of how Django's template engine performs substitutions, go ahead and let the line be as long as it needs to be.  Sometimes, due to how Django templates treat space, this can be very long indeed.


=== For HTML ===
=== For HTML ===
Line 104: Line 160:
=== For JavaScript ===
=== For JavaScript ===


We have not yet determined how and to what extend we want to use JavaScript.  Please discuss any ideas with the Head Programmer first.  Input on this topic is welcome.
We have not yet determined how and to what extent we want to use JavaScript.  Please discuss any ideas with the Head Programmer first.  Input on this topic is welcome.
 
== Historical Note ==
 
Some interesting historical info that used to be on this page but became outdated enough to be confusing has been moved to [[Tech Archive]].
 
[[Category: GCD Technical]]

Latest revision as of 01:15, 3 December 2018

GCD Web Site Project Master Page

The GCD has recently moved to an entirely new server and code base! This page documents the ongoing work to implement more features and improve the new system, the initial deployment of which was somewhat rushed by the abrupt demise of our prior technical arrangement.

Our top priorities are:

  • Improving our ability to credit and document contributions
  • Improving the structure of our data for better display and search
  • Improving our user interface (*we need a web designer for this*)
  • Improving our search capabilities

We welcome assistance from programmers and non-programmers alike (yes, we have tasks for non-technical people!).

Development Environment

Figuring out what all that stuff in GitHub actually is, and which parts we're really using:

How to set up a development environment:

Please use the GCD Vagrant-based development environment

Please join the mailing list and email us if you would like to help out!

3rd-party Documentation

Bug/Issue Tracking and Workflow Management

New issues should be filed and tracked in GitHub.

Issues are available for anyone to work on. If someone is assigned to an issue contact that person before on it.

The following issues were voted on in 2018 and have not yet been implemented:

Standards and Best Practices

Code submitted to the project should follow these standards. All changes go through code review and must be approved before being checked in. Some of these guidelines are covered in places such as the Django documentation, but the ones restated below are items we feel are important enough to be called out here.

Using Pull Requests

See pull requests on github

Standards For Python Code

Write Python 2.7 compatible code.
This is our current production environment. Python 3 is not yet supported.
Follow the Python Style Guide. Read the whole thing, as it is full of useful advice.
This saves us from arguing over which of our personal styles should be used. Code that does not meet these guidelines will not be allowed through code review. If you find existing code that does not comply, please consider cleaning it up. Do not consider it an excuse to write more non-compliant code.
Read Python Idioms and Anti-Idioms
And do what it says :-)
Read the Docstring Guide
And do what it says :-)
Always place one space after each comma separating function arguments.
Unless of course there's a newline. For some reason this is not mentioned in the style guide, although all examples there follow it.
When breaking a statement across two lines, if there is no obvious way to indent it, indent two characters more than the start of the statement.
This makes it clear that the continued statement is not another indented block. When possible, line up continued statements by lining up arguments vertically, or the continued operand in an expression with the operand on the previous line. But when no such rule applies, use two extra spaces. Examples:

Breaking with an "obvious" indentations scheme of lining up operands vertically:

    foo = (bar.some_numeric_thingy +
           some_other_number)

Breaking when there is no obvious indentations scheme (so two spaces are used):

    SomeClass.some_list_of_things[indexy_bit].big_long_method_call(
      some_long_variable_name)

Note that it's often better to just break things up into multiple statements by using a few local varaibles in these situations:

    thingy = SomeClass.some_list_of_things[indexy_bit]
    thingy.big_long_method_call(some_long_variable_name)
Do not use global variables. Ever.
If for some reason you feel you must do this, you must get approval from the Head Programmer first. The current acting Head Programmer is unlikely to approve such a thing. If 3rd-party libraries or frameworks rely on global variables, you may of course use them as required.
Make everything portable, and especially use os.path when working with files and directories.
The project currently has only three active developers and a shared test area, but already needs to run on MacOS, Windows and Linux. We also do not yet know what our hosting environment will be. So don't do anything that will limit us.
When capturing from regular expressions, use named capture groups, not positional groups.
This make regular expressions more robust if the string ever changes and capture groups get reordered. Additionally, while the regexp itself is a bit more cluttered, the intention of the capture groups is much more clear. Examples:

Bad:

    m = re.search(r'foo:\s*(\w*), (\w*)', target)
    foo = m.groups()[1]
    bar = m.groups()[2]

Good:

    m = re.search(r'foo:\s*(?P<foo>\w*), (?P<bar>\w*)', target)
    foo = m.group('foo')
    bar = m.group('bar')

For Perl Code

Where possible, be compatible with the Python standards listed above.
Exceptions are obvious language community differences such as packages being CamelCase in Perl while they are lower_case in Python. Use Perl-style package names for Perl packages. Other exceptions should be documented here as they are noted.

For Django Models

Do not refer to Views, Templates or site URLs.
Models are pure data representation. They should present what is in the database, and sometimes expose methods that make that data easier to work with. But they should essentially be unaware of the higher layers of the application. Note that model fields that contain URLs because the database contains URLs are OK. These are generally external links anyway (like the URL field for publishers).
There is one notable exception to this rule, which is the get_absolute_url() method which is a Django convention for models. The Head Programmer does not like this method, because it ties the model representation to a single URL when we may wish to have several different URLs (for instance, one for display purposes, and one for REST API purposes). However, given that parts of Django expect this convention, it may be implemented and the basic display URL for the model should be used.

For Django Views

Use named groups in the URL conf for argument passing.
This makes view invocation more robust.
Use named URLs to disambiguate reverse mappings.
This supports better abstraction when code needs to look up URLs.

For Django Templates

We are still developing our template style
Suggestions appreciated. For now, stick with the following rules, and when you're working on a template that doesn't already conform, please try to leave it in better shape than you found it.
Template tags should have exactly one space inside of the enclosing punctuation
Example: {% if bar %} <span class="data">{{ foo }}</span> {% endif %}
Use two-space indentations
It's easy to get a lot of indentations in these things, so let's not get carried away.
Indent HTML and Django template tags independently
Trying to keep up with one indentation scheme results in weird misalignments when you just look at HTML or just look at template tags. So don't try. Indent all of your template tags consistently with each other. Indent all of your HTML tags consistently with each other. Don't worry if they don't make indentation sense together.
Please try to keep content within 80 columns, but do not go through confusing contortions in the process.
In other words, if you've got long URLs or if you need to string things together due to the vagaries of how Django's template engine performs substitutions, go ahead and let the line be as long as it needs to be. Sometimes, due to how Django templates treat space, this can be very long indeed.

For HTML

Use 2-character indentation for each nesting level.

For CSS

All CSS goes in external style sheets.
When modifying styles dynamically, it is better to modify the element's class(es) than set styles directly.
Classes and IDs are always lower_case_separated_by_underscores.
Colors are always associated with class names that define an elements role in the color scheme.
i.e. background, foreground, hilight, etc. Actual list TBD.

For JavaScript

We have not yet determined how and to what extent we want to use JavaScript. Please discuss any ideas with the Head Programmer first. Input on this topic is welcome.

Historical Note

Some interesting historical info that used to be on this page but became outdated enough to be confusing has been moved to Tech Archive.