-
Notifications
You must be signed in to change notification settings - Fork 593
add cicd testing #4569
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
base: master
Are you sure you want to change the base?
add cicd testing #4569
Conversation
| with: | ||
| service: ${{ env.CLOUD_RUN_SERVICE }} | ||
| region: ${{ env.CLOUD_RUN_REGION }} | ||
| image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPO }}/nango:${{ github.event.inputs.image_tag || github.sha }} |
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.
[CriticalError]
There's an inconsistency in image tag usage between jobs. In the build-and-push job, you compute and use a specific tag (${GITHUB_SHA::12} or manual input), but in the deploy job, you use github.sha directly instead of the computed tag from the previous job.
| image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPO }}/nango:${{ github.event.inputs.image_tag || github.sha }} | |
| image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPO }}/nango:${{ github.event.inputs.image_tag || format('{0}', github.sha) }} |
This should be:
| image: ${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.GCP_PROJECT_ID }}/${{ env.GAR_REPO }}/nango:${{ github.event.inputs.image_tag || github.sha }} | |
| image: ${{ needs.build-and-push.outputs.image }} |
You'll also need to add an output to the build-and-push job:
outputs:
image: ${{ steps.vars.outputs.image }}⚡ Committable suggestion
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| env: | ||
| GAR_LOCATION: ${{ vars.GAR_LOCATION }} | ||
| GAR_REPO: ${{ vars.GAR_REPO }} | ||
| CLOUD_RUN_REGION: ${{ vars.CLOUD_RUN_REGION }}# e.g. asia-southeast2 |
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.
[NitPick]
Missing space in the comment formatting. This will cause the comment to appear concatenated with the environment variable value.
| CLOUD_RUN_REGION: ${{ vars.CLOUD_RUN_REGION }}# e.g. asia-southeast2 | |
| CLOUD_RUN_REGION: ${{ vars.CLOUD_RUN_REGION }} # e.g. asia-southeast2 |
⚡ Committable suggestion
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
|
sorry i got a wrong commit
Pada Jum, 29 Agu 2025 pukul 18.22 propel-code-bot[bot] <
***@***.***> menulis:
… ***@***.***[bot]* commented on this pull request.
------------------------------
In .github/workflows/new-deployment.yaml
<#4569 (comment)>:
> + type: choice
+ options: [staging, production]
+ required: true
+ default: staging
+ image_tag:
+ description: "Image tag (default uses commit SHA)"
+ required: false
+
+permissions:
+ contents: read
+ id-token: write
+
+env:
+ GAR_LOCATION: ${{ vars.GAR_LOCATION }}
+ GAR_REPO: ${{ vars.GAR_REPO }}
+ CLOUD_RUN_REGION: ${{ vars.CLOUD_RUN_REGION }}# e.g. asia-southeast2
[*NitPick*]
Missing space in the comment formatting. This will cause the comment to
appear concatenated with the environment variable value.
⬇️ Suggested change
- CLOUD_RUN_REGION: ${{ vars.CLOUD_RUN_REGION }}# e.g. asia-southeast2
+ CLOUD_RUN_REGION: ${{ vars.CLOUD_RUN_REGION }} # e.g. asia-southeast2
⚡ *Committable suggestion*
Carefully review the code before committing. Ensure that it accurately
replaces the highlighted code, contains no missing lines, and has no issues
with indentation.
—
Reply to this email directly, view it on GitHub
<#4569 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF2K6UMT6E46TRMUBUWVSM33QAZZFAVCNFSM6AAAAACFEIFIPGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTCNRYGM4DGNZUGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
This PR is stale because it has been open for 30 days with no activity. |
| GCP_PROJECT_ID: ${{ vars.GCP_PROJECT_ID }} | ||
|
|
||
| jobs: | ||
| build-and-push: |
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.
[CriticalError]
Deploy job cannot access the computed image from build job. The IMAGE environment variable is set in the build job but not passed to the deploy job, yet the deploy job tries to reference the computed image tag. This will cause the deploy job to use a potentially different image reference than what was actually built.
Add job outputs to pass the image reference:
Suggested Change
| build-and-push: | |
| build-and-push: | |
| name: Build & Push Image to Artifact Registry | |
| runs-on: ubuntu-latest | |
| outputs: | |
| image: ${{ steps.vars.outputs.image }} |
Then update the deploy job to use: image: ${{ needs.build-and-push.outputs.image }}
⚡ Committable suggestion
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
Context for Agents
[**CriticalError**]
Deploy job cannot access the computed image from build job. The `IMAGE` environment variable is set in the build job but not passed to the deploy job, yet the deploy job tries to reference the computed image tag. This will cause the deploy job to use a potentially different image reference than what was actually built.
Add job outputs to pass the image reference:
<details>
<summary>Suggested Change</summary>
```suggestion
build-and-push:
name: Build & Push Image to Artifact Registry
runs-on: ubuntu-latest
outputs:
image: ${{ steps.vars.outputs.image }}
```
Then update the deploy job to use: `image: ${{ needs.build-and-push.outputs.image }}`
⚡ **Committable suggestion**
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
</details>
File: .github/workflows/new-deployment.yaml
Line: 28| docker run -d --name nango-server \ | ||
| --restart=always \ | ||
| --env-file .env \ | ||
| --network $(basename "$(pwd)")_nango \ | ||
| -p ${SERVER_PORT:-3003}:${SERVER_PORT:-3003} \ |
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.
[CriticalError]
Deployment rollback logic has a critical flaw: the manual docker run command uses environment variables (${SERVER_PORT:-3003}, ${CONNECT_UI_PORT:-3009}) that are not available in the SSH session context. These variables are likely defined in the .env file but won't be expanded in the shell command.
This could cause the rollback container to fail to start or bind to wrong ports. The --env-file .env only passes environment variables to the container, not to the shell executing the command.
Suggested Change
| docker run -d --name nango-server \ | |
| --restart=always \ | |
| --env-file .env \ | |
| --network $(basename "$(pwd)")_nango \ | |
| -p ${SERVER_PORT:-3003}:${SERVER_PORT:-3003} \ | |
| docker run -d --name nango-server \ | |
| --restart=always \ | |
| --env-file .env \ | |
| --network $(basename "$(pwd)")_nango \ | |
| -p 3003:3003 \ | |
| -p 3009:3009 \ | |
| -v "$(pwd)/packages/providers/providers.yaml:/app/nango/packages/providers/providers.yaml" \ | |
| "$PREV_IMAGE" |
Or source the .env file first:
source .env
docker run -d --name nango-server \
--restart=always \
--env-file .env \
--network $(basename "$(pwd)")_nango \
-p ${SERVER_PORT:-3003}:${SERVER_PORT:-3003} \
-p ${CONNECT_UI_PORT:-3009}:${CONNECT_UI_PORT:-3009} \
-v "$(pwd)/packages/providers/providers.yaml:/app/nango/packages/providers/providers.yaml" \
"$PREV_IMAGE"⚡ Committable suggestion
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
Context for Agents
[**CriticalError**]
Deployment rollback logic has a critical flaw: the manual `docker run` command uses environment variables (`${SERVER_PORT:-3003}`, `${CONNECT_UI_PORT:-3009}`) that are not available in the SSH session context. These variables are likely defined in the `.env` file but won't be expanded in the shell command.
This could cause the rollback container to fail to start or bind to wrong ports. The `--env-file .env` only passes environment variables to the container, not to the shell executing the command.
<details>
<summary>Suggested Change</summary>
```suggestion
docker run -d --name nango-server \
--restart=always \
--env-file .env \
--network $(basename "$(pwd)")_nango \
-p 3003:3003 \
-p 3009:3009 \
-v "$(pwd)/packages/providers/providers.yaml:/app/nango/packages/providers/providers.yaml" \
"$PREV_IMAGE"
```
Or source the .env file first:
```bash
source .env
docker run -d --name nango-server \
--restart=always \
--env-file .env \
--network $(basename "$(pwd)")_nango \
-p ${SERVER_PORT:-3003}:${SERVER_PORT:-3003} \
-p ${CONNECT_UI_PORT:-3009}:${CONNECT_UI_PORT:-3009} \
-v "$(pwd)/packages/providers/providers.yaml:/app/nango/packages/providers/providers.yaml" \
"$PREV_IMAGE"
```
⚡ **Committable suggestion**
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
</details>
File: docker-compose.yaml
Line: 117|
This PR is stale because it has been open for 30 days with no activity. |
| - name: Set artifact outputs | ||
| run: | | ||
| echo "IMAGE=${{ steps.vars.outputs.image }}" >> $GITHUB_ENV | ||
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.
[CriticalError]
Resource leak: The IMAGE environment variable is set but never used, and the build-and-push job doesn't expose outputs for the deploy job to consume the built image information. This breaks the connection between build and deploy phases.
Issues:
$GITHUB_ENVis job-scoped, so the deploy job can't access this IMAGE value- No job outputs defined to pass the built image to the deploy job
- Deploy job reconstructs image name instead of using the built image
Fix: Add job outputs to make the built image available to the deploy job:
Suggested Change
| - name: Set artifact outputs | |
| run: | | |
| echo "IMAGE=${{ steps.vars.outputs.image }}" >> $GITHUB_ENV | |
| - name: Set artifact outputs | |
| run: | | |
| echo "IMAGE=${{ steps.vars.outputs.image }}" >> $GITHUB_ENV | |
| outputs: | |
| image: ${{ steps.vars.outputs.image }} | |
| tag: ${{ steps.vars.outputs.tag }} |
⚡ Committable suggestion
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
Context for Agents
[**CriticalError**]
Resource leak: The IMAGE environment variable is set but never used, and the build-and-push job doesn't expose outputs for the deploy job to consume the built image information. This breaks the connection between build and deploy phases.
**Issues**:
1. `$GITHUB_ENV` is job-scoped, so the deploy job can't access this IMAGE value
2. No job outputs defined to pass the built image to the deploy job
3. Deploy job reconstructs image name instead of using the built image
**Fix**: Add job outputs to make the built image available to the deploy job:
<details>
<summary>Suggested Change</summary>
```suggestion
- name: Set artifact outputs
run: |
echo "IMAGE=${{ steps.vars.outputs.image }}" >> $GITHUB_ENV
outputs:
image: ${{ steps.vars.outputs.image }}
tag: ${{ steps.vars.outputs.tag }}
```
⚡ **Committable suggestion**
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
</details>
File: .github/workflows/new-deployment.yaml
Line: 70| paths: | ||
| - "docker-compose.yaml" | ||
| - "packages/providers/providers.yaml" | ||
| - ".github/workflows/deploy-gcp-compose.yml" |
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.
[CriticalError]
Deployment workflow error: The workflow references a non-existent file path in the trigger. The path .github/workflows/deploy-gcp-compose.yml doesn't match the actual filename of the current workflow being created.
Issue: This workflow is named new-deployment.yaml but references deploy-gcp-compose.yml in the push trigger paths, which will never trigger this workflow.
Fix: Update to match the correct filename:
| - ".github/workflows/deploy-gcp-compose.yml" | |
| - ".github/workflows/new-deployment.yaml" |
⚡ Committable suggestion
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
Context for Agents
[**CriticalError**]
Deployment workflow error: The workflow references a non-existent file path in the trigger. The path `.github/workflows/deploy-gcp-compose.yml` doesn't match the actual filename of the current workflow being created.
**Issue**: This workflow is named `new-deployment.yaml` but references `deploy-gcp-compose.yml` in the push trigger paths, which will never trigger this workflow.
**Fix**: Update to match the correct filename:
```suggestion
- ".github/workflows/new-deployment.yaml"
```
⚡ **Committable suggestion**
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
File: docker-compose.yaml
Line: 9
Add CICD file
Introduce CI/CD Workflows for GCP VM (Docker Compose) and Cloud Run Deployment
This pull request replaces and expands the deployment automation for the project, introducing two comprehensive GitHub Actions workflows: one for deploying via Docker Compose to a GCP VM ('Deploy to GCP VM (Docker Compose)'), and another for building and deploying to GCP Cloud Run ('Deploy Self-Hosted to GCP (Cloud Run)'). The changes remove the existing multi-service Docker Compose file and shift all deployment orchestration to workflow YAML files under the .github/workflows directory. Both workflows provide build, sync, deploy, health-check, and rollback capabilities, using environment variables and deployment secrets.
Key Changes
• Entire removal of the previous docker-compose.yaml file which contained service definitions for local and
VMcontainer deployment.• Addition of a new
GitHubActions workflow for Docker Compose-based deployment to aGCPVM, including steps for file synchronization, environment validation, starting services, external healthchecking, and rollback logic.• Introduction of another workflow for
GCPCloud Run, supporting manual trigger, environment selection (staging/production), image tagging, build/upload to Artifact Registry, and infrastructure-side healthchecking.• Centralization of deployment logic into
CI/CDpipelines, enabling repeatable, auditable deploy processes and reducing reliance on local/developer-side scripts.• Adoption of secrets, workflow parameters, and artifact outputs for secure, robust automation and flexibility for future extension.
Affected Areas
• docker-compose.yaml (removed and replaced)
• .github/workflows/new-deployment.yaml (added)
• Overall
CI/CD/deployment pipeline• Deployment and release operations for both
GCPVMandGCPCloud RunThis summary was automatically generated by @propel-code-bot