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

APPEALS-28105 WEBEX Mockservice #19183

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2d1354e
APPEALS-28105 Initial adding of WEBEX Mockservice
breedbah Aug 14, 2023
6f2e8e0
APPEALS-28105 start of webex custom server
breedbah Aug 16, 2023
717b69c
APPEALS-28105 Adding error messages
breedbah Aug 16, 2023
2f671d1
APPEALS-28105 Completed adding errors to server
breedbah Aug 16, 2023
1b8b8fb
APPEALS-28105 changes to webex server
breedbah Aug 17, 2023
05c620b
APPEALS-28105 Started autogenerate data functionality
breedbah Aug 17, 2023
8cf7856
APPEALS-28105 Updated error handling
breedbah Aug 17, 2023
1a55e14
APPEALS-28105 Updated routes
breedbah Aug 17, 2023
9eb4e8c
Merge branch 'master' into b_reed/APPEALS-28105
breedbah Aug 17, 2023
e2858be
APPEALS-28105 Got the api webex-generation working
breedbah Aug 18, 2023
38ddb28
APPEALS-25108 removed dummy data
breedbah Aug 18, 2023
28b27ed
APPEALS-28105 return the conference link object
breedbah Aug 21, 2023
fe87289
APPEALS-28105 Removed webex-mock.json file
breedbah Aug 21, 2023
38d7010
APPEALS-28105 added the webex-mock.json to .gitignore
breedbah Aug 21, 2023
88a7435
APPEALS-28105 update linting errors
breedbah Aug 21, 2023
a45deef
APPEALS-28105 Completed addressing linting errors
breedbah Aug 21, 2023
6802591
APPEALS-28105 Updated the Readme.md
breedbah Aug 21, 2023
94719fe
APPEALS-28105 Addressed Code Climate errors
breedbah Aug 21, 2023
45e6eed
APPEALS-28105 Addressed linting errors
breedbah Aug 21, 2023
55c6410
APPEALS-28105 removed commented code
breedbah Aug 22, 2023
d8ab350
Merge branch 'master' into b_reed/APPEALS-28105
breedbah Aug 22, 2023
09bf07c
fixing flaky test (#19231)
pamatyatake2 Aug 23, 2023
68b51af
fix flakey tests in login spec (#19233)
csheepy Aug 23, 2023
1a4a11a
APPEALS-28989 Added Ensure block that will always update last_synced_…
Aaron-Willis Aug 23, 2023
1a3def3
Add jest tests for `CancelIntakeModal` (#19238)
brandondorner Aug 23, 2023
340d8d5
Merge branch 'master' into dev-support/skipped-test-updates
craigrva Aug 23, 2023
9b5777a
Merge branch 'master' into hotfix/APPEALS-28989
Aaron-Willis Aug 23, 2023
e4bb5f3
APPEALS-28105 Updated readme.md with installation resolution
breedbah Aug 23, 2023
eb9b151
Merge branch 'feature/APPEALS-26734' into b_reed/APPEALS-28105
breedbah Aug 23, 2023
e2aa205
added the code needed for the test to pass (#19243)
seancva Aug 23, 2023
5924165
TYLERB/APPEALS-29085: Fix flakyness in the pre_docket_spec.rb file (#…
TylerBroyles Aug 23, 2023
a2bec4a
Merge pull request #19244 from department-of-veterans-affairs/dev-sup…
craigrva Aug 24, 2023
1a1e63a
Merge branch 'master' into hotfix/APPEALS-28989
Aaron-Willis Aug 24, 2023
db8c17f
Merge pull request #19240 from department-of-veterans-affairs/hotfix/…
Aaron-Willis Aug 24, 2023
75f563d
APPEALS-28105 Revert back to Addressed lint errors
breedbah Aug 24, 2023
c625480
Merge branch 'b_reed/APPEALS-28105' of https://github.com/department-…
breedbah Aug 24, 2023
99c1ee9
APPEALS-28105 cleaned up and completed mock server update
breedbah Aug 25, 2023
ffef0db
APPEALS-28105 Updated and modified meeting data
breedbah Aug 25, 2023
afdca04
Merge branch 'master' into b_reed/APPEALS-28105
breedbah Aug 25, 2023
8125b6c
Update MAC_M1.md
craigrva Aug 25, 2023
6828546
Merge branch 'master' into b_reed/APPEALS-28105
breedbah Aug 25, 2023
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ client/junit.xml
!/reports/sql_queries
!/reports/.keep
credstash.log
client/mocks/webex-mocks/webex-mock.json
# Ignore MS Office temp files
~$*

Expand Down
22 changes: 13 additions & 9 deletions MAC_M1.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ OpenSSL
---
1. Download openssl@1.1 and openssl@3 from this [link](https://boozallen.sharepoint.com/teams/VABID/appeals/Documents/Forms/AllItems.aspx?id=%2Fteams%2FVABID%2Fappeals%2FDocuments%2FDevelopment%2FDeveloper%20Setup%20Resources%2FM1%20Mac%20Developer%20Setup&viewid=8a8eaf3e%2D2c12%2D4c87%2Db95f%2D4eab3428febd)
2. Open “Finder” and find the two folders under “Downloads”
3. Extract the `.tar.gz` files
3. Extract the `.tar.gz` or `.zip` archives
4. In each of the extracted folders:
1. Navigate to the `/usr/local/homebrew/Cellar` subfolder
2. Copy the openssl folder to your local machine's `/usr/local/homebrew/Cellar` folder
Expand Down Expand Up @@ -168,22 +168,26 @@ Run dev setup scripts in Caseflow repo
1. Open a **Rosetta** terminal and navigate to /usr/local, run the command ```sudo spctl --global-disable```
2. In the **Rosetta** terminal, install pyenv and the required python2 version:
1. `brew install pyenv`
2. `pyenv install 2.7.18`
3. In the caseflow directory, run `pyenv local 2.7.18` to set the version
2. `pyenv rehash`
3. `pyenv install 2.7.18`
4. In the caseflow directory, run `pyenv local 2.7.18` to set the version
3. In the **Rosetta** terminal navigate to caseflow folder:
1. set ```RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/homebrew/Cellar/openssl@1.1"```
2. run `rbenv install 2.7.3`
3. run `gem install pg:1.1.4 -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config`
4. Install v8@3.15 by doing the following (these steps assume that vi/vim is the default editor):
1. set ```export RUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/homebrew/Cellar/openssl@1.1"```
2. run `rbenv install $(cat .ruby-version)`
3. run `rbenv rehash`
4. run `gem install bundler -v $(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)`
5. run `gem install pg:1.1.4 -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config`
6. Install v8@3.15 by doing the following (these steps assume that vi/vim is the default editor):
1. run `brew edit v8@3.15`
2. go to line 21 in the editor by typing `:21`
Note: the line being removed is `disable! date: "2023-06-19", because: "depends on Python 2 to build"`
3. delete the line by pressing `d` twice
4. save and quit by typing `:x`
5. Configure build opts for gem `therubyracer`:
5. run `HOMEBREW_NO_INSTALL_FROM_API=1 brew install v8@3.15`
7. Configure build opts for gem `therubyracer`:
1. `bundle config build.libv8 --with-system-v8`
2. `bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)`
6. run ```./scripts/dev_env_setup_step2.sh```
8. run ```./scripts/dev_env_setup_step2.sh```
If you get a permission error while running gem install or bundle install, **do not run using sudo.**
Set the permissions back to you for every directory under /.rbenv
* Enter command: `sudo chown -R <your name under /Users> /Users/<your name>/.rbenv`
Expand Down
10 changes: 6 additions & 4 deletions app/models/end_product_establishment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,7 @@ def sync!
contentions unless result.status_type_code == EndProduct::STATUSES.key("Canceled")

transaction do
update!(
synced_status: result.status_type_code,
last_synced_at: Time.zone.now
)
update!(synced_status: result.status_type_code)
status_cancelled? ? handle_cancelled_ep! : sync_source!
close_request_issues_with_no_decision!
end
Expand All @@ -224,6 +221,11 @@ def sync!
rescue StandardError => error
Raven.extra_context(end_product_establishment_id: id)
raise error
ensure
# Always update last_synced_at to ensure that SyncReviewsJob does not immediately re-enqueue
# End Product Establishments that fail to sync with BGS into the EndProductSyncJob.
# This will allow for other End Product Establishments to sync first before re-attempting.
update!(last_synced_at: Time.zone.now)
end

def fetch_dispositions_from_vbms
Expand Down
22 changes: 5 additions & 17 deletions client/app/queue/OrganizationUsers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,23 +279,11 @@ export default class OrganizationUsers extends React.PureComponent {
organization={this.props.organization}
user={user} />
</div>
{this.state.organizationName === 'Hearing Admin' &&
!conferenceSelectionVisibility && (
<div
{...radioContainerStyle}
>
<SelectConferenceTypeRadioField
key={`${user.id}-conference-selection`}
name={user.id}
/>
</div>
)}
</div>
)}
</ul>
</div>
</React.Fragment>
);
}
</div> }
</ul>
</div>
</React.Fragment>;
});

