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

Release dev-staging changes to dev #1131

Merged
merged 36 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
72a0bf4
SIMSBIOHUB-226: Survey Prototyping + Observation Map View (#1116)
curtisupshall Oct 18, 2023
0302baf
Merge branch 'dev' into dev-staging
curtisupshall Oct 18, 2023
6362e8e
UI Fixes
jeznorth Oct 19, 2023
9cba403
Merge branch 'dev' into dev-staging
curtisupshall Oct 19, 2023
4a4d742
Fix issues
NickPhura Oct 19, 2023
27cd7c3
Merge branch 'dev' into dev-staging
curtisupshall Oct 19, 2023
1c31751
Merge branch 'dev-staging' of github.com:bcgov/biohubbc into dev-staging
curtisupshall Oct 19, 2023
336a266
Fix pipeline route issues
NickPhura Oct 20, 2023
58616cd
Fix non-unique key issue
NickPhura Oct 20, 2023
04d2912
Merge branch 'dev' into dev-staging
NickPhura Oct 23, 2023
0b116a7
SIMSBIOHUB-258 (#1134)
jeznorth Oct 23, 2023
e627df7
SIMSBIOHUB-296/313: Import Observations (#1128)
curtisupshall Oct 24, 2023
3199784
SIMSBIOHUB-177: Survey Study Area enhancements (#1136)
al-rosenthal Oct 25, 2023
3b1400a
Merge branch 'dev' into dev-staging
NickPhura Oct 25, 2023
f6389df
SIMSBIOHUB-336/337 (#1142)
JeremyQuartech Oct 26, 2023
6b965b9
SIMSBIOHUB 343 - Incorrect date overlap error in sampling methods (#1…
GrahamS-Quartech Oct 26, 2023
9143004
SIMSBIOHUB-334/350/352 (#1143)
curtisupshall Oct 27, 2023
e5158d6
SIMSBIOHUB-323: Remove Ecological Season (#1153)
JeremyQuartech Oct 31, 2023
ac199ba
SIMSBIOHUB 347/341 - Names from shapefiles (#1146)
GrahamS-Quartech Oct 31, 2023
0b52d4c
TechDebt: Map container refactor (#1148)
al-rosenthal Oct 31, 2023
7cb5142
SIMSBIOHUB-353/325: Survey form updates (#1149)
al-rosenthal Oct 31, 2023
a284963
SIMSBIOHUB-342: Delete Sampling Site (#1147)
KjartanE Oct 31, 2023
6c568a2
SIMSBIOHUB 324 - Multiple Ecological Variables (Intended Outcomes) (#…
GrahamS-Quartech Nov 1, 2023
d71b919
SIMSBIOHUB 335: Tab Through Observation Edit (#1156)
GrahamS-Quartech Nov 1, 2023
18a5f28
SIMSBIOHUB-356: Update survey list endpoint to return a subset of sur…
NickPhura Nov 1, 2023
2876f50
SIMSBIOHUB-331: Keycloak Library Updates (#1151)
NickPhura Nov 2, 2023
4051da8
SIMSBIOHUB-354-355: Study area and Sampling sites on observations map…
al-rosenthal Nov 3, 2023
a359ed2
SIMSBIOHUB-348: Delete single or many observation records (#1154)
curtisupshall Nov 3, 2023
ec677ac
SIMSBIOHUB-363: Import Survey Area Name and Description from Shapefil…
GrahamS-Quartech Nov 6, 2023
5468433
SIMSBIOHUB-334 UI Fixes (#1164)
jeznorth Nov 7, 2023
14608a6
SIMSBIOHUB-297: Keycloak Value Case Sensitivity (#1166)
JeremyQuartech Nov 7, 2023
a02df6f
SIMSBIOHUB-345: Display Time in Sampling Periods (#1167)
KjartanE Nov 8, 2023
004f66a
SIMSBIOHUB-371: Update Seed to Create Sampling Site and Observation R…
GrahamS-Quartech Nov 8, 2023
0c558c1
SIMSBIOHUB-344: Tech debt: Observation Table Species display (#1160)
curtisupshall Nov 9, 2023
1d929e7
SIMSBIOHUB-361: Remove all study areas button (#1163)
al-rosenthal Nov 9, 2023
cd8e3e0
ignore-skip
NickPhura Nov 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 2 additions & 4 deletions .github/workflows/cleanClosedPR.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# Clean out all deployment artifacts when a PR is closed, but not merged.
# Will attempt to remove all artifacts from any PR that was opened against any branch (and then closed (not merged)), except for test and prod.
# Will attempt to remove all artifacts from any PR that was opened against any branch (and then closed (not merged)).
name: Clean Closed PR Artifacts

on:
pull_request:
types: [closed]
branches-ignore:
- test
- prod

jobs:
clean:
name: Clean Deployment Artifacts for API and App in Dev and Tools environment
runs-on: ubuntu-latest
timeout-minutes: 20
# Don't run if the PR was merged
if: ${{ github.event.pull_request.merged != true }}
env:
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/cleanMergedPR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Clean out all deployment artifacts when a PR is merged against a non-standard base branch (aka: neither dev, test, or prod)
# Standard branches (aka: dev, test, prod) have their own cleanup routine that runs as part of the deployStatic action.
name: Clean Merged PR Artifacts

on:
pull_request:
types: [closed]
branches-ignore:
- dev
- test
- prod

jobs:
clean:
name: Clean Deployment Artifacts for API and App in Dev and Tools environment
runs-on: ubuntu-latest
timeout-minutes: 20
# Only run if the PR was merged
if: ${{ github.event.pull_request.merged == true }}
env:
PR_NUMBER: ${{ github.event.number }}
steps:
# Install Node - for `node` and `npm` commands
# Note: This already uses actions/cache internally, so repeat calls in subsequent jobs are not a performance hit
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 14

# Load repo from cache
- name: Cache repo
uses: actions/cache@v3
id: cache-repo
env:
cache-name: cache-repo
with:
path: ${{ github.workspace }}/*
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}

# Checkout the branch if not restored via cache
- name: Checkout Target Branch
if: steps.cache-repo.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
persist-credentials: false

# Log in to OpenShift.
# Note: The secrets needed to log in are NOT available if the PR comes from a FORK.
# PR's must originate from a branch off the original repo or else all openshift `oc` commands will fail.
- name: Log in to OpenShift
run: oc login --token=${{ secrets.TOOLS_SA_TOKEN }} --server=https://api.silver.devops.gov.bc.ca:6443

# Clean the app deployment artifacts
- name: Clean APP Deployment
working-directory: "app/.pipeline/"
run: |
npm ci
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev

# Clean the database build/deployment artifacts
- name: Clean Database Artifacts
working-directory: "database/.pipeline/"
run: |
npm ci
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev

# Clean the api deployment artifacts
- name: Clean API Deployment
working-directory: "api/.pipeline/"
run: |
npm ci
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=build
DEBUG=* npm run clean -- --pr=$PR_NUMBER --env=dev

# Clean the reamaining build/deployment artifacts
- name: Clean remaining Artifacts
env:
POD_SELECTOR: biohubbc
run: |
oc --namespace af2668-dev get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep $POD_SELECTOR | grep $PR_NUMBER | awk '{print "oc delete --ignore-not-found " $1}' | bash
oc --namespace af2668-tools get all,pvc,secret,pods,ReplicationController,DeploymentConfig,HorizontalPodAutoscaler,imagestreamtag -o name | grep $POD_SELECTOR | grep $PR_NUMBER | awk '{print "oc delete --ignore-not-found " $1}' | bash
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ db-container: ## Executes into database container.
@echo "Make: Shelling into database container"
@echo "==============================================="
@export PGPASSWORD=$(DB_ADMIN_PASS)
@

app-container: ## Executes into the app container.
@echo "==============================================="
Expand Down
4 changes: 2 additions & 2 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"lint": "eslint . --ignore-pattern 'node_modules' --ext .ts",
"lint-fix": "eslint . --fix --ignore-pattern 'node_modules' --ext .ts",
"format": "prettier --check \"./src/**/*.{js,jsx,ts,tsx,css,scss}\"",
"format-fix": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,json,css,scss}\""
"format-fix": "prettier --write \"./src/**/*.{js,jsx,ts,tsx,json,css,scss}\"",
"fix": "npm-run-all -l -s lint-fix format-fix"
},
"engines": {
"node": ">= 14.0.0",
Expand Down Expand Up @@ -97,7 +98,7 @@
"gulp-typescript": "~5.0.1",
"mocha": "~8.4.0",
"nodemon": "~2.0.14",
"npm-run-all": "~4.1.5",
"npm-run-all": "^4.1.5",
"nyc": "~15.1.0",
"prettier": "~2.2.1",
"prettier-plugin-organize-imports": "~2.3.4",
Expand Down
7 changes: 7 additions & 0 deletions api/src/__mocks__/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ export class MockRes {

return this;
});

headerValue: any;
setHeader = sinon.fake((header: any) => {
this.headerValue = header;

return this;
});
}

/**
Expand Down
67 changes: 1 addition & 66 deletions api/src/models/project-create.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { expect } from 'chai';
import { describe } from 'mocha';
import {
PostIUCNData,
PostLocationData,
PostObjectivesData,
PostProjectData,
PostProjectObject
} from './project-create';
import { PostIUCNData, PostObjectivesData, PostProjectData, PostProjectObject } from './project-create';

describe('PostProjectObject', () => {
describe('No values provided', () => {
Expand All @@ -24,10 +18,6 @@ describe('PostProjectObject', () => {
expect(projectPostObject.objectives).to.equal(null);
});

it('sets location', function () {
expect(projectPostObject.location).to.equal(null);
});

it('sets iucn', function () {
expect(projectPostObject.iucn).to.equal(null);
});
Expand Down Expand Up @@ -165,58 +155,3 @@ describe('PostIUCNData', () => {
});
});
});

describe('PostLocationData', () => {
describe('No values provided', () => {
let projectLocationData: PostLocationData;

before(() => {
projectLocationData = new PostLocationData(null);
});

it('sets location_description', function () {
expect(projectLocationData.location_description).to.be.undefined;
});

it('sets geometry', function () {
expect(projectLocationData.geometry).to.eql([]);
});
});

describe('All values provided', () => {
let projectLocationData: PostLocationData;

const obj = {
location_description: 'a location description',
geometry: [
{
type: 'Polygon',
coordinates: [
[
[-128, 55],
[-128, 55.5],
[-128, 56],
[-126, 58],
[-128, 55]
]
],
properties: {
name: 'Biohub Islands'
}
}
]
};

before(() => {
projectLocationData = new PostLocationData(obj);
});

it('sets location_description', function () {
expect(projectLocationData.location_description).to.equal('a location description');
});

it('sets the geometry', function () {
expect(projectLocationData.geometry).to.eql(obj.geometry);
});
});
});
30 changes: 0 additions & 30 deletions api/src/models/project-create.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Feature } from 'geojson';
import { SYSTEM_IDENTITY_SOURCE } from '../constants/database';
import { PROJECT_ROLE } from '../constants/roles';
import { getLogger } from '../utils/logger';
Expand All @@ -14,7 +13,6 @@ const defaultLog = getLogger('models/project-create');
export class PostProjectObject {
project: PostProjectData;
objectives: PostObjectivesData;
location: PostLocationData;
iucn: PostIUCNData;
participants: PostParticipantData[];

Expand All @@ -23,7 +21,6 @@ export class PostProjectObject {

this.project = (obj?.project && new PostProjectData(obj.project)) || null;
this.objectives = (obj?.project && new PostObjectivesData(obj.objectives)) || null;
this.location = (obj?.location && new PostLocationData(obj.location)) || null;
this.iucn = (obj?.iucn && new PostIUCNData(obj.iucn)) || null;
this.participants = obj?.participants || [];
}
Expand Down Expand Up @@ -69,33 +66,6 @@ export class PostObjectivesData {
}
}

/**
* Processes POST /project location data
*
* @export
* @class PostLocationData
*/
export class PostLocationData {
location_description: string;
geometry: Feature[];

constructor(obj?: any) {
defaultLog.debug({
label: 'PostLocationData',
message: 'params',
obj: {
...obj,
geometry: obj?.geometry?.map((item: any) => {
return { ...item, geometry: 'Too big to print' };
})
}
});

this.location_description = obj?.location_description;
this.geometry = (obj?.geometry?.length && obj.geometry) || [];
}
}

export interface IPostIUCN {
classification: number;
subClassification1: number;
Expand Down
66 changes: 1 addition & 65 deletions api/src/models/project-update.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from 'chai';
import { describe } from 'mocha';
import { PutIUCNData, PutLocationData, PutObjectivesData, PutProjectData } from './project-update';
import { PutIUCNData, PutObjectivesData, PutProjectData } from './project-update';

describe('PutProjectData', () => {
describe('No values provided', () => {
Expand Down Expand Up @@ -107,70 +107,6 @@ describe('PutObjectivesData', () => {
});
});

describe('PutLocationData', () => {
describe('No values provided', () => {
let data: PutLocationData;

before(() => {
data = new PutLocationData(null);
});

it('sets location_description', () => {
expect(data.location_description).to.undefined;
});

it('sets geometry', () => {
expect(data.geometry).to.eql([]);
});

it('sets revision_count', () => {
expect(data.revision_count).to.eql(null);
});
});

describe('All values provided', () => {
let data: PutLocationData;

const obj = {
location_description: 'location',
geometry: [
{
type: 'Polygon',
coordinates: [
[
[-128, 55],
[-128, 55.5],
[-128, 56],
[-126, 58],
[-128, 55]
]
],
properties: {
name: 'Biohub Islands'
}
}
],
revision_count: 1
};

before(() => {
data = new PutLocationData(obj);
});

it('sets location_description', () => {
expect(data.location_description).to.equal(obj.location_description);
});

it('sets geometry', () => {
expect(data.geometry).to.eql(obj.geometry);
});

it('sets revision_count', () => {
expect(data.revision_count).to.eql(obj.revision_count);
});
});
});

describe('PutIUCNData', () => {
describe('No values provided', () => {
let data: PutIUCNData;
Expand Down
Loading