Skip to content

Commit

Permalink
Merge pull request #1508 from SEED-platform/develop
Browse files Browse the repository at this point in the history
Release 2.2.1 to Master
  • Loading branch information
nllong authored Nov 16, 2017
2 parents 0f3774d + 260fce4 commit 2c52627
Show file tree
Hide file tree
Showing 188 changed files with 3,431 additions and 6,390 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ src/
*node_modules*
bower_components/

package-lock.json
docs/build/
dump.rdb
log
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ env:
- TOX_ENV=python
- TOX_ENV=flake8
- TOX_ENV=docs
# - TOX_ENV=functional
- TOX_ENV=functional
- TOX_ENV=apitest
script:
- tox -e $TOX_ENV
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# SEED Version 2.2.1

Closed Issues: 5
- Fixed [#1486]( https://github.com/SEED-platform/seed/pull/1486 ), Upgrade to Django 1.11
- Fixed [#1502]( https://github.com/SEED-platform/seed/pull/1502 ), Fix password reset
- Fixed [#1363]( https://github.com/SEED-platform/seed/issues/1363 ), DQ Check - Add export to Inventory DQ Results modal
- Fixed [#1397]( https://github.com/SEED-platform/seed/issues/1397 ), DQ Admin: add indication of field source (tax lot or property)
- Fixed [#1398]( https://github.com/SEED-platform/seed/issues/1398 ), DQ: Add labels for exported records
- Fixed [#1404]( https://github.com/SEED-platform/seed/issues/1404 ), Inventory Detail - Related Properties - need to display more fields
- Fixed [#1439]( https://github.com/SEED-platform/seed/issues/1439 ), Strftime fails for buildings older than 1900
- Fixed [#1496]( https://github.com/SEED-platform/seed/pull/1496 ), Export data from inventory (including labels)
- Fixed [#1482]( https://github.com/SEED-platform/seed/pull/1482 ), Remove the concept of projects
- Fixed [#1483]( https://github.com/SEED-platform/seed/pull/1483 ), Added `Custom ID 1` field for Related Properties
- Fixed [#1484]( https://github.com/SEED-platform/seed/pull/1484 ), Added a mapping button to `Map SEED fields to imported file fields`
- Fixed [#1481]( https://github.com/SEED-platform/seed/pull/1481 ), Hides `*_pint` columns in Property List Settings view
- Fixed [#1487]( https://github.com/SEED-platform/seed/pull/1487 ), Improved Column Saving
- Fixed [#1490]( https://github.com/SEED-platform/seed/pull/1490 ), Export DQ from Inventory
- Fixed [#1493]( https://github.com/SEED-platform/seed/pull/1493 ), Removes node_modules from fine-uploader after building
- Fixed [#1473]( https://github.com/SEED-platform/seed/pull/1473 ), Improved Angular unit tests
- Fixed [#1479]( https://github.com/SEED-platform/seed/pull/1479 ), Disable all client-side caching when the dev profile is used

# SEED Version 2.2

Closed Issues: 25
Expand Down
4 changes: 2 additions & 2 deletions bin/backup_database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ echo "pg_dump -U ${DB_USERNAME} -Fc ${DB_NAME} > $(file_name)"
pg_dump -U ${DB_USERNAME} -Fc ${DB_NAME} > $(file_name)
unset PGPASSWORD

# Delete files older than 30 days
find ${BACKUP_DIR} -mtime +30 -type f -name '*.sql' -delete
# Delete files older than 45 days
find ${BACKUP_DIR} -mtime +45 -type f -name '*.dump' -delete
1 change: 1 addition & 0 deletions bin/install_javascript_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ then
sed -i -e 's/compress: true/compress: \{\}/g' Gruntfile.coffee
npm install
$grunt build
rm -rf node_modules
cd ../../../../../
else
echo -e "\n\n\nFineuploader already built"
Expand Down
1 change: 1 addition & 0 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"bootstrap": "~3.3.7",
"d3": "=3.5.2",
"dimple": "=2.2.0",
"file-saver": "^1.3.3",
"fine-uploader": "git://github.com/FineUploader/fine-uploader.git#3.9.1",
"font-awesome": "~4.4.0",
"jasmine-core": "=1.3.1",
Expand Down
27 changes: 12 additions & 15 deletions config/management/commands/grab_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,42 @@
:copyright (c) 2014 - 2017, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Department of Energy) and contributors. All rights reserved. # NOQA
:author
"""
import optparse
from django.core.management.base import BaseCommand, CommandError
import urllib2
from os import makedirs, remove
from os.path import abspath, dirname, join, exists
from sys import argv
import urllib2

from django.core.management.base import BaseCommand, CommandError

CACHE_DIR = "CACHE"
MANIFEST_FILENAME = "manifest.json"


class Command(BaseCommand):

option_list = BaseCommand.option_list + (
optparse.make_option('--force',
action='store_true', dest='force', default=False,
help="Force download."),
)

help = 'Syncs the complete STATIC_ROOT structure and files to S3 into the given bucket name.'
args = 'bucket_name'

can_import_settings = True

def add_arguments(self, parser):
parser.add_argument('--force',
action='store_true', dest='force', default=False,
help="Force download.")

def handle(self, *args, **options):
from django.conf import settings

# Check for AWS keys in settings
if not hasattr(settings, 'AWS_ACCESS_KEY_ID') or \
not hasattr(settings, 'AWS_SECRET_ACCESS_KEY'):
raise CommandError('Missing AWS keys from settings file. Please' +\
'supply both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.')
not hasattr(settings, 'AWS_SECRET_ACCESS_KEY'):
raise CommandError('Missing AWS keys from settings file. Please' + \
'supply both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.')
else:
self.AWS_ACCESS_KEY_ID = settings.AWS_ACCESS_KEY_ID
self.AWS_SECRET_ACCESS_KEY = settings.AWS_SECRET_ACCESS_KEY

if not hasattr(settings, 'AWS_STORAGE_BUCKET_NAME'):
raise CommandError('Missing bucket name from settings file. Please' +
' add the AWS_STORAGE_BUCKET_NAME to your settings file.')
' add the AWS_STORAGE_BUCKET_NAME to your settings file.')
else:
if not settings.AWS_STORAGE_BUCKET_NAME:
raise CommandError('AWS_STORAGE_BUCKET_NAME cannot be empty.')
Expand Down
47 changes: 20 additions & 27 deletions config/management/commands/sync_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import datetime
import email
import mimetypes
import optparse
import os
import time

Expand All @@ -48,6 +47,8 @@


class Command(BaseCommand):
help = 'Syncs the complete STATIC_ROOT structure and files to S3 into the given bucket name.'

# TODO: might be better as instance variables rather than class variables
# in case more than one Command instance with different key or dir is needed
# Extra variables to avoid passing these around
Expand All @@ -65,30 +66,31 @@ class Command(BaseCommand):
upload_count = 0
skip_count = 0

option_list = BaseCommand.option_list + (
optparse.make_option('-p', '--prefix',
dest='prefix', default='',
help="The prefix to prepend to the path on S3."),
optparse.make_option('--gzip',
action='store_true', dest='gzip', default=False,
help="Enables gzipping CSS and Javascript files."),
optparse.make_option('--expires',
action='store_true', dest='expires', default=False,
help="Enables setting a far future expires header."),
optparse.make_option('--force',
action='store_true', dest='force', default=False,
help="Skip the file mtime check to force upload of all files.")
)

help = 'Syncs the complete STATIC_ROOT structure and files to S3 into the given bucket name.'
args = 'bucket_name'

def add_arguments(self, parser):
parser.add_argument('-p', '--prefix',
dest='prefix', default='',
help="The prefix to prepend to the path on S3.")
parser.add_argument('--gzip',
action='store_true', dest='gzip', default=False,
help="Enables gzipping CSS and Javascript files.")
parser.add_argument('--expires',
action='store_true', dest='expires', default=False,
help="Enables setting a far future expires header.")
parser.add_argument('--force',
action='store_true', dest='force', default=False,
help="Skip the file mtime check to force upload of all files.")
parser.add_argument('-v', '--verbosity',
dest='verbosity', default=1, action='count',
help="Verbose mode. Multiple -v options increase the verbosity.")

def handle(self, *args, **options):
from django.conf import settings

# Check for AWS keys in settings
if not hasattr(settings, 'AWS_ACCESS_KEY_ID') or \
not hasattr(settings, 'AWS_SECRET_ACCESS_KEY'):
not hasattr(settings, 'AWS_SECRET_ACCESS_KEY'):
raise CommandError('Missing AWS keys from settings file. Please' +
'supply both AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.')
else:
Expand Down Expand Up @@ -242,12 +244,3 @@ def upload_s3(self, arg, dirname, names):
self.upload_count += 1

file_obj.close()


# Backwards compatibility for Django r9110
if not [opt for opt in Command.option_list if opt.dest == 'verbosity']:
Command.option_list += (
optparse.make_option('-v', '--verbosity',
dest='verbosity', default=1, action='count',
help="Verbose mode. Multiple -v options increase the verbosity."),
)
5 changes: 2 additions & 3 deletions config/settings/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
SESSION_COOKIE_SECURE = ONLY_HTTPS
CSRF_COOKIE_SECURE = ONLY_HTTPS
if ONLY_HTTPS:
MIDDLEWARE_CLASSES = ('sslify.middleware.SSLifyMiddleware',) + \
MIDDLEWARE_CLASSES
MIDDLEWARE = ('sslify.middleware.SSLifyMiddleware',) + MIDDLEWARE

# Upload to S3
AWS_S3_MAX_MEMORY_SIZE = 1024 * 1024
Expand Down Expand Up @@ -89,7 +88,7 @@
# logging
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'disable_existing_loggers': False,
'root': {
'level': 'WARNING',
'handlers': ['sentry']
Expand Down
16 changes: 8 additions & 8 deletions config/settings/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,14 @@
},
},
]

MIDDLEWARE_CLASSES = (
MIDDLEWARE = (
'django.middleware.gzip.GZipMiddleware',
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.BrokenLinkEmailsMiddleware',
'seed.utils.api.APIBypassCSRFMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)
Expand All @@ -90,7 +89,6 @@
'compressor',
'django_extensions',
'raven.contrib.django.raven_compat',
'tos',
'django_filters',
'rest_framework',
'rest_framework_swagger',
Expand Down Expand Up @@ -171,6 +169,12 @@
'class': 'logging.StreamHandler',
'formatter': 'verbose',
}
},
'loggers': {
'': {
'level': 'INFO',
'handlers': ['console'],
}
}
}

Expand Down Expand Up @@ -223,8 +227,6 @@

# Django 1.5+ way of doing user profiles
AUTH_USER_MODEL = 'landing.SEEDUser'
NOSE_ARGS = ['--exclude-dir=libs/dal']

AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
Expand Down Expand Up @@ -273,8 +275,6 @@
'DATETIME_INPUT_FORMATS': (
'%Y:%m:%d', 'iso-8601', '%Y-%m-%d'
),
'VIEW_DESCRIPTION_FUNCTION':
'rest_framework_swagger.views.get_restructuredtext',
'EXCEPTION_HANDLER': 'seed.exception_handler.custom_exception_handler'
}

Expand Down
2 changes: 2 additions & 0 deletions config/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
},
}

MIDDLEWARE = ('seed.utils.nocache.DisableClientSideCachingMiddleware',) + MIDDLEWARE

CACHES = {
'default': {
'BACKEND': 'redis_cache.cache.RedisCache',
Expand Down
6 changes: 3 additions & 3 deletions config/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
# Enable this if not using Cloudflare
#ONLY_HTTPS = os.environ.get('ONLY_HTTPS', 'True') == 'True'
#if ONLY_HTTPS:
# MIDDLEWARE_CLASSES = ('sslify.middleware.SSLifyMiddleware',) + \
# MIDDLEWARE_CLASSES
# MIDDLEWARE = ('sslify.middleware.SSLifyMiddleware',) + \
# MIDDLEWARE

# PostgreSQL DB config - override in local_untracked if needed
DATABASES = {
Expand Down Expand Up @@ -63,7 +63,7 @@
# logging
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'disable_existing_loggers': False, # use the default
'root': {
'level': 'WARNING',
'handlers': ['sentry']
Expand Down
25 changes: 13 additions & 12 deletions config/settings/travis.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
"""
from __future__ import absolute_import

import sys

from config.settings.test import * # noqa


DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
Expand All @@ -22,15 +19,19 @@
}
}

if 'test' in sys.argv:
class DisableMigrations(object):
def __contains__(self, item):
return True

def __getitem__(self, item):
return "notmigrations"

MIGRATION_MODULES = DisableMigrations()
# if 'test' in sys.argv:
# # Skip migrations to make testing faster
# MIGRATION_MODULES = {
# 'auth': None,
# 'contenttypes': None,
# 'default': None,
# 'sessions': None,
#
# 'core': None,
# 'profiles': None,
# 'snippets': None,
# 'scaffold_templates': None,
# }

CACHES = {
'default': {
Expand Down
4 changes: 2 additions & 2 deletions config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from rest_framework_swagger.views import get_swagger_view

from config.views import robots_txt
from seed.api.base.urls import urlpatterns as api
Expand All @@ -21,12 +22,11 @@
url(r'^app/', include('seed.urls', namespace="seed", app_name="seed")),

# root configuration items
url(r'^eula/', include('tos.urls', namespace='tos', app_name='tos')),
url(r'^i18n/', include('django.conf.urls.i18n')),
url(r'^robots\.txt', robots_txt, name='robots_txt'),

# API
url(r'^api/swagger/', include('rest_framework_swagger.urls'), name='swagger'),
url(r'^api/swagger/', get_swagger_view(title='SEED API'), name='swagger'),
url(r'^api/', include(api, namespace='api')),
]

Expand Down
7 changes: 4 additions & 3 deletions docs/release_instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ To perform a release make sure to do the following.
1. Update the `package.json` file with the most recent version number. Always use MAJOR.MINOR.RELEASE.
1. Run the `docs/scripts/change_log.rb` script and add the changes to the CHANGELOG.md file for the range of time between last release and this release.


ruby docs/scripts/change_log.rb --token GITHUB_API_TOKEN --start-date 2017-07-01 --end-date 2017-09-30

1. Paste the results (except the Accepted Pull Requests) into the CHANGELOG.md. Make sure to cleanup the formatting.
1. Paste the results (remove unneeded Accepted Pull Requests) into the CHANGELOG.md. Make sure to cleanup the formatting.
1. Create new PR against develop with the updates.
1. Once develop passes, then create a new PR from develop to master.
1. Draft new Release from Github (https://github.com/SEED-platform/seed/releases).
1. Include list of changes since previous release. (From the console output with the ![Fixed:] text.
1. Include list of changes since previous release (i.e. the content in the CHANGELOG.md)
1. Verify that the Docker versions are built and pushed to Docker hub (https://hub.docker.com/r/seedplatform/seed/tags/).
1. Go to Read the Docs and enable the latest version to be active (https://readthedocs.org/dashboard/seed-platform/versions/)
4 changes: 2 additions & 2 deletions docs/scripts/change_log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ def print_issue(issue)
issue.labels.each { |label| is_feature = true if label.name == 'Feature Request' }

if is_feature
"- ![Improved:][improved] [#{get_issue_num(issue)}]( #{get_html_url(issue)} ), #{get_title(issue)}"
"- Improved [#{get_issue_num(issue)}]( #{get_html_url(issue)} ), #{get_title(issue)}"
else
"- ![Fixed:][fixed] [#{get_issue_num(issue)}]( #{get_html_url(issue)} ), #{get_title(issue)}"
"- Fixed [#{get_issue_num(issue)}]( #{get_html_url(issue)} ), #{get_title(issue)}"
end
end

Expand Down
Loading

0 comments on commit 2c52627

Please sign in to comment.