return <React.Fragment>
Expand Down
59 changes: 59 additions & 0 deletions client/mocks/webex-mocks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
Setup json server

Step 1: Open a terminal

Step 2: Navigate to the caseflow/client

step 3: Run command: [npm install json-server] or [yarn add json-server]

If the [npm install json-server] or [yarn add json-server] returns an error that resembles:

error standard@17.1.0: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "15.1.0"

extra steps may need to be taken.

for brevity These instructions will follow the happy path. While in the client directory in terminal:
[nodenv install 14.21.2]
[nodenv local 14.21.2]

If for any reason you want to go back to the original nodenv that was used prior to this change you can run, [nodenv local 12.13.0]

If it all succeeds you can attempt the [npm install json-server] or [yarn add json-server] once again.

This time with no issue.
given that the install goes as expected you can continue following the rest of the directions.

If there are still issues in getting this to operate as expected, See your tech lead for asssisstance.

step 4: Make sure casfelow application is running

step 5: Autogenerate test data, run this command: npm run generate-webex(This will also create the json file)

step 6: Run command: npm run webex-server

\*info: You will recieve all available routes within the terminal under 'Resources'

\*info: port must be set on a different port to run due to caseflow running on port 3000

step 7: Open a browser window in chrome and navigate to localhost:3050 [You will get the default page]

