Skip to content

[LSP-1272] feat: add workflows for deployment and environment management, update…#7

Merged
Bekhzod96 merged 40 commits intomainfrom
LSP-1272
Mar 2, 2026
Merged

[LSP-1272] feat: add workflows for deployment and environment management, update…#7
Bekhzod96 merged 40 commits intomainfrom
LSP-1272

Conversation

@michael-puzon-resultscx
Copy link
Copy Markdown
Contributor

Added GitHub Actions workflows for deployment and environment management. Updated serverless configuration to support new deployment processes and environment variables.

Change Log:

  • Added workflow files for CI/CD deployment and environment management.
  • Updated [serverless.yml] and [serverless.env.yml for improved deployment configuration.
  • Integrated environment variable handling for dev, staging, and production.

Copilot AI review requested due to automatic review settings February 11, 2026 08:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml to add provider settings (stage, VPC, deployment bucket) and custom domain configuration.
  • Refactors serverless.env.yml into explicit production/staging/dev blocks and adds deploy scripts to package.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.

Copy link
Copy Markdown
Contributor

@Bekhzod96 Bekhzod96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good !

Copilot AI review requested due to automatic review settings February 11, 2026 14:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot AI review requested due to automatic review settings February 11, 2026 15:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • apiType is set to rest, but all function events are configured as httpApi (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 to http (REST API) or setting apiType to 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.

Copilot AI review requested due to automatic review settings February 11, 2026 15:46
Copilot AI review requested due to automatic review settings February 27, 2026 07:58
@devicebits devicebits deleted a comment from Copilot AI Feb 27, 2026
@devicebits devicebits deleted a comment from Copilot AI Feb 27, 2026
@devicebits devicebits deleted a comment from Copilot AI Feb 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.customDomain is configured, but the serverless-domain-manager plugin has been removed from plugins, so these settings will be ignored and custom domain automation won’t run. Either re-add the plugin or remove the customDomain block to avoid a broken/unused deployment configuration.
plugins:
  - serverless-offline


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 27, 2026 08:05
@devicebits devicebits deleted a comment from Copilot AI Feb 27, 2026
@devicebits devicebits deleted a comment from Copilot AI Feb 27, 2026
@devicebits devicebits deleted a comment from Copilot AI Feb 27, 2026
@devicebits devicebits deleted a comment from Copilot AI Feb 27, 2026
@devicebits devicebits deleted a comment from Copilot AI Feb 27, 2026
@devicebits devicebits deleted a comment from Copilot AI Feb 27, 2026
@devicebits devicebits deleted a comment from Copilot AI Feb 27, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
autoDomain: true

Copilot uses AI. Check for mistakes.
Comment on lines 24 to +31
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
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +18
securityGroupIds: ${ssm:/vpc/securityGroupIds}
subnetIds: ${ssm:/vpc/subnetIds}
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
securityGroupIds: ${ssm:/vpc/securityGroupIds}
subnetIds: ${ssm:/vpc/subnetIds}
securityGroupIds: ${ssm:/${sls:stage}/vpc/securityGroupIds}
subnetIds: ${ssm:/${sls:stage}/vpc/subnetIds}

Copilot uses AI. Check for mistakes.
dev: search-staging.devicebits.com
prod: search.devicebits.com
endpointType: "regional"
apiType: "rest"
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Suggested change
apiType: "rest"
apiType: "HTTP"

Copilot uses AI. Check for mistakes.
"devDependencies": {
"serverless-domain-manager": "^8.0.0",
"serverless-offline": "^14.4.0"
"serverless-offline": "^12.0.4"
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
"serverless-offline": "^12.0.4"
"serverless-offline": "^14.4.0"

Copilot uses AI. Check for mistakes.
~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}

Suggested change
- name: Install dependencies
- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Copilot uses AI. Check for mistakes.
Comment on lines +22 to +26
dev:
<<: *DEFAULT
DOMAIN_NAME: search-dev.devicebits.com
NODE_ENV: development
LOG_LEVEL: debug
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
scope: "@devicebits"
always-auth: true

- name: Cache npm cache
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Suggested change
- name: Cache npm cache
- name: Cache npm

Copilot uses AI. Check for mistakes.
~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}

Suggested change
- name: Install dependencies
- name: Install dependencies
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Copilot uses AI. Check for mistakes.
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}

- name: Install dependencies
run: npm ci
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 }}

Suggested change
run: npm ci
run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Copilot uses AI. Check for mistakes.
@Bekhzod96 Bekhzod96 merged commit 44a4811 into main Mar 2, 2026
1 check passed
Copy link
Copy Markdown

@dk-victory-resultscx dk-victory-resultscx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants