@noodle-graph/scanner
v0.0.17
Published
- [Scanning](#scanning) - [Noodle comment](#noodle-comment) - [Undeclared resources](#undeclared-resources) - [Scan output](#scan-output) - [Relationship object](#relationship-object)
Downloads
10
Readme
Scanner
Scanning
- Login to GitHub user.
- Clone repositories.
- Scan the files in each repository and search Noodle comments.
- Enrich and return the result object.
Noodle comment
A code comment that represents a relationship with another resource. It has (roughly) the following structure: noodle --{action}-> {resourceId} ({tags})
For example:
// noodle --requests from-> another-api-service (http,get,feature1,feature1)
// noodle <-receive from-- sqs-my-queue (sqs,feature2,data)
/* noodle --uploads to-> s3-my-bucket (s3,feature1) */
# noodle --publish to-> sns-topic1 (sns,feature2)
// noodle --> sns-topic2 (sns,feature2)
// noodle <-> sns-topic3
Every time the scanner finds a Noodle comment it will add the relationship to the results.
Undeclared resources
Resources that were discovered during the scan and were not listed in the scan config file.
Scan output
Here is a sample of scan output:
{
"resources": [
{
"id":"some-service",
"url":"./someService",
"name":"Some Service",
"tags": [
"feature1",
"feature2",
"service"
],
"type":"aws/ecs",
"source":"local",
"relationships": [
{
"action":"requests from",
"resourceId":"another-service",
"tags":[
"feature",
"hello"
],
"url":"./someService",
"from":false,
"to":true
}
],
"additionalLinks": []
},
{
"id":"another-service",
"url":"./anotherService",
"name":"Another Service",
"tags": [
"feature1",
"service"
],
"type":"aws/ecs",
"source":"local",
"relationships": [
{
"action":"query",
"resourceId":"some-db",
"tags":[
"feature"
],
"url":"./anotherService",
"from":false,
"to":true
}
],
"additionalLinks": []
},
{
"id":"some-db",
"name":"Some DB",
"tags": [
"feature1",
"feature2",
"service"
],
"type":"aws/aurora",
"additionalLinks": []
}
]
}
Note that this is very similar to the scan config file, except the relationships
field
Relationship object
| Field | Description |
|-|-|
| resourceId
| The identifier of the related resource. |
| action
| The action declared in the relationship. |
| tags
| The tags of the relationship for filtering. |
| url
| The link to the exact line of the Noodle comment. |
| from
| Whether arrow should be in the "from" resource. |
| to
| Whether arrow should be in the "to" resource. |