\*info: You can use any api endpoint software you want like Postman, but a good lightweight vs code ext. is [Thunder Client]

\*info: reference guides
[https://github.com/typicode/json-server/blob/master/README.md]

Tutorial Resources:
[https://www.youtube.com/watch?v=_1kNqAybxW0&list=PLC3y8-rFHvwhc9YZIdqNL5sWeTCGxF4ya&index=1]

To create a meeting the request body must have all of the keys and hit this endpoint?
[http://localhost:3050/fake.api-usgov.webex.com/v1/meetings]

Get all conferencelinks with this endpoint
[http://localhost:3050/api/v1/conference-links]

Javascript API call Fetch/Axios examples
[https://jsonplaceholder.typicode.com/]




37 changes: 37 additions & 0 deletions client/mocks/webex-mocks/meetingData.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const faker = require('faker');

const generateMeetingData = (response) => {

return {
id: faker.random.uuid(),
jwt: {
sub: response.jwt.sub,
Nbf: response.jwt.Nbf,
Exp: response.jwt.Exp,
flow: {
id: faker.random.uuid(),
data: [
{
uri: `${faker.internet.userName()}@intadmin.room.wbx2.com`,
},
{
uri: `${faker.internet.userName()}@intadmin.room.wbx2.com`,
},
],
},
},
aud: faker.random.uuid(),
numGuest: faker.random.number({ min: 1, max: 10 }),
numHost: 1,
provideShortUrls: faker.random.boolean(),
verticalType: faker.company.catchPhrase(),
loginUrlForHost: faker.random.boolean(),
jweAlg: 'PBES2-HS512+A256KW',
saltLength: faker.random.number({ min: 1, max: 16 }),
iterations: faker.random.number({ min: 500, max: 2000 }),
enc: 'A256GCM',
jwsAlg: 'HS512',
};
};

module.exports = generateMeetingData;
5 changes: 5 additions & 0 deletions client/mocks/webex-mocks/routes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

{
"/api/v1/conference-links": "/conferenceLinks",
"/api/v1/conference-links/:id": "/conferenceLinks/:id"
}
50 changes: 50 additions & 0 deletions client/mocks/webex-mocks/webex-mock-generator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const fs = require('fs');
const faker = require('faker');
const generateMeetingData = require('./meetingData.js');

const generateConferenceLinks = () => {
let webexLinks = [];

for (let id = 1; id <= 10; id++) {
const startDate = new Date('2021-01-01T00:00:00Z');
const endDate = new Date('2023-01-01T00:00:00Z');

const randomStartDate = faker.date.between(startDate, endDate);
const randomEndDate = new Date(randomStartDate.getTime());

randomEndDate.setHours(randomEndDate.getHours() + 1);

let startTime = randomStartDate.toISOString().replace('Z', '');
let endTime = randomEndDate.toISOString().replace('Z', '');

let subject = faker.lorem.words();

let updatedValues = {
jwt: {
sub: subject,
Nbf: startTime,
Exp: endTime
}
};

webexLinks.push(generateMeetingData(updatedValues));
}

return webexLinks;
};

// Generate the data
const data = {
conferenceLinks: generateConferenceLinks(),
// ... other data models
};

// Check if the script is being run directly
if (require.main === module) {
fs.writeFileSync(
'mocks/webex-mocks/webex-mock.json',
JSON.stringify(data, null, 2)
);
// eslint-disable-next-line no-console
console.log("Generated new data in webex-mock.json");
}
Loading
Loading