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 Test to Prod #1311

Merged
merged 11 commits into from
Jun 26, 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
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
branches-ignore:
- test
- prod

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion api/.pipeline/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const phases = {
memoryRequest: '100Mi',
memoryLimit: '4Gi',
replicas: '1',
replicasMax: (isStaticDeployment && '2') || '1'
replicasMax: '1'
},
test: {
namespace: 'af2668-test',
Expand Down
41 changes: 21 additions & 20 deletions api/.pipeline/templates/api.dc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,23 +464,24 @@ objects:
status:
ingress: null

- kind: HorizontalPodAutoscaler
apiVersion: autoscaling/v2
metadata:
annotations: {}
labels: {}
name: ${NAME}${SUFFIX}
spec:
minReplicas: ${{REPLICAS}}
maxReplicas: ${{REPLICAS_MAX}}
scaleTargetRef:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
name: ${NAME}${SUFFIX}
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
# Disable the HPA for now, as it is preferrable to run an exact number of pods (e.g. min:2, max:2)
# - kind: HorizontalPodAutoscaler
# apiVersion: autoscaling/v2
# metadata:
# annotations: {}
# labels: {}
# name: ${NAME}${SUFFIX}
# spec:
# minReplicas: ${{REPLICAS}}
# maxReplicas: ${{REPLICAS_MAX}}
# scaleTargetRef:
# apiVersion: apps.openshift.io/v1
# kind: DeploymentConfig
# name: ${NAME}${SUFFIX}
# metrics:
# - type: Resource
# resource:
# name: cpu
# target:
# type: Utilization
# averageUtilization: 80
2 changes: 0 additions & 2 deletions api/src/models/biohub-create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ describe('PostSurveyObservationToBiohubObject', () => {
const obj = {
survey_observation_id: 1,
survey_id: 1,
wldtaxonomic_units_id: 1,
survey_sample_site_id: 1,
survey_sample_method_id: 1,
survey_sample_period_id: 1,
Expand Down Expand Up @@ -159,7 +158,6 @@ describe('PostSurveySubmissionToBioHubObject', () => {
{
survey_observation_id: 1,
survey_id: 1,
wldtaxonomic_units_id: 1,
survey_sample_site_id: 1,
survey_sample_method_id: 1,
survey_sample_period_id: 1,
Expand Down
25 changes: 0 additions & 25 deletions api/src/models/project-create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ describe('PostProjectData', () => {
expect(projectPostData.name).to.equal(null);
});

it('sets programs', function () {
expect(projectPostData.project_programs).to.have.length(0);
});

it('sets start_date', function () {
expect(projectPostData.start_date).to.equal(null);
});

it('sets end_date', function () {
expect(projectPostData.end_date).to.equal(null);
});

it('sets comments', function () {
expect(projectPostData.comments).to.equal(null);
});
Expand All @@ -58,7 +46,6 @@ describe('PostProjectData', () => {

const obj = {
project_name: 'name_test_data',
project_programs: [1],
start_date: 'start_date_test_data',
end_date: 'end_date_test_data',
comments: 'comments_test_data'
Expand All @@ -72,18 +59,6 @@ describe('PostProjectData', () => {
expect(projectPostData.name).to.equal('name_test_data');
});

it('sets type', function () {
expect(projectPostData.project_programs).to.eql([1]);
});

it('sets start_date', function () {
expect(projectPostData.start_date).to.equal('start_date_test_data');
});

it('sets end_date', function () {
expect(projectPostData.end_date).to.equal('end_date_test_data');
});

it('sets comments', function () {
expect(projectPostData.comments).to.equal('comments_test_data');
});
Expand Down
6 changes: 0 additions & 6 deletions api/src/models/project-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,12 @@ export class PostProjectObject {
*/
export class PostProjectData {
name: string;
project_programs: number[];
start_date: string;
end_date: string;
comments: string;

constructor(obj?: any) {
defaultLog.debug({ label: 'PostProjectData', message: 'params', obj });

this.name = obj?.project_name || null;
this.project_programs = obj?.project_programs || [];
this.start_date = obj?.start_date || null;
this.end_date = obj?.end_date || null;
this.comments = obj?.comments || null;
}
}
Expand Down
27 changes: 0 additions & 27 deletions api/src/models/project-update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ describe('PutProjectData', () => {
expect(data.name).to.equal(null);
});

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

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

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

it('sets revision_count', () => {
expect(data.revision_count).to.equal(null);
});
Expand All @@ -34,9 +22,6 @@ describe('PutProjectData', () => {
describe('all values provided', () => {
const obj = {
project_name: 'project name',
project_programs: [1],
start_date: '2020-04-20T07:00:00.000Z',
end_date: '2020-05-20T07:00:00.000Z',
revision_count: 1
};

Expand All @@ -50,18 +35,6 @@ describe('PutProjectData', () => {
expect(data.name).to.equal('project name');
});

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

it('sets start_date', () => {
expect(data.start_date).to.eql('2020-04-20T07:00:00.000Z');
});

it('sets end_date', () => {
expect(data.end_date).to.equal('2020-05-20T07:00:00.000Z');
});

it('sets revision_count', () => {
expect(data.revision_count).to.equal(1);
});
Expand Down
6 changes: 0 additions & 6 deletions api/src/models/project-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ const defaultLog = getLogger('models/project-update');

export class PutProjectData {
name: string;
project_programs: number[];
start_date: string;
end_date: string;
revision_count: number;

constructor(obj?: any) {
defaultLog.debug({ label: 'PutProjectData', message: 'params', obj });

this.name = obj?.project_name || null;
this.project_programs = obj?.project_programs || [];
this.start_date = obj?.start_date || null;
this.end_date = obj?.end_date || null;
this.revision_count = obj?.revision_count ?? null;
}
}
Expand Down
30 changes: 0 additions & 30 deletions api/src/models/project-view.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ describe('ProjectData', () => {
project_id: 1,
uuid: 'uuid',
project_name: '',
project_programs: [],
start_date: '2005-01-01',
end_date: '2006-01-01',
comments: '',
revision_count: 1
};
Expand All @@ -32,18 +29,6 @@ describe('ProjectData', () => {
it('sets name', () => {
expect(data.project_name).to.equal('');
});

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

it('sets start_date', () => {
expect(data.start_date).to.eql('2005-01-01');
});

it('sets end_date', () => {
expect(data.end_date).to.eql('2006-01-01');
});
});

describe('all values provided', () => {
Expand All @@ -63,9 +48,6 @@ describe('ProjectData', () => {
project_id: 1,
uuid: 'uuid',
project_name: 'project name',
project_programs: [1],
start_date: '2020-04-20T07:00:00.000Z',
end_date: '2020-05-20T07:00:00.000Z',
comments: '',
revision_count: 1
};
Expand All @@ -78,18 +60,6 @@ describe('ProjectData', () => {
it('sets name', () => {
expect(data.project_name).to.equal(projectData.name);
});

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

it('sets start_date', () => {
expect(data.start_date).to.eql('2020-04-20T07:00:00.000Z');
});

it('sets end_date', () => {
expect(data.end_date).to.eql('2020-05-20T07:00:00.000Z');
});
});
});

Expand Down
11 changes: 1 addition & 10 deletions api/src/models/project-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import { ProjectUser } from '../repositories/project-participation-repository';
import { SystemUser } from '../repositories/user-repository';

export interface IProjectAdvancedFilters {
project_programs?: number[];
start_date?: string;
end_date?: string;
keyword?: string;
project_name?: string;
itis_tsns?: number[];
Expand All @@ -22,9 +19,6 @@ export const ProjectData = z.object({
project_id: z.number(),
uuid: z.string().uuid(),
project_name: z.string(),
project_programs: z.array(z.number()),
start_date: z.string(),
end_date: z.string().nullable(),
comments: z.string().nullable(),
revision_count: z.number()
});
Expand All @@ -34,10 +28,7 @@ export type ProjectData = z.infer<typeof ProjectData>;
export const ProjectListData = z.object({
project_id: z.number(),
name: z.string(),
project_programs: z.array(z.number()),
regions: z.array(z.string()),
start_date: z.string(),
end_date: z.string().nullable().optional()
regions: z.array(z.string())
});

export type ProjectListData = z.infer<typeof ProjectListData>;
Expand Down
39 changes: 11 additions & 28 deletions api/src/openapi/schemas/critter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ const captureSchema: OpenAPIV3.SchemaObject = {
type: 'string',
format: 'uuid'
},
capture_method_id: {
type: 'string',
format: 'uuid'
},
capture_location_id: {
type: 'string',
format: 'uuid'
Expand All @@ -82,13 +86,16 @@ const captureSchema: OpenAPIV3.SchemaObject = {
},
capture_location: locationSchema,
release_location: locationSchema,
force_create_release: {
type: 'boolean'
capture_date: {
type: 'string'
},
capture_timestamp: {
capture_time: {
type: 'string'
},
release_timestamp: {
release_date: {
type: 'string'
},
release_time: {
type: 'string'
},
capture_comment: {
Expand Down Expand Up @@ -204,30 +211,6 @@ const quantitativeMeasurmentSchema: OpenAPIV3.SchemaObject = {
}
};

export const critterCreateRequestObject: OpenAPIV3.SchemaObject = {
title: 'Create critter request object',
type: 'object',
properties: {
critter_id: {
type: 'string',
format: 'uuid'
},
animal_id: {
type: 'string'
},
wlh_id: {
type: 'string'
},
itis_tsn: {
type: 'integer'
},
sex: {
type: 'string'
}
},
additionalProperties: false
};

export const critterBulkRequestObject: OpenAPIV3.SchemaObject = {
title: 'Bulk post request object',
type: 'object',
Expand Down
Loading