Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improvements to deployments #615

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

Merged
justin808 merged 59 commits into master from justin808-testing-2025-01
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
ee08d3a
Pass correct arg
justin808 Jan 23, 2025
c790151
Set args with =
justin808 Jan 23, 2025
8355030
Address deprecation messages
justin808 Jan 23, 2025
f19d79f
Updates to deployment
justin808 Jan 23, 2025
e487791
updates
justin808 Jan 23, 2025
25e9502
Fixed the deployment_id output in the
justin808 Jan 23, 2025
de55983
fixes
justin808 Jan 23, 2025
5240c9b
fixes
justin808 Jan 23, 2025
2a1b9a3
fixes
justin808 Jan 23, 2025
8918cd2
fixes
justin808 Jan 23, 2025
fe262cb
fixes
justin808 Jan 23, 2025
80d841b
fixes
justin808 Jan 23, 2025
084f0d0
fixes
justin808 Jan 23, 2025
cac41c4
Fixed failure to deploy to review app
justin808 Jan 23, 2025
745ca0e
fixes
justin808 Jan 23, 2025
f77a610
fixes
justin808 Jan 23, 2025
87662fa
Updates, fix crash
justin808 Jan 24, 2025
4970fbe
fixes
justin808 Jan 24, 2025
e26cc72
fixes
justin808 Jan 24, 2025
29ade6f
Fixes
justin808 Jan 24, 2025
8db0511
fixes
justin808 Jan 24, 2025
b7a7229
fixes
justin808 Jan 24, 2025
1cff976
fixes
justin808 Jan 24, 2025
6cbdb04
fixes
justin808 Jan 24, 2025
0b15816
fixes
justin808 Jan 24, 2025
ae8a473
fixes
justin808 Jan 24, 2025
e6d5025
fixes
justin808 Jan 24, 2025
444ec85
fixes
justin808 Jan 24, 2025
8041a01
fixes
justin808 Jan 24, 2025
b03b6d7
fixes
justin808 Jan 24, 2025
a12e0d4
fixes
justin808 Jan 24, 2025
98649f2
fixes
justin808 Jan 24, 2025
b2e710a
fixes
justin808 Jan 24, 2025
c54a544
fixes
justin808 Jan 24, 2025
c80ff43
fixes
justin808 Jan 24, 2025
40473cc
fixes
justin808 Jan 25, 2025
038cf8f
fixes
justin808 Jan 25, 2025
c25211f
fixes
justin808 Jan 25, 2025
304e642
fixes
justin808 Jan 25, 2025
4744c76
fixes
justin808 Jan 25, 2025
5c8b3ab
fixes
justin808 Jan 26, 2025
2a51c92
fixes
justin808 Jan 26, 2025
61213b9
fixes
justin808 Jan 26, 2025
e431bdf
fixes
justin808 Jan 26, 2025
895986c
fixes
justin808 Jan 26, 2025
3fe506e
fixes
justin808 Jan 26, 2025
585c02d
fixes
justin808 Jan 26, 2025
c46f595
fixes
justin808 Jan 26, 2025
65c64d1
fixes
justin808 Jan 26, 2025
e96ac82
doc changes
justin808 Jan 26, 2025
2be9c2f
Changes made:
justin808 Jan 26, 2025
5f50639
fixes
justin808 Jan 26, 2025
e0cf883
fixes
justin808 Jan 26, 2025
b27783e
added promotion and other fixes
justin808 Jan 26, 2025
66a4114
fixes
justin808 Jan 26, 2025
3426aca
fix-for-delete
justin808 Jan 26, 2025
92ad3a7
fix-for-delete
justin808 Jan 26, 2025
7d75738
fix-for-delete
justin808 Jan 26, 2025
d5b8b7f
fix-for-delete
justin808 Jan 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix-for-delete
  • Loading branch information
