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

Changes to get staging environment working #166

Merged
merged 3 commits into from
Apr 5, 2023
Merged

Changes to get staging environment working #166

merged 3 commits into from
Apr 5, 2023

Conversation

mpsenn
Copy link
Contributor

@mpsenn mpsenn commented Mar 1, 2023

Fixes #165. While setting up the staging environment, I made these changes. Some are strictly necessary, like the namespace prefixing on fields. Some helped me find those issues, like returning errors from event handlers and logging more details in createWorkItem.

Medium changes

(connection.js and services/Gus/*) Keep GUS api sessions alive for 10 minutes. And add debug logging for SOQL requests

(connection.js) Implement namespace prefixes on objects and fields. This should have been implemented when the app started supporting Agile Accelerator, which always has a namespace; not sure why this wasn't done already.

(GithubEvents/index.js and ghEvents.js) Wait for event handlers to return before returning from the github webhook. Previously webhooks would return synchronously, before any GUS callouts would be processed. Now, GUS callouts will delay the webhook response and can affect the 2xx/5xx status code. This will help track errors and latency through logs.

Small changes

Add missing peer dependency 'winston'

Add logs in createWorkItem that helped diagnose an issue with bug priorities.

(GithubEvents/index.js) Use captureRejectionSymbol to mitigate an unhandled promise rejection and avoid app crash. Related to #161.

@mpsenn
Copy link
Contributor Author

mpsenn commented Mar 1, 2023

Could probably write some more tests for these changes, but I think its ready for review.

Fixes #165. While setting up the staging environment, I made these changes. Some are strictly necessary, like the namespace prefixing on fields. Some helped me find those issues, like returning errors from event handlers and logging more details in createWorkItem.

**Medium changes**

(connection.js and services/Gus/*) Keep GUS api sessions alive for 10 minutes. And add debug logging for SOQL requests

(connection.js) Implement namespace prefixes on objects and fields. This should have been implemented when the app started supporting Agile Accelerator, which always has a namespace; not sure why this wasn't done already.

(GithubEvents/index.js and ghEvents.js) Wait for event handlers to return before returning from the github webhook. Previously webhooks would return synchronously, before any GUS callouts would be processed. Now, GUS callouts will delay the webhook response and can affect the 2xx/5xx status code. This will help track errors and latency through logs.

**Small changes**

Add missing peer dependency 'winston'

Add logs in createWorkItem that helped diagnose an issue with bug priorities.

(GithubEvents/index.js) Use captureRejectionSymbol to mitigate an unhandled promise rejection and avoid app crash. Related to #161.
@mpsenn mpsenn requested a review from douglascayers March 7, 2023 02:19
Also log and throw all rejections from handlers
@mpsenn
Copy link
Contributor Author

mpsenn commented Mar 9, 2023

I did push up e516404 that passes unit tests, but didn't test it on the staging environment yet. I'll do that once I get time, as well as writing an internal doc so our folks can use the environment. A draft of that is in our internal slack channel.

@mpsenn mpsenn merged commit 1e29547 into main Apr 5, 2023
@mpsenn mpsenn deleted the msenn-staging branch April 5, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a Salesforce-internal staging environment
2 participants