-
Notifications
You must be signed in to change notification settings - Fork 106
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
CUMULUS-359 kinesis consumer users sf-scheduler #262
CUMULUS-359 kinesis consumer users sf-scheduler #262
Conversation
…' into abarciauskas-bgse_CUMULUS-359-kinesis-consumer-uses-sfscheduler
…uskas-bgse_CUMULUS-359-kinesis-consumer-uses-sfscheduler
collection: { name: 'test-collection' }, | ||
payload: { test: 'test payload' } | ||
}; | ||
test('the queue receives a correctly formatted workflow message', async(t) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we removed queueWorkflowMessage
this is being repurposed to test enqueueGranuleIngestMessage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments
)); | ||
)) | ||
.catch((err) => { | ||
console.log('Caught error in process record:'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of console.log
, this should use the logger i.e. log.error
packages/api/lambdas/sf-scheduler.js
Outdated
* @param {function} cb lambda callback | ||
* @param {Object} event - lambda input message | ||
* @param {Object} context - lambda context | ||
* @param {function} cb - lambda callback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a returns to this one please?
CHANGELOG.md
Outdated
- Pass encrypted password to the ApiGranule Lambda function [CUMULUS-424] | ||
- `@cumulus/api`: `kinesis-consumer.js` uses `sf-scheduler.js#schedule` instead of placing a message directly on the `startSF` SQS queue. This is a fix for [CUMULUS-359](https://bugs.earthdata.nasa.gov/browse/CUMULUS-359) because `sf-scheduler.js#schedule` looks up the provider and collection data in DynamoDB and adds it to the `meta` object of the enqueued message payload. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the unreleased section
Summary: Kinesis consumer users sf-scheduler
Kinesis Consumer's invocation of Rule.buildPayload uses the values of provider and collection in the the kinesis rule. The kinesis rule values for collection and provider are in the payload sent to sfScheduler#schedule. So the provider (the string id) and collection object (name and version object), that are stored in the rule are used to look up the provider and collection objects stored in dynamo. The full dynamodb data is what is set as the cumulus message's
$.meta.provider
and$.meta.collection
. This is important because downstream tasks, such as sync granule, require the provider and collection data.Addresses CUMULUS-359
Detailed Changes
packages/api/lambdas
Test Plan
Things that should succeed before merging.
Created a stream, provider, collection and kinesis rule for HelloWorldWorkflow. Important that the kinesis rule has correct provider and collection information. Put a record on the stream for the collection. Verified hello world workflow had started and the payload includes the collection and provider data in the meta and the entire kinesis record in the payload.
./bin/eslint-ratchet
and verify that eslint errors have not increased.eslint-ratchet-high-water-mark
if the score has improved