justin808 committed Jan 26, 2025
commit 92ad3a7e115a9ef3b5a1d1f0947db41bb4e7409f
35 changes: 33 additions & 2 deletions .github/workflows/delete-review-app.yml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Debug Trigger Conditions
env:
EVENT_NAME: ${{ github.event_name }}
IS_PR: ${{ github.event.issue.pull_request != '' }}
COMMENT: ${{ github.event.comment.body }}
PR_NUMBER: ${{ github.event.issue.number }}
run: |
echo "Debug information for delete-review-app command:"
echo "Event name: $EVENT_NAME"
echo "Is PR: $IS_PR"
echo "Comment body: $COMMENT"
echo "PR number: $PR_NUMBER"
echo "Raw event payload:"
echo '${{ toJSON(github.event) }}'

Copy link

@coderabbitai coderabbitai bot Jan 26, 2025

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Limit debug information exposure.

Similar to the help command workflow, consider limiting the exposure of sensitive information in debug logs.

 run: |
 echo "Debug information for delete-review-app command:"
 echo "Event name: $EVENT_NAME"
 echo "Is PR: $IS_PR"
 echo "Comment body: $COMMENT"
 echo "PR number: $PR_NUMBER"
- echo "Raw event payload:"
- echo '${{ toJSON(github.event) }}'
+ # Log only necessary fields
+ echo "Event type: ${{ github.event.type }}"
+ echo "Repository: ${{ github.repository }}"
📝 Committable suggestion

!!️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Debug Trigger Conditions
env:
EVENT_NAME: ${{ github.event_name }}
IS_PR: ${{ github.event.issue.pull_request != '' }}
COMMENT: ${{ github.event.comment.body }}
PR_NUMBER: ${{ github.event.issue.number }}
run: |
echo "Debug information for delete-review-app command:"
echo "Event name: $EVENT_NAME"
echo "Is PR: $IS_PR"
echo "Comment body: $COMMENT"
echo "PR number: $PR_NUMBER"
echo "Raw event payload:"
echo '${{ toJSON(github.event) }}'
- name: Debug Trigger Conditions
env:
EVENT_NAME: ${{ github.event_name }}
IS_PR: ${{ github.event.issue.pull_request != '' }}
COMMENT: ${{ github.event.comment.body }}
PR_NUMBER: ${{ github.event.issue.number }}
run: |
echo "Debug information for delete-review-app command:"
echo "Event name: $EVENT_NAME"
echo "Is PR: $IS_PR"
echo "Comment body: $COMMENT"
echo "PR number: $PR_NUMBER"
# Log only necessary fields
echo "Event type: ${{ github.event.type }}"
echo "Repository: ${{ github.repository }}"

- name: Get PR number
id: pr
uses: actions/github-script@v7
Expand All @@ -37,6 +52,20 @@ jobs:

- uses: actions/checkout@v4

- name: Validate Required Secrets
run: |
missing_secrets=()
for secret in "CPLN_TOKEN_STAGING" "CPLN_ORG_STAGING"; do
if [ -z "${!secret}" ]; then
missing_secrets+=("$secret")
fi
done

if [ ${#missing_secrets[@]} -ne 0 ]; then
echo "❌ Required secrets are not set: ${missing_secrets[*]}"
exit 1
fi

- name: Setup Environment
uses: ./.github/actions/setup-environment

Expand All @@ -55,9 +84,11 @@ jobs:

- name: Delete Review App
uses: ./.github/actions/delete-control-plane-app
with:
app_name: ${{ env.APP_NAME }}
org: ${{ env.CPLN_ORG }}
github_token: ${{ secrets.GITHUB_TOKEN }}
env:
APP_NAME: ${{ env.APP_NAME }}
CPLN_ORG: ${{ secrets.CPLN_ORG }}
CPLN_TOKEN: ${{ secrets.CPLN_TOKEN }}

- name: Update Delete Status
Expand Down
50 changes: 46 additions & 4 deletions .github/workflows/deploy-to-control-plane.yml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,42 @@ jobs:
fetch-depth: 0
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || steps.getRef.outputs.PR_REF || github.ref }}

- name: Validate Required Secrets
run: |
missing_secrets=()
for secret in "CPLN_TOKEN_STAGING" "CPLN_ORG_STAGING"; do
if [ -z "${!secret}" ]; then
missing_secrets+=("$secret")
fi
done

