Conversation
Signed-off-by: AbhishekJadhav2002 <[email protected]>
… serverless configuration
There was a problem hiding this comment.
Pull request overview
Adds GitHub Actions-based deployment workflows and updates Serverless configuration to support staged deployments (dev/staging/production) with environment-variable management.
Changes:
- Introduces GitHub Actions workflows for staging/production deploys and PR-based prestage deploy/remove.
- Updates
serverless.ymlto add provider settings (stage, VPC, deployment bucket) and custom domain configuration. - Refactors
serverless.env.ymlinto explicitproduction/staging/devblocks and adds deploy scripts topackage.json.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
serverless.yml |
Adds provider defaults (stage/VPC/bucket) and custom domain configuration for deployments. |
serverless.env.yml |
Defines per-environment variables (prod/staging/dev) and defaults via YAML anchor. |
package.json |
Adds deploy:staging and deploy:production scripts for workflows. |
.gitignore |
Ignores local mysql/ and logs/ directories. |
.github/workflows/release-prestage.yml |
Deploys PR branches to a prestage environment. |
.github/workflows/remove-prestage.yml |
Removes PR branch deployments on PR close. |
.github/workflows/release-staging.yml |
Deploys staging on main pushes / manual dispatch. |
.github/workflows/release-production.yml |
Deploys production on version tag pushes. |
.github/PULL_REQUEST_TEMPLATE.md |
Adds a PR template to standardize PR context. |
.github/CODEOWNERS |
Adds code ownership configuration for review routing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…erverless.yml framework version
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 13 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…work version in serverless configuration
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 8 comments.
Comments suppressed due to low confidence (1)
serverless.yml:33
apiTypeis set torest, but all function events are configured ashttpApi(API Gateway v2 HTTP API). With serverless-domain-manager this is a mismatch and can lead to the custom domain being created/attached to the wrong API type or failing. Align these by either switching events tohttp(REST API) or settingapiTypeto the HTTP API value supported by the plugin.
stage: ${sls:stage}
createRoute53Record: true
endpointType: "regional"
apiType: "rest"
autoDomain: true
functions:
ingest:
handler: src/handlers/ingestionHandler.index
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
serverless.yml:63
custom.customDomainis configured, but theserverless-domain-managerplugin has been removed fromplugins, so these settings will be ignored and custom domain automation won’t run. Either re-add the plugin or remove thecustomDomainblock to avoid a broken/unused deployment configuration.
plugins:
- serverless-offline
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 11 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| prod: search.devicebits.com | ||
| endpointType: "regional" | ||
| apiType: "rest" | ||
| autoDomain: true |
There was a problem hiding this comment.
The autoDomain property is set to true, but this is not a standard serverless-domain-manager configuration option. The valid properties for serverless-domain-manager are: domainName, basePath, stage, certificateName, certificateArn, createRoute53Record, endpointType, securityPolicy, apiType, and autoDomainWaitFor. Remove this property or verify it's supported by your version of the plugin.
| autoDomain: true |
| customDomain: | ||
| domainName: ${self:custom.domains.${self:custom.stage}} | ||
| basePath: '' | ||
| stage: ${self:custom.stage} | ||
| domainName: ${env:DOMAIN_NAME, 'search-${sls:stage}.devicebits.com'} | ||
| basePath: "" | ||
| stage: ${sls:stage} | ||
| createRoute53Record: true | ||
| endpointType: 'regional' | ||
| apiType: HTTP | ||
| securityPolicy: tls_1_2 | ||
| domains: | ||
| dev: search-staging.devicebits.com | ||
| prod: search.devicebits.com | ||
| endpointType: "regional" | ||
| apiType: "rest" | ||
| autoDomain: true |
There was a problem hiding this comment.
The serverless-domain-manager plugin has been removed from the plugins section (line 62-63), but the customDomain configuration is still present. This configuration will be ignored without the plugin. Either add the serverless-domain-manager plugin back to the plugins section, or remove this customDomain configuration block.
| securityGroupIds: ${ssm:/vpc/securityGroupIds} | ||
| subnetIds: ${ssm:/vpc/subnetIds} |
There was a problem hiding this comment.
The VPC configuration uses hardcoded SSM parameter paths (/vpc/securityGroupIds and /vpc/subnetIds) that are not environment-specific. This means all environments (dev, staging, production) will use the same VPC configuration. If you need different VPC configurations per environment, consider using environment-specific SSM paths like /${opt:stage}/vpc/securityGroupIds or document that all environments intentionally share the same VPC.
| securityGroupIds: ${ssm:/vpc/securityGroupIds} | |
| subnetIds: ${ssm:/vpc/subnetIds} | |
| securityGroupIds: ${ssm:/${sls:stage}/vpc/securityGroupIds} | |
| subnetIds: ${ssm:/${sls:stage}/vpc/subnetIds} |
| dev: search-staging.devicebits.com | ||
| prod: search.devicebits.com | ||
| endpointType: "regional" | ||
| apiType: "rest" |
There was a problem hiding this comment.
The apiType has been changed from "HTTP" to "rest" in the customDomain configuration, but all function events are using httpApi (lines 37-51 in the full file). This is a mismatch - REST APIs use http events, while HTTP APIs use httpApi events. If you're switching to REST API, update all function events from httpApi to http. If you're keeping HTTP API, change apiType back to "HTTP".
| apiType: "rest" | |
| apiType: "HTTP" |
| "devDependencies": { | ||
| "serverless-domain-manager": "^8.0.0", | ||
| "serverless-offline": "^14.4.0" | ||
| "serverless-offline": "^12.0.4" |
There was a problem hiding this comment.
The serverless-offline version has been downgraded from ^14.4.0 to ^12.0.4. This is a major version downgrade (from v14 to v12) which could introduce compatibility issues or lose bug fixes and features from newer versions. Verify that this downgrade is intentional and necessary. If the current version of serverless (^3.30.1) requires an older version of serverless-offline, document why this downgrade was needed.
| "serverless-offline": "^12.0.4" | |
| "serverless-offline": "^14.4.0" |
| ~/.npm | ||
| key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | ||
|
|
||
| - name: Install dependencies |
There was a problem hiding this comment.
The setup-node action is configured with registry-url "https://npm.pkg.github.com" and always-auth: true, but there's no NODE_AUTH_TOKEN environment variable set for authentication. If any of your dependencies are from GitHub Packages, npm ci will fail. Add the NODE_AUTH_TOKEN environment variable to the "Install dependencies" step, e.g., env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
| - name: Install dependencies | |
| - name: Install dependencies | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| dev: | ||
| <<: *DEFAULT | ||
| DOMAIN_NAME: search-dev.devicebits.com | ||
| NODE_ENV: development | ||
| LOG_LEVEL: debug |
There was a problem hiding this comment.
The serverless.env.yml now defines three environments (production, staging, dev) but the serverless.yml defaults to 'dev' stage. However, looking at the GitHub workflows: release-staging deploys with --stage staging, and release-production deploys with --stage production. This means the default 'dev' stage might never be used in CI/CD. Consider if this is intentional or if the workflows should be updated to match the available environments.
| scope: "@devicebits" | ||
| always-auth: true | ||
|
|
||
| - name: Cache npm cache |
There was a problem hiding this comment.
The cache step is named "Cache npm cache" which is redundant. Consider renaming to "Cache dependencies" or "Cache npm" for consistency with the other workflows which use "Cache multiple paths".
| - name: Cache npm cache | |
| - name: Cache npm |
| ~/.npm | ||
| key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | ||
|
|
||
| - name: Install dependencies |
There was a problem hiding this comment.
The setup-node action is configured with registry-url "https://npm.pkg.github.com" and always-auth: true, but there's no NODE_AUTH_TOKEN environment variable set for authentication. If any of your dependencies are from GitHub Packages, npm ci will fail. Add the NODE_AUTH_TOKEN environment variable to the "Install dependencies" step, e.g., env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
| - name: Install dependencies | |
| - name: Install dependencies | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci |
There was a problem hiding this comment.
The setup-node action is configured with registry-url "https://npm.pkg.github.com" and always-auth: true, but there's no NODE_AUTH_TOKEN environment variable set for authentication. If any of your dependencies are from GitHub Packages, npm ci will fail. Add the NODE_AUTH_TOKEN environment variable to the "Install dependencies" step, e.g., env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
| run: npm ci | |
| run: npm ci | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Added GitHub Actions workflows for deployment and environment management. Updated serverless configuration to support new deployment processes and environment variables.
Change Log: