@quiltdata/benchling-webhook 0.4.13 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/bin/benchling-webhook.d.ts +50 -0
  2. package/dist/bin/benchling-webhook.d.ts.map +1 -0
  3. package/dist/bin/benchling-webhook.js +268 -0
  4. package/dist/bin/benchling-webhook.js.map +1 -0
  5. package/dist/bin/cli.d.ts +3 -0
  6. package/dist/bin/cli.d.ts.map +1 -0
  7. package/dist/bin/cli.js +83 -0
  8. package/dist/bin/cli.js.map +1 -0
  9. package/dist/bin/commands/deploy.d.ts +7 -0
  10. package/dist/bin/commands/deploy.d.ts.map +1 -0
  11. package/dist/bin/commands/deploy.js +154 -0
  12. package/dist/bin/commands/deploy.js.map +1 -0
  13. package/dist/bin/commands/init.d.ts +9 -0
  14. package/dist/bin/commands/init.d.ts.map +1 -0
  15. package/dist/bin/commands/init.js +155 -0
  16. package/dist/bin/commands/init.js.map +1 -0
  17. package/dist/bin/commands/validate.d.ts +5 -0
  18. package/dist/bin/commands/validate.d.ts.map +1 -0
  19. package/dist/bin/commands/validate.js +135 -0
  20. package/dist/bin/commands/validate.js.map +1 -0
  21. package/dist/bin/get-env.js +180 -0
  22. package/dist/bin/publish.js +327 -0
  23. package/{bin → dist/bin}/version.js +73 -37
  24. package/dist/lib/alb-api-gateway.d.ts +17 -0
  25. package/dist/lib/alb-api-gateway.d.ts.map +1 -0
  26. package/dist/lib/alb-api-gateway.js +191 -0
  27. package/dist/lib/alb-api-gateway.js.map +1 -0
  28. package/dist/lib/benchling-webhook-stack.d.ts +25 -0
  29. package/dist/lib/benchling-webhook-stack.d.ts.map +1 -0
  30. package/dist/lib/benchling-webhook-stack.js +165 -0
  31. package/dist/lib/benchling-webhook-stack.js.map +1 -0
  32. package/dist/lib/constants.d.ts +28 -0
  33. package/dist/lib/constants.d.ts.map +1 -0
  34. package/dist/lib/constants.js +31 -0
  35. package/dist/lib/constants.js.map +1 -0
  36. package/dist/lib/ecr-repository.d.ts +16 -0
  37. package/dist/lib/ecr-repository.d.ts.map +1 -0
  38. package/dist/lib/ecr-repository.js +90 -0
  39. package/dist/lib/ecr-repository.js.map +1 -0
  40. package/dist/lib/fargate-service.d.ts +32 -0
  41. package/dist/lib/fargate-service.d.ts.map +1 -0
  42. package/dist/lib/fargate-service.js +294 -0
  43. package/dist/lib/fargate-service.js.map +1 -0
  44. package/{lib/index.ts → dist/lib/index.d.ts} +5 -5
  45. package/dist/lib/index.d.ts.map +1 -0
  46. package/dist/lib/index.js +38 -0
  47. package/dist/lib/index.js.map +1 -0
  48. package/dist/lib/templates/base-template.d.ts +14 -0
  49. package/dist/lib/templates/base-template.d.ts.map +1 -0
  50. package/dist/lib/templates/base-template.js +68 -0
  51. package/dist/lib/templates/base-template.js.map +1 -0
  52. package/dist/lib/templates/readme.d.ts +11 -0
  53. package/dist/lib/templates/readme.d.ts.map +1 -0
  54. package/dist/lib/templates/readme.js +105 -0
  55. package/dist/lib/templates/readme.js.map +1 -0
  56. package/dist/lib/utils/config.d.ts +68 -0
  57. package/dist/lib/utils/config.d.ts.map +1 -0
  58. package/dist/lib/utils/config.js +195 -0
  59. package/dist/lib/utils/config.js.map +1 -0
  60. package/dist/lib/utils/stack-inference.d.ts +73 -0
  61. package/dist/lib/utils/stack-inference.d.ts.map +1 -0
  62. package/dist/lib/utils/stack-inference.js +410 -0
  63. package/dist/lib/utils/stack-inference.js.map +1 -0
  64. package/dist/package.json +90 -0
  65. package/package.json +32 -21
  66. package/AGENTS.md +0 -226
  67. package/CHANGELOG.md +0 -91
  68. package/bin/benchling-webhook.ts +0 -172
  69. package/bin/cli-auth.sh +0 -74
  70. package/bin/get-env.js +0 -564
  71. package/bin/publish-manual.js +0 -211
  72. package/bin/release-notes.sh +0 -82
  73. package/bin/sync-version.js +0 -72
  74. package/cdk.context.json +0 -58
  75. package/cdk.json +0 -85
  76. package/doc/NPM_OIDC_SETUP.md +0 -95
  77. package/doc/PARAMETERS.md +0 -203
  78. package/doc/RELEASE.md +0 -297
  79. package/doc/RELEASE_NOTES.md +0 -64
  80. package/jest.config.js +0 -14
  81. package/lib/README.md +0 -50
  82. package/lib/oauth-tester.json +0 -35
  83. package/tsconfig.json +0 -34
  84. /package/{bin → dist/bin}/check-logs.js +0 -0
  85. /package/{bin → dist/bin}/release.js +0 -0
  86. /package/{bin → dist/bin}/send-event.js +0 -0
  87. /package/{bin → dist/bin}/test-invalid-signature.js +0 -0
