sfpowerscripts
sfpowerscripts copied to clipboard
feat(events): new event stream for build command
Summary generated by Reviewpad on 12 Dec 23 05:41 UTC
This pull request includes changes to multiple files. Here is a summary of the changes:
-
build.ts
in theorchestrator
directory:- Added a new property
jobId
to theBuild
class. - Other existing properties remain unchanged.
- Added a new property
-
CreateDataPackageImpl.ts
:- Added import statement for
BuildStreamService
from'../../eventStream/build'
. - Added calls to
BuildStreamService.sendPackageError()
with error messages.
- Added import statement for
-
build.json
:- Added a new property
jobIdFlagDescription
.
- Added a new property
-
CreateDiffPackageImpl.ts
:- Imported
BuildStreamService
from thebuild
event stream. - Used
BuildStreamService
to send a package error message and throw an error.
- Imported
-
PackageDependencyDisplayer.ts
:- Added an import statement for
BuildStreamService
. - Made changes to the
printPackageDependencies
method.
- Added an import statement for
-
CreatePackage.ts
:- Added an import statement for
BuildStreamService
. - Added calls to
BuildStreamService.buildPackageStatus()
andBuildStreamService.sendPackageError()
.
- Added an import statement for
-
BuildImpl.ts
:- Added import statement for
BuildStreamService
. - Made various changes to the
BuildImpl
class.
- Added import statement for
-
hooks.ts
:- Added a new file with code for logging events and sending webhooks.
-
Other files:
- Contains various changes related to types, interfaces, and imports.
Please review these changes and let me know if you have any questions.
Hi @azlam-abdulsalam
This is the pull request for the new event stream. (build and release command)
There are 2 options:
- Send the events to (a new object on) devhub
To activate this method you need to first install the package 04t2o000001B1kiAAC. This package contains a new object called SfPowerscriptsEvent__c and a permission set to access the new fields. And it has a scheduled apex class where you can delete old records from the event object. (default value older then 15 days)
Then you have to set the new (optional) flag --jobid (-j) to send the events to the devhub.
- Send the events as webhook
To activate this method you need to set the ENV variables
EVENT_STREAM_WEBHOOK_URL EVENT_STREAM_WEBHOOK_TOKEN
optional(NODE_TLS_REJECT_UNAUTHORIZED=0) (required when you have no ssl certificates for the hook)
At the end we create always a new json in the .sfpowerscripts folder with the name ,,eventStreamBuild.json'' OR ,,eventStreamRelease.json''. This file has all infos from part1/2 as well.
Checklist
All items have to be completed before a PR is merged
- [x] Adhere to Contribution Guidelines
- [ ] Updates to Decision Records considered?
- [ ] Updates to documentation at DX@Scale Guide considered?
- [ ] Tested changes?
- [ ] Unit Tests new and existing passing locally?
Reviewpad Report
:warning: Warnings
- Please link an issue to the pull request
Codecov Report
Attention: 158 lines
in your changes are missing coverage. Please review.
Comparison is base (
94042a5
) 46.83% compared to head (6b1dd48
) 45.04%.
Additional details and impacted files
@@ Coverage Diff @@
## main #1446 +/- ##
==========================================
- Coverage 46.83% 45.04% -1.79%
==========================================
Files 70 73 +3
Lines 2667 2855 +188
Branches 300 315 +15
==========================================
+ Hits 1249 1286 +37
- Misses 1416 1539 +123
- Partials 2 30 +28
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.