Skip to content

Setup Developer Connect repo. #124

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

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: APIGW API CD
name: Developer Connect API CD

on:
push:
Expand All @@ -19,11 +19,11 @@ on:
- prod

jobs:
apigw-api-cd:
uses: bcgov/bcregistry-sre/.github/workflows/cloud-run-service-cd.yaml@main
devloper-connect-api-cd:
uses: bcgov/bcregistry-sre/.github/workflows/backend-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "apigw-api"
app_name: "devloper-connect-api"
working_directory: "./api"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: APIGW API CI
name: Developer Connect API CI

on:
pull_request:
Expand All @@ -12,9 +12,9 @@ defaults:
working-directory: ./api

jobs:
apigw-api-ci:
devloper-connect-api-ci:
uses: bcgov/bcregistry-sre/.github/workflows/backend-ci.yaml@main
with:
app_name: apigw-api"
app_name: devloper-connect-api"
working_directory: "./api"
codecov_flag: "apigwapi"
codecov_flag: "devloperconnectapi"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: APIGW UI CD
name: Developer Connect UI CD

on:
push:
Expand All @@ -19,11 +19,11 @@ on:
- prod

jobs:
apigw-ui-cd:
devloper-connect-ui-cd:
uses: bcgov/bcregistry-sre/.github/workflows/frontend-cd.yaml@main
with:
target: ${{ inputs.target }}
app_name: "apigw-ui"
app_name: "devloper-connect-ui"
working_directory: "./web/site"
secrets:
WORKLOAD_IDENTIFY_POOLS_PROVIDER: ${{ secrets.WORKLOAD_IDENTIFY_POOLS_PROVIDER }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: APIGW UI CI
name: Developer Connect UI CI

on:
pull_request:
Expand All @@ -12,9 +12,9 @@ defaults:
working-directory: ./web/site

jobs:
apigw-ui-ci:
devloper-connect-ui-ci:
uses: bcgov/bcregistry-sre/.github/workflows/frontend-ci.yaml@main
with:
app_name: "apigw-ui"
app_name: "devloper-connect-ui"
working_directory: "./web/site"
codecov_flag: "apigwui"
codecov_flag: "devloperconnectui"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# sbc-apigw
# Developer Connect

## Development & Contributing

Create a fork and local copy of this repo. Answer _Y_ to create a local clone.
```bash
gh repo fork bcgov/sbc-apigw
gh repo fork bcgov/developer.connect
```
76 changes: 76 additions & 0 deletions api/devops/gcp/clouddeploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: deploy.cloud.google.com/v1
kind: DeliveryPipeline
metadata:
name: devloper-connect-api-pipeline
description: Deployment pipeline
serialPipeline:
stages:
- targetId: gtksf3-dev
profiles: [dev]
strategy:
standard:
verify: false
deployParameters:
- values:
deploy-env: "development"
deploy-project-id: "gtksf3-dev"
service-name: "devloper-connect-api-dev"
container-name: "devloper-connect-api-dev"
cloudsql-instances: ""
service-account: "sa-api@gtksf3-dev.iam.gserviceaccount.com"
- targetId: gtksf3-test
profiles: [test]
strategy:
standard:
verify: false
deployParameters:
- values:
deploy-env: "test"
deploy-project-id: "gtksf3-test"
service-name: "devloper-connect-api-test"
container-name: "devloper-connect-api-test"
app-env: "test"
cloudsql-instances: ""
service-account: "sa-api@gtksf3-test.iam.gserviceaccount.com"
- targetId: gtksf3-sandbox
profiles: [sandbox]
strategy:
standard:
verify: false
deployParameters:
- values:
deploy-env: "sandbox"
deploy-project-id: "gtksf3-tools"
service-name: "devloper-connect-api-sandbox"
container-name: "devloper-connect-api-sandbox"
cloudsql-instances: ""
service-account: "sa-api@gtksf3-tools.iam.gserviceaccount.com"
- targetId: gtksf3-prod
profiles: [prod]
strategy:
standard:
verify: false
deployParameters:
- values:
deploy-env: "production"
deploy-project-id: "gtksf3-prod"
service-name: "devloper-connect-api-prod"
container-name: "devloper-connect-api-prod"
cloudsql-instances: ""
service-account: "sa-api@gtksf3-prod.iam.gserviceaccount.com"
max-scale: "10"
container-concurrency: "20"
4 changes: 2 additions & 2 deletions api/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[tool.poetry]
name = "sbc-apigw"
name = "devloper-connect-api"
version = "1.0.0"
description = ""
authors = ["thorwolpert <thor@wolpert.ca>"]
license = "BSD 3-Clause"
readme = "README.md"
packages = [{include = "sbc_apigw", from = "src"}]
packages = [{include = "devloper-connect-api", from = "src"}]

[tool.poetry.dependencies]
python = "^3.12.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from flask import has_app_context
from flask import Flask

import sbc_apigw
import devloper-connect-api


class Flags:
Expand Down Expand Up @@ -115,9 +115,9 @@ def get_anonymous_user():
return {"key": "anonymous"}

@staticmethod
def flag_user(user: sbc_apigw.models.User, account_id: int = None):
def flag_user(user: devloper-connect-api.models.User, account_id: int = None):
"""Convert User into a Flag user dict."""
if not isinstance(user, sbc_apigw.models.User):
if not isinstance(user, devloper-connect-api.models.User):
return None

_user = {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
from flask_cors import cross_origin

from http import HTTPStatus
from sbc_apigw.common.auth import jwt as _jwt
from devloper-connect-api.common.auth import jwt as _jwt
from auth_api.exceptions import BusinessException
from auth_api.schemas import utils as schema_utils
from sbc_apigw.services.api_gateway import ApiGateway as ApiGatewayService
from devloper-connect-api.services.api_gateway import ApiGateway as ApiGatewayService
from auth_api.utils.roles import Role

bp = Blueprint("KEYS", __name__, url_prefix=f"/v1/orgs/<int:org_id>/api-keys")
Expand Down
12 changes: 6 additions & 6 deletions api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
from ldclient.integrations.test_data import TestData
from sqlalchemy import event, text

from sbc_apigw import create_app
from sbc_apigw import jwt as _jwt
from sbc_apigw.models import db as _db
from sbc_apigw.config import Testing
from devloper-connect-api import create_app
from devloper-connect-api import jwt as _jwt
from devloper-connect-api.models import db as _db
from devloper-connect-api.config import Testing

def create_test_db(user: str = None,
password: str = None,
Expand Down Expand Up @@ -82,9 +82,9 @@ def drop_test_db(user: str = None,
DATABASE_URI = database_uri
else:
DATABASE_URI = f"postgresql://{user}:{password}@{host}:{port}/{user}"

DATABASE_URI = DATABASE_URI[:DATABASE_URI.rfind("/")] + '/postgres'

close_all = f"""
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
Expand Down
2 changes: 1 addition & 1 deletion api/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"""
import os

from sbc_apigw import create_app
from devloper-connect-api import create_app

app = create_app() # pylint: disable=invalid-name

Expand Down
12 changes: 6 additions & 6 deletions codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ coverage:
patch: false
project:
default: false
apigwapi:
devloperconnectapi:
target: 80%
flags:
- apigwapi
apigwui:
- devloperconnectapi
devloperconnectui:
target: 80%
flags:
- apigwui
- devloperconnectui
ignore:
- "^/tests/**/*" # ignore test harness code

Expand All @@ -36,11 +36,11 @@ comment:
require_changes: true

flags:
apigwrapi:
devloperconnectrapi:
paths:
- api
carryforward: true
apigwui:
devloperconnectui:
paths:
- web/site
carryforward: true
16 changes: 4 additions & 12 deletions web/site/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
[![License](https://img.shields.io/badge/License-BSD%203%20Clause-blue.svg)](LICENSE)

# Service BC API Gateway

## Technology Stack Used

- [Nuxt3](https://nuxt.com/) + Typescript
- [Nuxt UI](https://ui.nuxt.com/)
- [Nuxt Content](https://content.nuxt.com/)
- [Playwright](https://playwright.dev/) Testing
# Developer Connect

## Development

Create a fork and local copy of this repo. Answer _Y_ to create a local clone.
```bash
gh repo fork bcgov/sbc-apigw
gh repo fork bcgov/developer.connect
```

Change into the directory and install the packages.
```bash
cd sbc-apigw
cd developer.connect/web/site
pnpm install
```

Expand Down Expand Up @@ -47,6 +38,7 @@ pnpm test:unit

Run Playwright e2e tests in headless mode
```bash
cd developer.connect/web/site
pnpm test:e2e
```

Expand Down
2 changes: 1 addition & 1 deletion web/site/firebase.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"hosting":
{
"site": "apigw-dev",
"site": "devloper-connect-dev",
"public": "dist",
"ignore": ["**/devops/**", "**/.*", "**/node_modules/**"],
"rewrites": [
Expand Down
2 changes: 1 addition & 1 deletion web/site/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "sbc-apigw-site",
"name": "devloper-connect-site",
"private": true,
"type": "module",
"version": "1.0.3",
Expand Down
Loading