-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into maxi/hotfix-router-class
- Loading branch information
Showing
62 changed files
with
1,073 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## Expected Behavior | ||
|
||
|
||
## Actual Behavior | ||
|
||
|
||
## Steps to Reproduce the Problem | ||
|
||
1. | ||
1. | ||
1. | ||
|
||
## Specifications | ||
|
||
- Version: | ||
- Platform: | ||
- Subsystem: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
## Change description | ||
|
||
> Description here | ||
## Type of change | ||
- [ ] Bug fix (fixes an issue) | ||
- [ ] New feature (adds functionality) | ||
|
||
## Related issues | ||
|
||
> Fix [#1]() | ||
## Checklists | ||
|
||
### Development | ||
|
||
- [ ] Lint rules pass locally | ||
- [ ] Application changes have been tested thoroughly | ||
- [ ] Automated tests covering modified code pass | ||
|
||
### Security | ||
|
||
- [ ] Security impact of change has been considered | ||
- [ ] Code follows company security practices and guidelines | ||
|
||
### Code review | ||
|
||
- [ ] Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached as necessary | ||
- [ ] "Ready for review" label attached and reviewers assigned | ||
- [ ] Changes have been reviewed by at least one other contributor | ||
- [ ] Pull request linked to task tracker where applicable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
|
||
name: Build and upload Python package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
pull_request: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 12.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- name: Build frontend | ||
run: | | ||
cd frontend | ||
npm install -g 'yarn@<2' | ||
yarn | ||
yarn build | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: python -m build | ||
- name: 'Publish package (only for dev releases)' | ||
# For now avoiding publishing production releases: | ||
# - The setuptools guide: https://packaging.python.org/guides/distributing-packages-using-setuptools/#pre-release-versioning | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
if: ${{ startsWith(github.ref, 'refs/tags') && contains(github.ref, '.dev') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ | |
'debug_toolbar', | ||
'webpack_loader', | ||
'organizations', | ||
'waffle', | ||
'devsite', | ||
'figures', | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Requirements needed for Juniper community environment | ||
|
||
-r juniper_base.txt | ||
|
||
edx-organizations==5.2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Requirements needed for Juniper multisite environment | ||
|
||
-r juniper_base.txt | ||
|
||
# Organization/site mapping requires Appsembler's fork | ||
git+https://github.com/appsembler/[email protected] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
""" | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
""" | ||
Management command base classes for Figures. | ||
""" | ||
from datetime import datetime | ||
|
||
from django.contrib.sites.models import Site | ||
from django.core.management.base import BaseCommand | ||
|
||
from figures import helpers | ||
from figures.sites import get_sites | ||
|
||
|
||
class BaseBackfillCommand(BaseCommand): | ||
'''Base class for Figures backfill management commands with common options. | ||
''' | ||
def get_site_ids(self, identifier=None): | ||
"""Quick-n-dirty function to let the caller choose the site id or domain. | ||
If no identifier is passed, return all available Sites. | ||
Let the 'get' fail if record can't be found from the identifier. | ||
Returns Site ids for passing to Celery tasks. | ||
Note that at present, none of the tasks handle more than one specified Site. | ||
""" | ||
if not identifier: | ||
sites = get_sites() | ||
else: | ||
try: | ||
filter_arg = dict(pk=int(identifier)) | ||
except ValueError: | ||
filter_arg = dict(domain=identifier) | ||
sites = Site.objects.filter(**filter_arg) | ||
return [site.id for site in sites] | ||
|
||
def get_date(self, date_str=None): | ||
'''Return a datetime.date from a string or NoneType. | ||
''' | ||
try: | ||
return helpers.as_date(date_str) | ||
except TypeError: | ||
return datetime.today().date() | ||
|
||
def add_arguments(self, parser): | ||
''' | ||
''' | ||
# TODO: allow passing the queue to use. Warn if no_delay specified. | ||
parser.add_argument( | ||
'--site', | ||
help='backfill a specific site. provide numeric id or domain name', | ||
default=None | ||
) | ||
# TODO: handle date start later than date end | ||
parser.add_argument( | ||
'--date_start', | ||
help='date for which we start backfilling data', | ||
) | ||
parser.add_argument( | ||
'--date_end', | ||
help='date for which we end backfilling data', | ||
) | ||
parser.add_argument( | ||
'--no-delay', | ||
action='store_true', | ||
default=False, | ||
help='Disable the celery "delay" directive' | ||
) | ||
parser.add_argument( | ||
'--overwrite', | ||
action='store_true', | ||
default=False, | ||
help='Overwrite metrics records if they exist for the given date' | ||
) | ||
|
||
def print_exc(self, metrics_type, date, exc_message): | ||
print("Could not populate {} for {}. Exception was {}".format( | ||
metrics_type, date, exc_message) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"""Django management commands for Figures. | ||
""" |
Oops, something went wrong.