package/doc/PARAMETERS.md DELETED
@@ -1,203 +0,0 @@
1
- # CloudFormation Parameters
2
-
3
- This stack supports runtime-configurable parameters that can be updated without redeploying the entire stack.
4
-
5
- ## Available Parameters
6
-
7
- ### Security and Configuration
8
-
9
- #### WebhookAllowList
10
-
11
- - **Type**: String (comma-separated IP addresses)
12
- - **Description**: List of IP addresses allowed to send webhooks
13
- - **Default**: Value from `WEBHOOK_ALLOW_LIST` environment variable (or empty to allow all IPs)
14
- - **Example**: `34.216.192.90,34.217.183.162`
15
-
16
- #### QuiltCatalog
17
-
18
- - **Type**: String
19
- - **Description**: Quilt catalog URL for package links
20
- - **Default**: `open.quiltdata.com`
21
- - **Example**: `catalog.example.com`
22
-
23
- ### Infrastructure Parameters
24
-
25
- #### BucketName
26
-
27
- - **Type**: String
28
- - **Description**: S3 bucket name for storing packages (your data bucket)
29
- - **Default**: Value from `QUILT_USER_BUCKET` environment variable
30
- - **Example**: `my-packages-bucket`
31
-
32
- #### PackagePrefix
33
-
34
- - **Type**: String
35
- - **Description**: Prefix for package names (no slashes allowed)
36
- - **Default**: Value from `PREFIX` environment variable
37
- - **Example**: `benchling` or `my-org`
38
-
39
- #### QueueName
40
-
41
- - **Type**: String
42
- - **Description**: SQS queue name for package notifications
43
- - **Default**: Value from `QUEUE_NAME` environment variable
44
- - **Example**: `my-packager-queue`
45
-
46
- **Note**: Benchling credentials (CLIENT_ID, CLIENT_SECRET, TENANT) are **not** parameters because they're used to create AWS resources at deployment time and contain sensitive information.
47
-
48
- ## Updating Parameters
49
-
50
- ### Using AWS CLI
51
-
52
- Update parameters without redeploying the stack:
53
-
54
- ```bash
55
- # Update webhook allow list only
56
- aws cloudformation update-stack \
57
- --stack-name BenchlingWebhookStack \
58
- --use-previous-template \
59
- --parameters \
60
- ParameterKey=WebhookAllowList,ParameterValue="1.2.3.4,5.6.7.8" \
61
- ParameterKey=QuiltCatalog,UsePreviousValue=true \
62
- ParameterKey=BucketName,UsePreviousValue=true \
63
- ParameterKey=PackagePrefix,UsePreviousValue=true \
64
- ParameterKey=QueueName,UsePreviousValue=true
65
-
66
- # Update multiple parameters
67
- aws cloudformation update-stack \
68
- --stack-name BenchlingWebhookStack \
69
- --use-previous-template \
70
- --parameters \
71
- ParameterKey=WebhookAllowList,ParameterValue="34.216.192.90,34.217.183.162" \
72
- ParameterKey=QuiltCatalog,ParameterValue="my-catalog.quiltdata.com" \
73
- ParameterKey=BucketName,ParameterValue="new-bucket-name" \
74
- ParameterKey=PackagePrefix,UsePreviousValue=true \
75
- ParameterKey=QueueName,UsePreviousValue=true
76
- ```
77
-
78
- ### Using AWS Console
79
-
80
- 1. Go to CloudFormation in AWS Console
81
- 2. Select the `BenchlingWebhookStack` stack
82
- 3. Click **Update**
83
- 4. Select **Use current template**
84
- 5. Click **Next**
85
- 6. Update the parameter values as needed:
86
- - **WebhookAllowList**: Comma-separated IP addresses
87
- - **QuiltCatalog**: Catalog URL
88
- - **BucketName**: S3 bucket name
89
- - **PackagePrefix**: Package prefix
90
- - **QueueName**: SQS queue name
91
- 7. Click **Next** through the remaining screens
92
- 8. Click **Update stack**
93
-
94
- ### Using CDK
95
-
96
- Parameters are automatically created during CDK deployment. The initial values come from environment variables, but subsequent updates can be done via CloudFormation (as shown above) without redeploying via CDK.
97
-
98
- ## Benefits
99
-
100
- - **No Code Deployment**: Update security settings (IP allowlist) without redeploying code
101
- - **Fast Updates**: CloudFormation parameter updates are much faster than full stack updates
102
- - **Zero Downtime**: Parameter updates don't require Lambda redeployment
103
- - **Audit Trail**: All parameter changes are tracked in CloudFormation change sets
104
-
105
- ## Implementation Details
106
-
107
- ### Architecture
108
-
109
- 1. **CloudFormation Parameters**: Defined at stack level
110
- 2. **Lambda Environment Variables**: Automatically updated from parameters
111
- 3. **API Gateway Resource Policy**: Automatically updated from parameters
112
-
113
- ### How It Works
114
-
115
- The stack uses a hybrid approach:
116
-
117
- - **Initial Deployment**: Uses environment variable values from `bin/benchling-webhook.ts`
118
- - **Subsequent Updates**: Uses CloudFormation parameter values
119
- - **Lambda Environment**: Automatically reflects parameter changes via CloudFormation
120
-
121
- When you update a parameter via CloudFormation:
122
-
123
- 1. CloudFormation updates the Lambda function's environment variables
124
- 2. CloudFormation updates the API Gateway Resource Policy
125
- 3. Lambda automatically picks up the new values on next invocation (no cold start required)
126
- 4. API Gateway immediately enforces the new IP allowlist
127
-
128
- ## Examples
129
-
130
- ### Add a new IP to the allowlist
131
-
132
- ```bash
133
- # Current IPs: 34.216.192.90,34.217.183.162
134
- # Adding new IP: 203.0.113.10
135
-
136
- aws cloudformation update-stack \
137
- --stack-name BenchlingWebhookStack \
138
- --use-previous-template \
139
- --parameters \
140
- ParameterKey=WebhookAllowList,ParameterValue="34.216.192.90,34.217.183.162,203.0.113.10" \
141
- ParameterKey=QuiltCatalog,UsePreviousValue=true \
142
- ParameterKey=BucketName,UsePreviousValue=true \
143
- ParameterKey=PackagePrefix,UsePreviousValue=true \
144
- ParameterKey=QueueName,UsePreviousValue=true
145
- ```
146
-
147
- ### Switch to a different S3 bucket
148
-
149
- ```bash
150
- aws cloudformation update-stack \
151
- --stack-name BenchlingWebhookStack \
152
- --use-previous-template \
153
- --parameters \
154
- ParameterKey=WebhookAllowList,UsePreviousValue=true \
155
- ParameterKey=QuiltCatalog,UsePreviousValue=true \
156
- ParameterKey=BucketName,ParameterValue="new-packages-bucket" \
157
- ParameterKey=PackagePrefix,UsePreviousValue=true \
158
- ParameterKey=QueueName,UsePreviousValue=true
159
- ```
160
-
161
- ### Change package prefix
162
-
163
- ```bash
164
- aws cloudformation update-stack \
165
- --stack-name BenchlingWebhookStack \
166
- --use-previous-template \
167
- --parameters \
168
- ParameterKey=WebhookAllowList,UsePreviousValue=true \
169
- ParameterKey=QuiltCatalog,UsePreviousValue=true \
170
- ParameterKey=BucketName,UsePreviousValue=true \
171
- ParameterKey=PackagePrefix,ParameterValue="my-new-prefix" \
172
- ParameterKey=QueueName,UsePreviousValue=true
173
- ```
174
-
175
- ### Allow all IPs (remove IP filtering)
176
-
177
- ```bash
178
- aws cloudformation update-stack \
179
- --stack-name BenchlingWebhookStack \
180
- --use-previous-template \
181
- --parameters \
182
- ParameterKey=WebhookAllowList,ParameterValue="" \
183
- ParameterKey=QuiltCatalog,UsePreviousValue=true \
184
- ParameterKey=BucketName,UsePreviousValue=true \
185
- ParameterKey=PackagePrefix,UsePreviousValue=true \
186
- ParameterKey=QueueName,UsePreviousValue=true
187
- ```
188
-
189
- ## Troubleshooting
190
-
191
- ### Parameter update fails
192
-
193
- If the CloudFormation update fails, check:
194
-
195
- - IP addresses are valid (no spaces, proper CIDR notation if needed)
196
- - Catalog URL is a valid hostname
197
- - You're using `--use-previous-template` flag
198
-
199
- ### Changes not taking effect
200
-
201
- - API Gateway Resource Policy updates are immediate
202
- - Lambda environment variable updates require the Lambda to be invoked again
203
- - Check CloudFormation Events tab for update status
package/doc/RELEASE.md DELETED
@@ -1,297 +0,0 @@
1
- # Release Process
2
-
3
- This document describes how to create releases for the benchling-webhook project.
4
-
5
- ## Overview
6
-
7
- The project uses an automated CI/CD pipeline that:
8
-
9
- 1. Runs tests on all pushes and pull requests
10
- 2. Builds and pushes Docker images when tags are created
11
- 3. Creates GitHub releases with auto-generated release notes
12
- 4. Publishes to NPM and GitHub Packages
13
-
14
- ## Quick Start
15
-
16
- ### Create a Development Release (for testing)
17
-
18
- ```bash
19
- npm run version:dev
20
- # This creates version 0.4.8-dev.0 (or bumps existing dev version)
21
- # Then push the tag:
22
- git push origin v0.4.8-dev.0
23
- ```
24
-
25
- ### Create a Production Release
26
-
27
- ```bash
28
- # For patch releases (0.4.7 -> 0.4.8)
29
- npm run version:patch
30
-
31
- # For minor releases (0.4.7 -> 0.5.0)
32
- npm run version:minor
33
-
34
- # For major releases (0.4.7 -> 1.0.0)
35
- npm run version:major
36
-
37
- # Then push the tag:
38
- git push origin v0.4.8
39
- ```
40
-
41
- ## Detailed Workflow
42
-
43
- ### 1. Prepare Your Release
44
-
45
- Before creating a release:
46
-
47
- 1. **Ensure all changes are committed and pushed**
48
-
49
- ```bash
50
- git status # Should show "nothing to commit, working tree clean"
51
- ```
52
-
53
- 2. **Update CHANGELOG.md** (optional but recommended)
54
-
55
- ```markdown
56
- ## [0.4.8] - 2025-10-27
57
-
58
- ### Added
59
- - New feature description
60
-
61
- ### Changed
62
- - Updated component behavior
63
-
64
- ### Fixed
65
- - Bug fix description
66
- ```
67
-
68
- 3. **Ensure you're on the main branch**
69
-
70
- ```bash
71
- git checkout main
72
- git pull origin main
73
- ```
74
-
75
- ### 2. Create a Release
76
-
77
- #### Development Releases (for testing)
78
-
79
- Development releases are marked as "pre-release" in GitHub and are NOT published to NPM.
80
-
81
- ```bash
82
- # Create a new dev release
83
- npm run version:dev
84
-
85
- # Or bump an existing dev release
86
- npm run version:dev-bump
87
- ```
88
-
89
- This will:
90
-
91
- - Update `package.json` with the new version
92
- - Commit the version change
93
- - Create a git tag (e.g., `v0.4.8-dev.0`)
94
- - Show instructions for pushing the tag
95
-
96
- #### Production Releases
97
-
98
- ```bash
99
- # Choose the appropriate bump type:
100
- npm run version:patch # For bug fixes (0.4.7 -> 0.4.8)
101
- npm run version:minor # For new features (0.4.7 -> 0.5.0)
102
- npm run version:major # For breaking changes (0.4.7 -> 1.0.0)
103
- ```
104
-
105
- ### 3. Push the Tag
106
-
107
- After creating the tag, push it to trigger the CI/CD pipeline:
108
-
109
- ```bash
110
- git push origin v0.4.8 # Replace with your actual tag
111
- ```
112
-
113
- ### 4. Monitor the Release
114
-
115
- 1. **Watch the GitHub Actions workflow**: <https://github.com/quiltdata/benchling-webhook/actions>
116
- 2. **Check the workflow progress**:
117
- - Test job runs first (Python + Node.js tests)
118
- - Docker job runs after tests pass (builds and pushes image)
119
- - Release job creates GitHub release and publishes packages
120
-
121
- 3. **Verify the release**:
122
- - GitHub Release: <https://github.com/quiltdata/benchling-webhook/releases>
123
- - Docker Image in ECR: `{account-id}.dkr.ecr.us-east-1.amazonaws.com/quiltdata/benchling:{version}`
124
- - NPM Package: <https://www.npmjs.com/package/quilt-benchling-webhook>
125
- - GitHub Package: <https://github.com/quiltdata/benchling-webhook/pkgs/npm/quilt-benchling-webhook>
126
-
127
- ## CI/CD Pipeline Details
128
-
129
- ### Workflow Triggers
130
-
131
- The CI workflow (`.github/workflows/ci.yaml`) is triggered by:
132
-
133
- - **Push to main**: Runs tests only
134
- - **Pull requests**: Runs tests only
135
- - **Tags matching `v*.*.*`**: Runs tests, builds Docker, creates release
136
- - **Tags matching `v*.*.*-dev.*`**: Same as above, but marks as pre-release
137
-
138
- ### Jobs
139
-
140
- 1. **test** (always runs)
141
- - Sets up Node.js 22 and Python 3.12
142
- - Installs dependencies
143
- - Runs Python tests (pytest)
144
- - Runs Node.js tests (jest)
145
- - Builds the package
146
-
147
- 2. **docker** (only on tags, after test passes)
148
- - Builds Docker image using `make push-ci`
149
- - Pushes to ECR with version tag and `latest` tag
150
- - Outputs image URI for release notes
151
-
152
- 3. **release** (only on tags, after docker completes)
153
- - Generates release notes from CHANGELOG.md
154
- - Creates GitHub release (pre-release for dev tags)
155
- - Publishes to NPM (production releases only)
156
- - Publishes to GitHub Packages
157
-
158
- ## Version Management Script
159
-
160
- The `bin/version.js` script handles version bumping and tagging:
161
-
162
- ```bash
163
- # View current version and help
164
- npm run release
165
-
166
- # Bump versions
167
- npm run version:major # 0.4.7 -> 1.0.0
168
- npm run version:minor # 0.4.7 -> 0.5.0
169
- npm run version:patch # 0.4.7 -> 0.4.8
170
- npm run version:dev # 0.4.7 -> 0.4.8-dev.0 or 0.4.8-dev.0 -> 0.4.8-dev.1
171
- npm run version:dev-bump # 0.4.8-dev.0 -> 0.4.8-dev.1
172
-
173
- # Update version without creating tag
174
- node bin/version.js patch --no-tag
175
- ```
176
-
177
- ## Docker Images
178
-
179
- Docker images are automatically built and pushed to ECR with:
180
-
181
- - Version tag: `quiltdata/benchling:0.4.8`
182
- - Latest tag: `quiltdata/benchling:latest`
183
-
184
- To pull and run:
185
-
186
- ```bash
187
- docker pull {account-id}.dkr.ecr.us-east-1.amazonaws.com/quiltdata/benchling:0.4.8
188
- docker run -p 5000:5000 --env-file .env {account-id}.dkr.ecr.us-east-1.amazonaws.com/quiltdata/benchling:0.4.8
189
- ```
190
-
191
- ## Troubleshooting
192
-
193
- ### Tag already exists
194
-
195
- ```bash
196
- # Delete local tag
197
- git tag -d v0.4.8
198
-
199
- # Delete remote tag (if pushed)
200
- git push origin :refs/tags/v0.4.8
201
- ```
202
-
203
- ### Workflow failed
204
-
205
- 1. Check the GitHub Actions logs
206
- 2. Common issues:
207
- - Tests failing: Fix tests and create a new tag
208
- - Docker build failing: Check `docker/` directory and Makefile
209
- - AWS credentials: Verify secrets are configured
210
- - ECR repository doesn't exist: Run `make -C docker docker-ecr-create`
211
-
212
- ### Need to re-release
213
-
214
- 1. Delete the tag (locally and remotely)
215
- 2. Delete the GitHub release
216
- 3. Create a new tag with the same or different version
217
-
218
- ## Manual NPM Publishing
219
-
220
- In cases where you need to manually publish to NPM (e.g., CI/CD is unavailable, emergency hotfix, or testing), you can use the manual publish script:
221
-
222
- ### Prerequisites
223
-
224
- 1. **NPM Access Token**: You need an NPM access token with publish permissions
225
- - Visit: <https://www.npmjs.com/settings/[your-username]/tokens>
226
- - Click "Generate New Token"
227
- - Choose "Automation" (for CI/CD) or "Publish" (for manual use)
228
- - Copy the token (it starts with `npm_`)
229
-
230
- ### Usage
231
-
232
- ```bash
233
- # Test the publish process (dry-run)
234
- NPM_TOKEN=npm_xxxxx npm run publish:manual -- --dry-run
235
-
236
- # Publish to NPM
237
- NPM_TOKEN=npm_xxxxx npm run publish:manual
238
-
239
- # Publish with a specific dist-tag
240
- NPM_TOKEN=npm_xxxxx npm run publish:manual -- --tag beta
241
-
242
- # View help
243
- npm run publish:manual -- --help
244
- ```
245
-
246
- ### How It Works
247
-
248
- The script:
249
- 1. Validates your NPM token
250
- 2. Checks for uncommitted changes (with confirmation prompt)
251
- 3. Creates a temporary `.npmrc` file with your token
252
- 4. Runs `npm publish --access public`
253
- 5. Cleans up the temporary `.npmrc` file
254
- 6. Restores any existing `.npmrc` backup
255
-
256
- ### Security Notes
257
-
258
- - The script creates `.npmrc` with restricted permissions (0600)
259
- - Your token is never committed to git (`.npmrc` is in `.gitignore`)
260
- - The temporary `.npmrc` is automatically cleaned up, even on errors
261
- - Always use `--dry-run` first to test before publishing
262
-
263
- ## NPM Scripts Reference
264
-
265
- | Script | Description |
266
- |--------|-------------|
267
- | `npm run release` | Show current version and help |
268
- | `npm run version:major` | Bump major version (breaking changes) |
269
- | `npm run version:minor` | Bump minor version (new features) |
270
- | `npm run version:patch` | Bump patch version (bug fixes) |
271
- | `npm run version:dev` | Create or bump dev version |
272
- | `npm run version:dev-bump` | Bump dev counter only |
273
- | `npm run docker-push` | Build and push Docker image locally |
274
- | `npm run docker-check` | Validate Docker images in registry |
275
- | `npm run publish:manual` | Manually publish to NPM using access token |
276
-
277
- ## Best Practices
278
-
279
- 1. **Always test before releasing**: Run `npm test` and manual testing
280
- 2. **Use dev releases for testing**: Test the CI/CD pipeline with dev tags first
281
- 3. **Update CHANGELOG.md**: Document changes before releasing
282
- 4. **Follow semantic versioning**:
283
- - Major: Breaking changes
284
- - Minor: New features (backward compatible)
285
- - Patch: Bug fixes (backward compatible)
286
- 5. **Review the release**: Check GitHub release notes and test the published packages
287
- 6. **Coordinate with team**: Communicate releases in team channels
288
-
289
- ## Migration Notes
290
-
291
- The previous release process using `bin/create-release.sh` and separate `release.yaml` workflow has been replaced with this integrated CI/CD pipeline. Key changes:
292
-
293
- - **Single workflow**: All release steps are now in `.github/workflows/ci.yaml`
294
- - **Automated**: No manual Docker builds or release note creation needed
295
- - **Tag-based**: Simply push a tag to trigger the release
296
- - **Pre-release support**: Dev tags are automatically marked as pre-releases
297
- - **Integrated testing**: Docker images are only built after tests pass
@@ -1,64 +0,0 @@
1
- # Benchling Webhook Integration for Quilt
2
-
3
- Connects Benchling lab notebook entries to Quilt data packages via webhooks.
4
-
5
- ## Quick Install
6
-
7
- **Prerequisites:** AWS account, Node.js 18+, Docker, existing Quilt deployment
8
-
9
- ```bash
10
- # 1. Clone and install
11
- git clone https://github.com/quiltdata/benchling-webhook.git
12
- cd benchling-webhook
13
- npm install
14
-
15
- # 2. Configure (auto-infer from Quilt catalog)
16
- npm run get-env -- https://quilt-catalog.yourcompany.com --write
17
- cp env.inferred .env
18
- # Edit .env to add Benchling credentials
19
-
20
- # 3. Deploy
21
- source .env
22
- npx cdk bootstrap aws://$CDK_DEFAULT_ACCOUNT/$CDK_DEFAULT_REGION # first time only
23
- npm run deploy
24
-
25
- # 4. Configure Benchling app
26
- # - Create app from app-manifest.yaml
27
- # - Set webhook URL from .env.deploy
28
- # - Install and activate
29
-
30
- # 5. Verify
31
- source .env.deploy
32
- curl $WEBHOOK_ENDPOINT/health
33
- ```
34
-
35
- ## Usage
36
-
37
- 1. Create entry in Benchling
38
- 2. Insert Canvas → "Quilt Integration"
39
- 3. Click "Create" to make package
40
- 4. Add files and click "Update package"
41
-
42
- ## Documentation
43
-
44
- - [AGENTS.md](AGENTS.md) - Complete deployment guide, architecture, configuration
45
- - [docker/README.md](docker/README.md) - Development workflows
46
- - [doc/RELEASE.md](doc/RELEASE.md) - Release process
47
-
48
- ## License
49
-
50
- Apache-2.0
51
-
52
- ---
53
-
54
- ## Docker Images (for custom deployments)
55
-
56
- **Latest Release (v0.4.12):**
57
- - Production: `public.ecr.aws/quiltdata/benchling:0.4.12`
58
- - Latest: `public.ecr.aws/quiltdata/benchling:latest`
59
-
60
- Pull and run:
61
- ```bash
62
- docker pull public.ecr.aws/quiltdata/benchling:0.4.12
63
- docker run -p 5000:5000 --env-file .env public.ecr.aws/quiltdata/benchling:0.4.12
64
- ```
package/jest.config.js DELETED
@@ -1,14 +0,0 @@
1
- module.exports = {
2
- testEnvironment: 'node',
3
- roots: ['<rootDir>/test'],
4
- testMatch: ['**/*.test.ts'],
5
- transform: {
6
- '^.+\\.tsx?$': ['ts-jest', {
7
- tsconfig: {
8
- module: 'node20',
9
- resolveJsonModule: true
10
- }
11
- }]
12
- },
13
- cacheDirectory: '<rootDir>/.jest-cache'
14
- };
package/lib/README.md DELETED
@@ -1,50 +0,0 @@
1
- # Benchling Webhook Stack Architecture
2
-
3
- This directory contains the core CDK infrastructure code split across multiple files for better organization:
4
-
5
- ## Core Components
6
-
7
- ### benchling-webhook-stack.ts
8
-
9
- The main stack file that orchestrates the entire infrastructure. It:
10
-
11
- - Creates the S3 bucket reference
12
- - Sets up the Benchling OAuth connection
13
- - Instantiates the state machine and API gateway
14
- - Manages stack outputs
15
-
16
- ### state-machine.ts
17
-
18
- Contains the Step Functions state machine definition that:
19
-
20
- - Processes incoming webhook events
21
- - Stores event data in S3
22
- - Fetches entry details from Benchling API
23
- - Sends notifications to SQS
24
-
25
- ### api-gateway.ts
26
-
27
- Handles the API Gateway configuration including:
28
-
29
- - REST API setup with logging
30
- - IAM roles and permissions
31
- - Webhook endpoints for different event types
32
- - Integration with Step Functions
33
-
34
- ## Flow
35
-
36
- 1. API Gateway receives webhook POST requests
37
- 2. Requests trigger Step Functions execution
38
- 3. State machine:
39
- - Stores raw event in S3
40
- - Fetches entry details from Benchling
41
- - Stores entry data in S3
42
- - Sends notification to SQS
43
-
44
- ## Key Features
45
-
46
- - Modular architecture for maintainability
47
- - Separation of concerns between components
48
- - Reusable constructs
49
- - Proper error handling
50
- - Comprehensive logging
@@ -1,35 +0,0 @@
1
- {
2
- "Comment": "OAuth 2.0 with EventBridge Connection in Step Functions",
3
- "StartAt": "RequestAccessToken",
4
- "States": {
5
- "RequestAccessToken": {
6
- "Type": "Task",
7
- "Resource": "arn:aws:states:::http:invoke",
8
- "Parameters": {
9
- "Method": "POST",
10
- "ApiEndpoint": "https://quilt-dtt.benchling.com/api/v2/token",
11
- "Authentication": {
12
- "ConnectionArn": "arn:aws:events:us-east-1:123456789012:connection/BenchlingOAuthConnection"
13
- }
14
- },
15
- "ResultSelector": {
16
- "access_token": "$.Body.access_token"
17
- },
18
- "ResultPath": "$.auth",
19
- "Next": "CallListEntries"
20
- },
21
- "CallListEntries": {
22
- "Type": "Task",
23
- "Resource": "arn:aws:states:::http:invoke",
24
- "Parameters": {
25
- "Method": "GET",
26
- "ApiEndpoint": "https://quilt-dtt.benchling.com/api/v2/entries",
27
- "Headers": {
28
- "Authorization.$": "States.Format('Bearer {}', $.auth.access_token)",
29
- "Content-Type": "application/json"
30
- }
31
- },
32
- "End": true
33
- }
34
- }
35
- }
package/tsconfig.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "node20",
5
- "lib": [
6
- "es2020",
7
- "dom"
8
- ],
9
- "declaration": true,
10
- "strict": true,
11
- "noImplicitAny": true,
12
- "strictNullChecks": true,
13
- "noImplicitThis": true,
14
- "alwaysStrict": true,
15
- "noUnusedLocals": false,
16
- "noUnusedParameters": false,
17
- "noImplicitReturns": true,
18
- "noFallthroughCasesInSwitch": false,
19
- "inlineSourceMap": true,
20
- "inlineSources": true,
21
- "experimentalDecorators": true,
22
- "strictPropertyInitialization": false,
23
- "esModuleInterop": true,
24
- "resolveJsonModule": true,
25
- "noEmit": true,
26
- "typeRoots": [
27
- "./node_modules/@types"
28
- ]
29
- },
30
- "exclude": [
31
- "node_modules",
32
- "cdk.out"
33
- ]
34
- }
File without changes
File without changes
File without changes