if [ ${#missing_secrets[@]} -ne 0 ]; then
echo "❌ Required secrets are not set: ${missing_secrets[*]}"
exit 1
fi

- name: Setup Environment
uses: ./.github/actions/setup-environment

- name: Set shared functions
id: shared-functions
uses: actions/github-script@v7
with:
script: |
core.exportVariable('GET_CONSOLE_LINK', `
function getConsoleLink(prNumber) {
return '🎮 [Control Plane Console for Review App with PR #' + prNumber + '](' +
'https://console.cpln.io/org/' + process.env.CPLN_ORG + '/workloads/' + process.env.APP_NAME + ')';
}
`);

- name: Initialize Deployment
id: init-deployment
uses: actions/github-script@v7
with:
script: |
eval(process.env.GET_CONSOLE_LINK);

async function getWorkflowUrl(runId) {
// Get the current job ID
const jobs = await github.rest.actions.listJobsForWorkflowRun({
Expand Down Expand Up @@ -117,10 +145,14 @@ jobs:
uses: actions/github-script@v7
with:
script: |
eval(process.env.GET_CONSOLE_LINK);

const buildingMessage = [
'🏗️ Building Docker image for PR #' + process.env.PR_NUMBER + ', commit ' + '${{ env.COMMIT_HASH }}',
'',
'[View Build Logs](' + process.env.WORKFLOW_URL + ')'
'📋 [View Build Logs](' + process.env.WORKFLOW_URL + ')',
'',
getConsoleLink(process.env.PR_NUMBER)
].join('\n');

await github.rest.issues.updateComment({
Expand All @@ -142,12 +174,16 @@ jobs:
uses: actions/github-script@v7
with:
script: |
eval(process.env.GET_CONSOLE_LINK);

const deployingMessage = [
'🚀 Deploying to Control Plane...',
'',
'⏳ Waiting for deployment to be ready...',
'',
'[View Deploy Logs](' + process.env.WORKFLOW_URL + ')'
'📋 [View Deploy Logs](' + process.env.WORKFLOW_URL + ')',
'',
getConsoleLink(process.env.PR_NUMBER)
].join('\n');

await github.rest.issues.updateComment({
Expand All @@ -168,6 +204,8 @@ jobs:
uses: actions/github-script@v7
with:
script: |
eval(process.env.GET_CONSOLE_LINK);

const prNumber = process.env.PR_NUMBER;
const appUrl = process.env.REVIEW_APP_URL;
const workflowUrl = process.env.WORKFLOW_URL;
Expand All @@ -192,13 +230,17 @@ jobs:
'',
'🚀 [Review App for PR #' + prNumber + '](' + appUrl + ')',
'',
'📋 [View Completed Action Build and Deploy Logs](' + workflowUrl + ')'
'📋 [View Completed Action Build and Deploy Logs](' + workflowUrl + ')',
'',
getConsoleLink(prNumber)
].join('\n');

const failureMessage = [
'❌ Deployment failed for PR #' + prNumber + ', commit ' + '${{ env.COMMIT_HASH }}',
'',
'📋 [View Deployment Logs with Errors](' + workflowUrl + ')'
'📋 [View Deployment Logs with Errors](' + workflowUrl + ')',
'',
getConsoleLink(prNumber)
].join('\n');

// Update the existing comment
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/help-command.yml
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Debug Trigger Conditions
env:
EVENT_NAME: ${{ github.event_name }}
IS_PR: ${{ github.event.issue.pull_request != '' }}
COMMENT: ${{ github.event.comment.body }}
run: |
echo "Debug information for help command:"
echo "Event name: $EVENT_NAME"
echo "Is PR: $IS_PR"
echo "Comment body: $COMMENT"
echo "Raw event payload:"
echo '${{ toJSON(github.event) }}'

- name: Show Available Commands
uses: actions/github-script@v7
with:
Expand Down
Loading

AltStyle によって変換されたページ (->オリジナル) /