Skip to content

Commit

Permalink
Merge branch 'byon-main' into als-7592
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPeck authored Dec 2, 2024
2 parents 7fe9b3f + eb9633d commit 2c3f3d4
Show file tree
Hide file tree
Showing 100 changed files with 2,329 additions and 1,328 deletions.
130 changes: 130 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Include all default templates from https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/
include:
- template: Jobs/SAST.latest.gitlab-ci.yml
- template: Jobs/Secret-Detection.latest.gitlab-ci.yml
- template: Jobs/Dependency-Scanning.latest.gitlab-ci.yml
- template: DAST.gitlab-ci.yml

# Include default tags
default:
tags:
- aim-ahead
- docker

# Set PATH
variables:
PATH: '/bin:/usr/bin:/usr/local/bin'

# cache node modules
cache:
paths:
- node_modules/
- addons/*/packages/*/node_modules/
- main/solution/*/node_modules/
- main/cicd/*/node_modules/
- main/integration-tests/node_modules/
- main/packages/*/node_modules

# Run different stages
stages:
- test
- dast
- build
- assume_role
- deploy

#######################
###### Templates ######
#######################

.assume_role:
stage: assume_role
inherit:
default: false
tags:
- aim-ahead
- shell
script:
- sh assume-role.sh > creds.env
artifacts:
reports:
dotenv: creds.env

.build:
stage: build
inherit:
default: false
tags:
- aim-ahead
- shell
script:
- echo "Installing dependencies"
- ./scripts/install.sh
- echo "Building packages"
- ./scripts/build-all-packages.sh

.deploy:
stage: deploy
inherit:
default: false
tags:
- aim-ahead
- shell
when: manual
script:
- ./scripts/environment-deploy.sh

#####################
####### Dev #########
#####################
build_dev:
environment: Development
extends: .build
only:
- srce-dev

assume_role_dev:
extends: .assume_role
environment: Development
only:
- srce-dev

deploy_dev:
environment: Development
extends: .deploy
needs:
- build_dev
- assume_role_dev
only:
- srce-dev

dast_dev:
stage: dast
only:
- srce-dev
environment: "Development"
script: "echo running DAST on ${DAST_WEBSITE}"

#####################
####### Prod ########
#####################
build_prod:
environment: Production
extends: .build
only:
- srce-prod

assume_role_prod:
extends: .assume_role
environment: Production
only:
- srce-prod

deploy_prod:
environment: Production
extends: .deploy
needs:
- build_prod
- assume_role_prod
only:
- srce-prod
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,52 @@

All notable changes to this project will be documented in this file. As our fork has diverged from AWS SWB mainline branch, we are noting the SWB version and the lab version together, as <swb version>\_<lab version>, starting from SWB mainline, 5.0.0.

## [5.0.0_1.4.2](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.4.1...v5.0.0_1.4.2) (03/14/2024)
- Emergency change to add login-blocking warning and system wide application warnings.

## [5.0.0_1.4.1](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.4.0...v5.0.0_1.4.1) (03/01/2024)
- Add copy changes and parameter for registration page.
- Add PIC-SURE landing page if stage parameter is set.
- Bugfix: Move conda env config to install_kernel script.

## [5.0.0_1.4.0](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.3.2...v5.0.0_1.4.0) (01/25/2024)
- Parameterize user register TOS acceptance.
- Add comma separated study whitelist in stage file.
- Add Jira support widget.
- Add dropdown to help link if more than one url is given.

## [5.0.0_1.3.2](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.3.1...v5.0.0_1.3.2) (12/21/2023)
- Update register page email regex validation: validatorjs schema regex fields need slashes before and after the regex, or else it returns a validation error.

## [5.0.0_1.3.1](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.3.0...v5.0.0_1.3.1) (12/13/2023)
- Bugfix: Update to add 'and' to scanner filter when more than one filter condition exists.

## [5.0.0_1.3.0](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.2.0...v5.0.0_1.3.0) (12/08/2023)
### Workspaces
- Update windows sync to auto-start on user login.
- Split bootstrap script by env type to speed up initialization and s3 downloads.

## Workspace List
- Add message for windows users when a study is attached to note that study files will take time to sync on start and before stop.
- Fix bug where workspace configuration deprecation notice errantly shows on workspace view page on reload.
- Add filtering/searching by id in normal and advanced workspace views.
- Add api and ui pagination for workspaces to fix workspace page issue when large number of workspaces are in the database.
- Update workspaces to paginate api return until all workspaces details are returned.
- Paginate the workspace page to reduce page load times.
- Fix loading bug on advanced workspace view when status changes to pending because of user start/stop.

## User Management
- Update user management page to fix sorting and filtering.
- Update regex for user emails to be more in line with email conventions.
- Remove permissins accordian from view if a user can't edit a studies permission.

## Study management
- Add a modal notice on study permission edit when a user would be impacted by permission change/removal.
- Update studies api method to use query and filter instead of BatchGet so more than 100 studies can be returned.
- Add created date to study card.

## [5.0.0_1.2.0](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.1.2...v5.0.0_1.2.0) (09/28/2023)

- Allow more than 100 RStudio instances to be launched in one host account, by dynamically creating load balancers-
bypassing AWS 100 target group limit.
- Added support for multiple ALBs. New ALB will be created when the limit for existing ALB exceeds
Expand All @@ -19,6 +63,7 @@ All notable changes to this project will be documented in this file. As our fork
- Update to build proxy lambda layer and with requirements.

## [5.0.0_1.1.1](https://github.com/hms-dbmi/service-workbench-on-aws/compare/v5.0.0_1.1.0...v5.0.0_1.1.1) (08/10/2023)

- Update serverless templates to use an empty string for aws profile.
- Update nodejs and aws-sdk versions.
- Cherry pick [a0c7eeed34eea02ec56f49411cf499d1c59f0d3a](https://github.com/awslabs/service-workbench-on-aws/commit/a0c7eeed34eea02ec56f49411cf499d1c59f0d3a) to upgrade nodejs version and dependencies for lambda runtimes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const CreateRootUserService = require('../create-root-user-service');
describe('CreateRootUserService', () => {
let service;
let settings;
let logger;
beforeAll(async () => {
// Initialize services container and register dependencies
const container = new ServicesContainer();
Expand All @@ -51,6 +52,10 @@ describe('CreateRootUserService', () => {
// Get instance of the service we are testing
service = await container.find('createRootUserService');

// Suppress console output for tests
logger = await container.find('log');
logger.logger = { info: jest.fn() };

// Mock return for settings get
settings = await container.find('settings');
});
Expand Down
30 changes: 13 additions & 17 deletions addons/addon-base-raas-ui/packages/base-raas-ui/src/helpers/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ function updateUserApplication(user) {
// Remove nulls and omit extra fields from the payload before calling the API
// The user is identified by the uid in the url
const data = removeNulls(
_.omit(
_.clone(user),
_.omit(_.clone(user), [
'uid',
'authenticationProviderId',
'identityProviderName',
'username',
'ns',
'createdAt',
'createdBy',
'updatedBy',
),
]),
);
if (!data.userType) {
// if userType is specified as empty string then make sure to delete it
Expand Down Expand Up @@ -143,18 +143,16 @@ function getEnvironments() {
return httpApiGet('api/workspaces/built-in');
}

function getEnvironmentCost(id, numberDaysInPast, groupByService = true, groupByUser = false) {
return httpApiGet(
`api/costs?env=${id}&numberOfDaysInPast=${numberDaysInPast}&groupByService=${groupByService}&groupByUser=${groupByUser}`,
);
function getEnvironmentCost(scEnv, numberOfDaysInPast, groupByService = true, groupByUser = false) {
return httpApiGet('api/costs', { params: { scEnv, numberOfDaysInPast, groupByService, groupByUser } });
}

function getAllProjCostGroupByUser(numberDaysInPast) {
return httpApiGet(`api/costs?proj=ALL&groupByUser=true&numberOfDaysInPast=${numberDaysInPast}`);
function getAllProjCostGroupByUser(numberOfDaysInPast) {
return httpApiGet('api/costs', { params: { proj: 'ALL', numberOfDaysInPast, groupByUser: true } });
}

function getAllProjCostGroupByEnv(numberDaysInPast) {
return httpApiGet(`api/costs?proj=ALL&groupByEnv=true&numberOfDaysInPast=${numberDaysInPast}`);
function getAllProjCostGroupByEnv(numberOfDaysInPast) {
return httpApiGet('api/costs', { params: { proj: 'ALL', numberOfDaysInPast, groupByEnv: true } });
}

function getEnvironment(id) {
Expand Down Expand Up @@ -253,14 +251,12 @@ function getClientIpAddress() {
return httpApiGet(`api/ip`);
}

function getScEnvironmentCost(id, numberDaysInPast, groupByService = true, groupByUser = false) {
return httpApiGet(
`api/costs?scEnv=${id}&numberOfDaysInPast=${numberDaysInPast}&groupByService=${groupByService}&groupByUser=${groupByUser}`,
);
function getScEnvironmentCost(scEnv, numberOfDaysInPast, groupByService = true, groupByUser = false) {
return httpApiGet('api/costs', { params: { scEnv, numberOfDaysInPast, groupByService, groupByUser } });
}

function getScEnvironments() {
return httpApiGet(`api/workspaces/service-catalog/`);
function getScEnvironments(params) {
return httpApiGet('api/workspaces/service-catalog', { params });
}

function getScEnvironment(id) {
Expand Down
Loading

0 comments on commit 2c3f3d4

Please sign in to comment.