Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes from Transparent Path #356

Open
wants to merge 131 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
8446525
Update ISSUE_TEMPLATE.md
May 8, 2020
8b1bb38
update travis configs
May 9, 2020
6fddbe6
update travis configs
May 9, 2020
3bd0c35
Merge remote-tracking branch 'upstream/master'
May 10, 2020
109c646
move build to travis script
May 10, 2020
4a75e0d
update travis for aws
May 10, 2020
c4ea278
update travis for aws
May 11, 2020
5f82439
update travis for aws
May 11, 2020
6bb2130
update travis for aws
May 11, 2020
813e3b8
update travis for aws
May 11, 2020
5c4f196
update travis for aws
May 11, 2020
284c823
update travis for aws
May 11, 2020
565b580
update travis for aws
May 11, 2020
d5e7808
update travis for aws
May 11, 2020
3e719c8
update travis for aws
May 11, 2020
731212d
cleanup initital data
Jun 14, 2020
1ad1966
cleanup initital data
Jun 14, 2020
b148c9e
cleanup initital data
Jun 14, 2020
a80a7d5
remove organization_name
Jun 16, 2020
b31fc81
remove organization_name
Jun 17, 2020
d35d082
update travis var
Jun 18, 2020
c9c2d96
update travis var
Jun 18, 2020
aec2f69
update travis var
Jun 18, 2020
a05d287
revert keys
Jun 18, 2020
71fbd8c
fix org
Jun 18, 2020
9d572a3
fix org
Jun 18, 2020
e90cf33
fix org
Jun 18, 2020
c42f1d4
fix org
Jun 18, 2020
326eff3
fix org
Jun 18, 2020
9aee00a
fix org
Jun 18, 2020
9188eb8
fix org
Jun 18, 2020
a48e524
turn off tagged commits for builds
Jun 18, 2020
e752325
update docker compose with email host
Jul 15, 2020
e3f8a31
update docker compose with email host
Jul 15, 2020
756f786
update docker compose with email host
Jul 15, 2020
f61771d
update docker compose with email host
Jul 15, 2020
6ac09bd
add options function to gateway
Jul 16, 2020
f9ee4b6
update permissions with options
Jul 21, 2020
8b2112c
refactor: Allow organization name to be accepted when creating core user
Dec 1, 2020
a20738a
chore: Update initial setup
Dec 2, 2020
f783a6a
test: Refactored test cases for organization
Dec 2, 2020
46dac52
fix: Flake8 warnings
Dec 2, 2020
14f4339
Flake8 Error fixes
Dec 2, 2020
73fcaac
chore: Flake8 fixes for whitespaces and f-strings
Dec 2, 2020
2454248
chore: Resolved ContextualVersionConflict
Dec 2, 2020
73bffeb
chore: requests dependency version
Dec 2, 2020
fee8349
Merge pull request #26 from TransparentPath/feature/organization_name…
Jan 5, 2021
d517248
Changes for Oauth in Initial Script
Jan 20, 2021
02c90b3
Merge pull request #28 from TransparentPath/fix/loadinitialdata
Jan 20, 2021
d418f93
removed changed in gateway view to allow options methid from service
vishalajackus Jan 27, 2021
afc11e5
removed changed in gateway view to allow options methid from service
vishalajackus Jan 27, 2021
2616b22
Commenting out options function for options response of services
vishalajackus Jan 27, 2021
2b81d93
Merge pull request #30 from TransparentPath/options_method
Jan 28, 2021
a454509
email alert message for shipment to user
vishalajackus Feb 5, 2021
3223239
Use generalised function name
vishalajackus Feb 8, 2021
c32ca1e
initial commit
ashishkmishra36 Feb 9, 2021
a5ff0d8
added seperate endpoint for update
ashishkmishra36 Feb 10, 2021
341ee5d
Merge pull request #35 from TransparentPath/fix/edit-organization-name
vishalajackus Feb 10, 2021
8daa870
add more illutratative field in message
vishalajackus Feb 11, 2021
c01c660
remove commented code in html template of shipment alert
vishalajackus Feb 11, 2021
7dd78ae
modifify html template name to send email alert for shipment
vishalajackus Feb 11, 2021
30b1920
add white space
vishalajackus Feb 11, 2021
e9c305f
remove conflict
vishalajackus Feb 11, 2021
f42abcd
Merge pull request #33 from TransparentPath/tp_email_alert
ashishkmishra36 Feb 11, 2021
034dd40
Allow user to subscribe to email alert in Profile
ashishkmishra36 Feb 17, 2021
ede613c
fixed linting
ashishkmishra36 Feb 17, 2021
8a6cc28
changed shipment id to shipment_uuid
ashishkmishra36 Feb 17, 2021
7b573e7
Merge pull request #38 from TransparentPath/fix/allow-user-to-subscri…
Feb 17, 2021
eee0569
added email_alert_flag to CoreUser Serializer
ashishkmishra36 Feb 18, 2021
35dc0bb
fixed linting
ashishkmishra36 Feb 18, 2021
b93e128
Merge pull request #39 from TransparentPath/fix/allow-user-to-subscri…
ashishkmishra36 Feb 18, 2021
a81f287
added boolean field in organisation
vishalajackus Feb 25, 2021
506431a
Merge pull request #41 from TransparentPath/add_booleanfield
vishalajackus Feb 25, 2021
3e9cd80
Resolved issue in OPTIONS method via Core
Mar 9, 2021
4f5444a
Merge pull request #44 from TransparentPath/fix/options-resolution
vishalajackus Mar 9, 2021
456813e
TransparentPath/buildly-core/issues/45:add radis field in organization
vishalajackus Mar 16, 2021
0d10269
Merge pull request #46 from TransparentPath/add_radius
Mar 16, 2021
666f656
Added support for multiple email alerts
Mar 23, 2021
f15e56c
Merge pull request #47 from TransparentPath/feat/support-multiple-emails
Mar 23, 2021
7311d30
initial commit
ashishkmishra36 May 11, 2021
237b2aa
return only org names
ashishkmishra36 May 11, 2021
8b01b8e
removed debugging info
ashishkmishra36 May 11, 2021
a51d885
Merge pull request #49 from TransparentPath/list-of-existing-orgs
May 13, 2021
443c480
change in request format of email alert endpoint (#53)
vishalajackus Jun 2, 2021
bea2e45
Added consortium table and its endpoint (#50)
vishalajackus Jun 4, 2021
157350a
Added organization types (#56)
Jun 4, 2021
774f908
Approval email for newly registered users (#57)
Jun 9, 2021
df0d17c
Updated email template for alerts
Jun 9, 2021
b35bf26
Updated email template for alerts
Jun 9, 2021
660ab29
Organization names coming from open API as list of names (#60)
Jun 10, 2021
63af351
Merge pull request #61 from TransparentPath/feat#59/email-templates
vishalajackus Jun 10, 2021
ad8ab4c
Resolve permission issue for "/organization/fetch_orgs/" endpoint (#64)
vishalajackus Jun 11, 2021
703161b
Add API endpoint for organization type (#65)
vishalajackus Jun 11, 2021
3fe4554
change permission level
vishalajackus Jun 11, 2021
2adf39a
add create and edit date in organization type
vishalajackus Jun 11, 2021
8c1ff4d
change permission level to only organization admin
vishalajackus Jun 11, 2021
0dbcfeb
Merge pull request #66 from TransparentPath/change-permission
vishalajackus Jun 11, 2021
42dfbd0
Updated configuration for consortium (#70)
Jun 29, 2021
ac00d2e
Configuration for user alert preferences (#73)
Jul 7, 2021
493b62c
update consortium table for organization uuid (#75)
vishalajackus Jul 12, 2021
a5faff1
Modifications in email templates (#77)
Jul 13, 2021
eec3ef9
change permission level for consortium table (#79)
vishalajackus Jul 15, 2021
1d4ccc1
filter consortium by organization (#81)
vishalajackus Jul 16, 2021
53796ea
update consortium array field (#82)
vishalajackus Jul 20, 2021
2ee19dd
Changed permission level for consortium (#85)
Jul 22, 2021
2db3290
create consortium if custody create (#87)
vishalajackus Jul 29, 2021
d2f78ef
Fix issue for retrieve query by uuid (#88)
vishalajackus Aug 12, 2021
823eedd
Revert "Fix issue for retrieve query by uuid (#88)"
vishalajackus Aug 16, 2021
0aa608a
Merge pull request #90 from TransparentPath/revert-88-datamesh-uuid-fix
vishalajackus Aug 16, 2021
269d76b
Handled boolean for CORS_ORIGIN_ALLOW_ALL
Nov 19, 2021
e471e84
Updated Bravado Core version
Nov 24, 2021
006f70b
Merge pull request #95 from TransparentPath/fix/bravado-core-spec
mthombare Nov 24, 2021
9df8e88
Return response data only for PUT, POST, DELETE (#97)
Nov 26, 2021
dfb361e
Added default radius for organization
Feb 10, 2022
3f1b727
Merge pull request #100 from TransparentPath/fix#99/default-radius-or…
abhishek-kumar-piyush Feb 11, 2022
3b25820
Allow unlimited line size for request
Mar 1, 2022
711fbe9
Merge pull request #102 from TransparentPath/fix/gunicorn-config
abhishek-kumar-piyush Mar 3, 2022
87c45d2
sensor service email alert for unassigned moving sensor (#105)
abhishek-kumar-piyush Mar 25, 2022
f6ab185
Handle when no custody organization mapped to custodian
Mar 28, 2022
eceb280
Merge pull request #107 from TransparentPath/fix/custodian-no-organiz…
abhishek-kumar-piyush Mar 29, 2022
2492d66
Environmental warning timezone. (#108)
abhishek-kumar-piyush Apr 6, 2022
c79fba8
Remove Travis
RadhikaPPatel Apr 12, 2022
b444bd1
Remove timestamp from alert messages (#110)
abhishek-kumar-piyush Apr 20, 2022
5b3fc68
Gunicorn timeout configuration
Apr 27, 2022
f70809c
buildly-core gitHub actions (#112)
abhishek-kumar-piyush Jun 28, 2022
0961ca6
Remove dev deployment setup
patelradhika Feb 13, 2023
352d71f
Setup github actions
patelradhika Feb 13, 2023
8c0bd36
Bump the pip group group in /requirements with 6 updates
dependabot[bot] Feb 29, 2024
4f0337d
Update dev-build.yml
Mar 26, 2024
61e2651
Update base.txt
Mar 26, 2024
95b09ff
Merge pull request #131 from TransparentPath/dependabot/pip/requireme…
Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Describe a feature request proposal explaining the benefits of having such featu

## Proposal

## Estimate
(Complexity ranked 1 to 10)

# Bug report
Describe the current behavior and what is the expected behavior. Include logs and screenshots if possible.

Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/demo-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and Push to Demo

on:
push:
branches:
- demo
jobs:
build:
name: Build and Push to GCR
runs-on: ubuntu-latest
env:
IMAGE_NAME: gcr.io/spry-bricolage-298920/transparent-path/demo/buildly-core
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make these paths consistent or remove these files from the upstream

steps:
- uses: actions/checkout@v2

- name: Docker login
uses: docker/login-action@v1
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}

- name: Build docker image
run: docker build -t $IMAGE_NAME:latest .

- name: Push to Google Container Registry
run: docker push $IMAGE_NAME:latest
28 changes: 28 additions & 0 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and Push to Development

on:
push:
branches:
- dev

jobs:
build:
name: Build and Push to GCR
runs-on: ubuntu-latest
env:
IMAGE_NAME: gcr.io/dev-buildly/transparent-path/buildly-core
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same path problem

steps:
- uses: actions/checkout@v2

- name: Docker login
uses: docker/login-action@v1
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.DEV_GCR_JSON_KEY }}

- name: Build docker image
run: docker build -t $IMAGE_NAME:latest .

- name: Push to Google Container Registry
run: docker push $IMAGE_NAME:latest
82 changes: 82 additions & 0 deletions .github/workflows/prod-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build and Push Docker Image to Prod

on:
push:
branches:
- prod

jobs:
build:
name: Build and Push image to GCR
runs-on: ubuntu-latest
env:
IMAGE_NAME: gcr.io/spry-bricolage-298920/transparent-path/prod/buildly-core
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

path problem

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

# auto generate tag from label defined in Dockerfile
- uses: butlerlogic/action-autotag@stable
id: tag_version
with:
GITHUB_TOKEN: "${{ secrets.RELEASE_TOKEN }}"
strategy: docker
tag_prefix: "v"

# Create release notes
- name: Build changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@main
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

# Create release
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
tag_name: ${{ steps.tag_version.outputs.tagname }}
release_name: Release ${{ steps.tag_version.outputs.tagname }}
body: ${{ steps.build_changelog.outputs.changelog }}
draft: false
prerelease: false

# Login to docker
- name: Docker login
uses: docker/login-action@v1
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}

# Build docker image
- name: Build docker image
run: docker build -t $IMAGE_NAME:latest .

# Push docker image to GCR
- name: Push to Google Container Registry
run: docker push $IMAGE_NAME:latest

# Send message on Slack
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_MESSAGE: 'Production Docker Image of buildly core pushed to Google Container Registry Successfully'
MSG_MINIMAL: true

# Send email alert
- name: Email Alert
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com
server_port: 465
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: Github Actions Build and Push job alert
to: ${{ secrets.RECIPIENT_EMAIL }}
from: ${{ secrets.SENDER_EMAIL }}
body: Production Docker Image of buildly core pushed to Google Container Registry Successfully
26 changes: 26 additions & 0 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Buildly Core Unit Test

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
unit_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Build the docker-compose stack
run: docker-compose build

- name: Setup docker containers
run: docker-compose up -d

- name: Check running containers
run: docker ps -a

- name: Run unit test case
run: docker-compose run --entrypoint '/usr/bin/env' --rm buildly bash scripts/run-tests.sh --keepdb

- name: Stop docker container
run: docker-compose down
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: no-commit-to-branch
args: [--branch, prod, --branch, demo, --branch, dev]
56 changes: 0 additions & 56 deletions .travis.yml

This file was deleted.

5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7-alpine3.10
FROM --platform=linux/amd64 python:3.7-alpine3.10

# Do not buffer log messages in memory; some messages can be lost otherwise
ENV PYTHONUNBUFFERED 1
Expand All @@ -21,5 +21,8 @@ RUN ./scripts/collectstatic.sh

RUN apk del .build-deps

# Specify tag name to be created on github
LABEL version="1.0.10"

EXPOSE 8080
ENTRYPOINT ["bash", "/code/scripts/docker-entrypoint.sh"]
4 changes: 4 additions & 0 deletions buildly/gunicorn_conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
bind = '0.0.0.0:8080'
limit_request_field_size = 0
limit_request_line = 0
timeout = 90
52 changes: 30 additions & 22 deletions buildly/management/commands/loadinitialdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
from django.core.management.base import BaseCommand
from django.db import transaction

from oauth2_provider.models import Application

from core.models import ROLE_VIEW_ONLY, ROLE_ORGANIZATION_ADMIN, ROLE_WORKFLOW_ADMIN, ROLE_WORKFLOW_TEAM, \
Organization, CoreUser, CoreGroup
from core.models import (
ROLE_VIEW_ONLY,
ROLE_ORGANIZATION_ADMIN,
ROLE_WORKFLOW_ADMIN,
ROLE_WORKFLOW_TEAM,
Organization,
CoreUser,
CoreGroup,
OrganizationType,
)

logger = logging.getLogger(__name__)

Expand All @@ -29,28 +35,26 @@ def __init__(self, *args, **kwargs):
self._su_group = None
self._default_org = None

def _create_oauth_application(self):
if settings.OAUTH_CLIENT_ID and settings.OAUTH_CLIENT_SECRET:
app, created = Application.objects.update_or_create(
client_id=settings.OAUTH_CLIENT_ID,
client_secret=settings.OAUTH_CLIENT_SECRET,
defaults={
'name': 'buildly oauth2',
'client_type': Application.CLIENT_PUBLIC,
'authorization_grant_type': Application.GRANT_PASSWORD,
}
)
self._application = app
def _create_organization_types(self):
if settings.ORGANIZATION_TYPES:
for organization_type in settings.ORGANIZATION_TYPES:
OrganizationType.objects.get_or_create(name=organization_type)

def _create_default_organization(self):
if settings.DEFAULT_ORG:
self._default_org, _ = Organization.objects.get_or_create(name=settings.DEFAULT_ORG)
self._default_org, _ = Organization.objects.get_or_create(
name=settings.DEFAULT_ORG
)

def _create_groups(self):
self._su_group = CoreGroup.objects.filter(is_global=True, permissions=15).first()
self._su_group = CoreGroup.objects.filter(
is_global=True, permissions=15
).first()
if not self._su_group:
logger.info("Creating global CoreGroup")
self._su_group = CoreGroup.objects.create(name='Global Admin', is_global=True, permissions=15)
self._su_group = CoreGroup.objects.create(
name='Global Admin', is_global=True, permissions=15
)

# TODO: remove this after full Group -> CoreGroup refactoring
self._groups.append(Group.objects.get_or_create(name=ROLE_VIEW_ONLY))
Expand All @@ -66,7 +70,11 @@ def _create_user(self):
logger.info("Creating Super User")
user_password = None
if settings.DEBUG:
user_password = settings.SUPER_USER_PASSWORD if settings.SUPER_USER_PASSWORD else 'admin'
user_password = (
settings.SUPER_USER_PASSWORD
if settings.SUPER_USER_PASSWORD
else 'zGtkgLvmNiKm'
)
elif settings.SUPER_USER_PASSWORD:
user_password = settings.SUPER_USER_PASSWORD
else:
Expand All @@ -78,7 +86,7 @@ def _create_user(self):
su = CoreUser.objects.create_superuser(
first_name='System',
last_name='Admin',
username='admin',
username='67OAI8DD5I1O',
email='[email protected]',
password=user_password,
organization=self._default_org,
Expand All @@ -88,6 +96,6 @@ def _create_user(self):
@transaction.atomic
def handle(self, *args, **options):
self._create_groups()
self._create_organization_types()
self._create_default_organization()
self._create_oauth_application()
self._create_user()
Loading