Skip to content

Commit

Permalink
Merge pull request #60 from stephengtuggy/development
Browse files Browse the repository at this point in the history
Merge development into master before releasing v0.4.0
  • Loading branch information
stephengtuggy authored May 26, 2021
2 parents 056ca92 + fb3fd98 commit 14ec1c6
Show file tree
Hide file tree
Showing 14 changed files with 397 additions and 6 deletions.
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
JOB_HISTORY_ALLOWED_HOSTS=0.0.0.0,my-desktop
JOB_HISTORY_DB_HOST=job_history_db
JOB_HISTORY_DB_NAME=job_history
JOB_HISTORY_DB_PASSWORD=8KkMs8a2SdxUw25CAwmuyantK5dbK1xT
JOB_HISTORY_DB_PORT=5432
JOB_HISTORY_DB_USERNAME=postgres
JOB_HISTORY_DEBUG=FALSE
JOB_HISTORY_SECRET_KEY=4VGVMQDKbpMsAostzHCtlfOUTHFAMx03zeXza96WGiPxt3qTtkQcTyr
JOB_HISTORY_STATIC_ROOT=/usr/src/app/static/
JOB_HISTORY_STATIC_URL=/app/static/
POSTGRES_DB=job_history
POSTGRES_PASSWORD=8KkMs8a2SdxUw25CAwmuyantK5dbK1xT
POSTGRES_USER=postgres
47 changes: 47 additions & 0 deletions .github/workflows/shiftleft-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow integrates Scan with GitHub's code scanning feature
# Scan is a free open-source security tool for modern DevOps teams from ShiftLeft
# Visit https://slscan.io/en/latest/integrations/code-scan for help
name: SL Scan

# This section configures the trigger for the workflow. Feel free to customize depending on your convention
on: push

jobs:
Scan-Build:
# Scan runs on ubuntu, mac and windows
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
# Instructions
# 1. Setup JDK, Node.js, Python etc depending on your project type
# 2. Compile or build the project before invoking scan
# Example: mvn compile, or npm install or pip install goes here
# 3. Invoke Scan with the github token. Leave the workspace empty to use relative url

- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: '3.7' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified

- name: Install Dependencies
run: |
python -m pip install --upgrade-strategy eager --upgrade pip
python -m pip install --upgrade-strategy eager --upgrade --use-feature=2020-resolver -r app/requirements.txt
- name: Perform Scan
uses: ShiftLeftSecurity/scan-action@master
env:
WORKSPACE: ""
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SCAN_AUTO_BUILD: true
with:
output: reports
# Scan auto-detects the languages in your project. To override uncomment the below variable and set the type
# type: credscan,java
# type: python

- name: Upload report
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: reports
27 changes: 26 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
Expand All @@ -40,12 +42,14 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

Expand All @@ -57,6 +61,7 @@ coverage.xml
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
Expand All @@ -74,11 +79,26 @@ target/
# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# celery beat schedule file
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py
Expand All @@ -104,6 +124,11 @@ venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

.DS_Store
.vscode/
Expand Down
129 changes: 129 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Contributing

Thank you for taking the time to contribute to job-history! There are just a few things to be aware of when contributing to this project.

## Code of Conduct
First, please follow the [Code of Conduct](CODE_OF_CONDUCT.md).

## Filing Issues
Second, when filing issues or bugs, please try to fill out the complete template as much as possible. This will help save time in the long run.

## Pull Requests
When submitting a Pull Request, try to fill that template out thoroughly, as well. Link any related issues, with [closing keywords](https://docs.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword), if appropriate.

## Code Conventions
In general, please follow general Python/Django style guidelines, as well as the conventions you see used in the project already.

Thanks once again!
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This is a web app that lets you enter info about your current and past jobs into

This app runs in `Docker`. You will need both Docker and Docker Compose to build and run it. On macOS and Windows, the easiest way to get these products is to download and install Docker Desktop Community Edition.

Also, you will need a copy of a file called `.env`. Ask me for this file, and I can send you one, via a more secure channel than GitHub. Place this file in the root folder of your local working copy of this repo.
Also, you will need a copy of a file called `.env`. Place this file in the root folder of your local working copy of this repo. You can use `.env.example` as a reference/template. Be sure to change the values for `JOB_HISTORY_SECRET_KEY`, `JOB_HISTORY_DB_PASSWORD`, and `POSTGRES_PASSWORD`. (The last two values should match.)

Once you have these items in place, run the command `docker-compose up --build`, either in PowerShell on Windows, or in Terminal on macOS or Linux. You should see Docker Compose pulling the latest copy of each source docker image, then building the main image for this app, and finally, spinning up both containers.

Expand Down
21 changes: 21 additions & 0 deletions app/jobHistory/migrations/0008_auto_20200820_1614.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 2.2.15 on 2020-08-20 16:14

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('jobHistory', '0007_auto_20200813_1931'),
]

operations = [
migrations.AddConstraint(
model_name='employer',
constraint=models.UniqueConstraint(fields=('short_name',), name='employer_must_be_unique'),
),
migrations.AddConstraint(
model_name='position',
constraint=models.UniqueConstraint(fields=('employer', 'title'), name='position_must_be_unique'),
),
]
17 changes: 17 additions & 0 deletions app/jobHistory/migrations/0009_auto_20200821_2214.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.2.15 on 2020-08-21 22:14

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('jobHistory', '0008_auto_20200820_1614'),
]

operations = [
migrations.AddConstraint(
model_name='jobtimeperiod',
constraint=models.UniqueConstraint(fields=('position', 'start_year', 'is_current_position', 'end_year'), name='job_time_period_must_be_unique'),
),
]
25 changes: 25 additions & 0 deletions app/jobHistory/migrations/0010_auto_20200821_2227.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 2.2.15 on 2020-08-21 22:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('jobHistory', '0009_auto_20200821_2214'),
]

operations = [
migrations.RemoveConstraint(
model_name='jobtimeperiod',
name='job_time_period_must_be_unique',
),
migrations.AddConstraint(
model_name='jobtimeperiod',
constraint=models.UniqueConstraint(fields=('position', 'start_year', 'is_current_position'), name='job_time_period_must_be_unique_1'),
),
migrations.AddConstraint(
model_name='jobtimeperiod',
constraint=models.UniqueConstraint(condition=models.Q(is_current_position__exact=False), fields=('position', 'start_year', 'end_year'), name='job_time_period_start_and_end_year_must_be_unique_if_not_current_position'),
),
]
29 changes: 29 additions & 0 deletions app/jobHistory/migrations/0011_auto_20200821_2244.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Generated by Django 2.2.15 on 2020-08-21 22:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('jobHistory', '0010_auto_20200821_2227'),
]

operations = [
migrations.RemoveConstraint(
model_name='jobtimeperiod',
name='job_time_period_must_be_unique_1',
),
migrations.RemoveConstraint(
model_name='jobtimeperiod',
name='job_time_period_start_and_end_year_must_be_unique_if_not_current_position',
),
migrations.AddConstraint(
model_name='jobtimeperiod',
constraint=models.UniqueConstraint(fields=('position', 'start_year', 'start_month', 'start_day', 'is_current_position'), name='job_time_period_must_be_unique_A'),
),
migrations.AddConstraint(
model_name='jobtimeperiod',
constraint=models.UniqueConstraint(condition=models.Q(is_current_position__exact=False), fields=('position', 'start_year', 'start_month', 'start_day', 'end_year', 'end_month', 'end_day'), name='job_time_period_start_and_end_date_must_be_unique_if_not_current_position'),
),
]
Loading

0 comments on commit 14ec1c6

Please sign in to comment.