Skip to content
Merged

Test #21

Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ Respond to feedback and update your PR as needed. The workflows will re-run auto
## Troubleshooting Common Issues

### "PR targets main branch"
❌ **Problem:** You opened a PR to `main` instead of `test`
❌ **Problem:** You opened a PR to `main` instead of `develop`

✅ **Solution:**
1. Close this PR
2. Create a new PR to the `test` branch
3. Follow the workflow for releases from `test` → `main`
2. Create a new PR to the `develop` branch
3. Follow the workflow for releases from `develop` → `main`

### "Commit message doesn't match format"
❌ **Problem:** Commit message like `"fixed bug"` or `"Update stuff"`
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '🔒 **Security Audit:** Dependencies have been checked for known vulnerabilities. Address any critical or high-severity issues before merge. See [SECURITY.md](../SECURITY.md) for guidelines.'
body: `🔒 **Security Audit:** Dependencies have been checked for known vulnerabilities. Address any critical or high-severity issues before merge. See [SECURITY.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/.github/SECURITY.md) for guidelines.`
});

build-check:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/issue-assignment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🚫 **Unauthorized Assignment Attempt**\n\n@${commenter}, only maintainers can use the \`/assign\` command.\n\n**To get assigned to an issue:**\n1. Comment expressing interest: "I'd like to work on this issue"\n2. Wait for a maintainer to review your request\n3. Maintainer will use \`/assign @username\` to officially assign it\n\n**Authorized to assign issues:**\n- Repository owner (@${repoOwner})\n- Maintainers: ${AUTHORIZED_ASSIGNERS.map(m => '@' + m).join(', ')}\n\nSee [CONTRIBUTING.md](../../Docs/CONTRIBUTING.md#step-2-request-assignment) for details.`
body: `🚫 **Unauthorized Assignment Attempt**\n\n@${commenter}, only maintainers can use the \`/assign\` command.\n\n**To get assigned to an issue:**\n1. Comment expressing interest: "I'd like to work on this issue"\n2. Wait for a maintainer to review your request\n3. Maintainer will use \`/assign @username\` to officially assign it\n\n**Authorized to assign issues:**\n- Repository owner (@${repoOwner})\n- Maintainers: ${AUTHORIZED_ASSIGNERS.map(m => '@' + m).join(', ')}\n\nSee [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/Docs/CONTRIBUTING.md#step-2-request-assignment) for details.`
});
return;
}
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `✅ Issue assigned to @${assignee}. Please follow the [CONTRIBUTING.md](../../Docs/CONTRIBUTING.md) guidelines.`
body: `✅ Issue assigned to @${assignee}. Please follow the [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/Docs/CONTRIBUTING.md) guidelines.`
});
} catch (error) {
github.rest.issues.createComment({
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
issue_number: issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🚫 **Unauthorized assignment detected and removed!**\n\n**This issue cannot be assigned without authorization.**\n\nIssues can only be assigned by:\n- Repository owner (@${repoOwner})\n- Maintainers: ${AUTHORIZED_ASSIGNERS.map(m => '@' + m).join(', ')}\n\n**To request assignment:**\nAsk a maintainer to use: \`/assign @username\`\n\n**Why this rule exists:**\nThis ensures proper tracking and prevents unauthorized assignments. See [CONTRIBUTING.md](../../Docs/CONTRIBUTING.md) for details.`
body: `🚫 **Unauthorized assignment detected and removed!**\n\n**This issue cannot be assigned without authorization.**\n\nIssues can only be assigned by:\n- Repository owner (@${repoOwner})\n- Maintainers: ${AUTHORIZED_ASSIGNERS.map(m => '@' + m).join(', ')}\n\n**To request assignment:**\nAsk a maintainer to use: \`/assign @username\`\n\n**Why this rule exists:**\nThis ensures proper tracking and prevents unauthorized assignments. See [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/Docs/CONTRIBUTING.md) for details.`
});

console.log(`Removed unauthorized assignment for issue #${issue.number}`);
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,6 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
title: '🔒 Security: Dependency Vulnerabilities Detected',
body: '⚠️ **Automated Security Alert**\n\nDependency vulnerabilities have been detected in the latest scan.\n\n**Action Required:**\n1. Run `npm audit` to see details\n2. Run `npm audit fix` for automatic fixes\n3. Review high/critical vulnerabilities\n4. Create PR to fix issues\n\nSee [SECURITY.md](../SECURITY.md) for guidelines.',
body: `⚠️ **Automated Security Alert**\n\nDependency vulnerabilities have been detected in the latest scan.\n\n**Action Required:**\n1. Run \`npm audit\` to see details\n2. Run \`npm audit fix\` for automatic fixes\n3. Review high/critical vulnerabilities\n4. Create PR to fix issues\n\nSee [SECURITY.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/.github/SECURITY.md) for guidelines.`,
labels: ['security', 'priority-high']
});
4 changes: 2 additions & 2 deletions .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

comment += '\n**Valid Types:** feat, fix, docs, style, refactor, perf, test, chore\n';
comment += '**Example:** `feat(issue-45): add new authentication endpoint`\n';
comment += '\nPlease see [CONTRIBUTING.md](../../CONTRIBUTING.md#commit-guidelines) for detailed guidelines.';
comment += `\nPlease see [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/Docs/CONTRIBUTING.md#commit-guidelines) for detailed guidelines.`;

github.rest.issues.createComment({
issue_number: context.issue.number,
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
issue_number: pr.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🚫 **Branch Protection:** This PR targets \`main\`. All changes must go through the \`test\` branch first.\n\n**Action Required:**\n1. Close this PR\n2. Create a new PR targeting the \`test\` branch\n3. Once merged to \`test\`, create a release PR from \`test\` to \`main\`\n\n**Note:** Only authorized admins can create PRs to \`main\`.\n\nSee [CONTRIBUTING.md](../../Docs/CONTRIBUTING.md) for details.`
body: `🚫 **Branch Protection:** This PR targets \`main\`. All changes must go through the \`test\` branch first.\n\n**Action Required:**\n1. Close this PR\n2. Create a new PR targeting the \`test\` branch\n3. Once merged to \`test\`, create a release PR from \`test\` to \`main\`\n\n**Note:** Only authorized admins can create PRs to \`main\`.\n\nSee [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/Docs/CONTRIBUTING.md) for details.`
});
}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/protect-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
issue_number: pr.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🚫 **Branch Protection:** This PR targets \`main\`. All changes must go through the \`test\` branch first.\n\n**Action Required:**\n1. Close this PR\n2. Create a new PR targeting the \`test\` branch\n3. Once merged to \`test\`, create a release PR from \`test\` to \`main\`\n\n**Note:** Only authorized admins can create PRs directly to \`main\`.\n\nSee [CONTRIBUTING.md](../../Docs/CONTRIBUTING.md) for details.`
body: `🚫 **Branch Protection:** This PR targets \`main\`. All changes must go through the \`test\` branch first.\n\n**Action Required:**\n1. Close this PR\n2. Create a new PR targeting the \`test\` branch\n3. Once merged to \`test\`, create a release PR from \`test\` to \`main\`\n\n**Note:** Only authorized admins can create PRs directly to \`main\`.\n\nSee [CONTRIBUTING.md](https://github.com/${context.repo.owner}/${context.repo.repo}/blob/main/Docs/CONTRIBUTING.md) for details.`
});
core.setFailed('Unauthorized PR to main branch');
process.exit(1);
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ node_modules/
.env
*.env
**/*.env
*.local
**/*.local

# Build Outputs
dist/
Expand Down Expand Up @@ -51,6 +49,8 @@ api-gateway/src/postgres.env
WORKERS/build-worker/.env
WORKERS/clone-worker/.env

packages/domain/.env

# Temp / Runtime folders
clones/
**/clones/
Expand Down
8 changes: 4 additions & 4 deletions BUILDER_IMAGES/build-image-backend/publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const sns = new SNSClient({

const TOPIC_ARN = process.env.DOMAIN_EVENTS_TOPIC_ARN;

async function publilishEvent(type, projectId, deploymentId, payload) {
async function publishEvent(type, projectId, deploymentId, payload) {
await sns.send(
new PublishCommand({
TopicArn: TOPIC_ARN,
Expand All @@ -27,9 +27,9 @@ async function publilishEvent(type, projectId, deploymentId, payload) {
);
}

module.exports = { publilishEvent };
module.exports = { publishEvent };


console.log("publilishEvent type:", typeof publilishEvent);
console.log("publishEvent type:", typeof publishEvent);

module.exports = { publilishEvent };
module.exports = { publishEvent };
8 changes: 4 additions & 4 deletions BUILDER_IMAGES/build-image-backend/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { spawn } = require("child_process")
const path = require("path");
const fs = require("fs")
const { Kafka } = require("kafkajs");
const { publilishEvent } = require("./publisher");
const { publishEvent } = require("./publisher");

const PROJECT_ID = process.env.PROJECT_ID;
const ECR_URI = process.env.ECR_URI;
Expand Down Expand Up @@ -85,7 +85,7 @@ async function init() {
throw new Error(`Build context path does not exist: ${buildContext}`);
}

publilishEvent("BACKEND_PROCESSING", PROJECT_ID, DEPLOYMENTID, { backendDir: BACKEND_DIR })
publishEvent("BACKEND_PROCESSING", PROJECT_ID, DEPLOYMENTID, { backendDir: BACKEND_DIR })


if (!NODE_VERSION) {
Expand Down Expand Up @@ -154,7 +154,7 @@ async function init() {
"BUILD",
`Image build failed with code: ${code}`
);
publilishEvent("BACKEND_BUILD_FAILED", PROJECT_ID, DEPLOYMENTID, { msg: "Image build failed with code: ${code}" })
publishEvent("BACKEND_BUILD_FAILED", PROJECT_ID, DEPLOYMENTID, { msg: "Image build failed with code: ${code}" })
await safeExit(code, "Build failed");
}
});
Expand All @@ -163,7 +163,7 @@ async function init() {
init().catch(err => {
console.log("INIT ERROR ", err);
publishLog("FAILURE", "INIT", err.message)
publilishEvent("BACKEND_BUILD_FAILED", PROJECT_ID, DEPLOYMENTID, { msg: err.message })
publishEvent("BACKEND_BUILD_FAILED", PROJECT_ID, DEPLOYMENTID, { msg: err.message })
.finally(() => safeExit(1, "Build Init Failed"));
});;

Expand Down
4 changes: 2 additions & 2 deletions BUILDER_IMAGES/builder-image-frontend/publisher.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const sns = new SNSClient({

const TOPIC_ARN = process.env.DOMAIN_EVENTS_TOPIC_ARN;

async function publilishEvent(type, projectId, deploymentId, payload) {
async function publishEvent(type, projectId, deploymentId, payload) {
await sns.send(
new PublishCommand({
TopicArn: TOPIC_ARN,
Expand All @@ -23,4 +23,4 @@ async function publilishEvent(type, projectId, deploymentId, payload) {
)
}

module.exports = { publilishEvent };
module.exports = { publishEvent };
16 changes: 8 additions & 8 deletions BUILDER_IMAGES/builder-image-frontend/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const mime = require("mime-types");
const readDirRecursive = require("./utils/readDirRecursive");
const { S3Client, PutObjectCommand } = require("@aws-sdk/client-s3");
const { Kafka } = require("kafkajs");
const { publilishEvent } = require("./publisher");
const { publishEvent } = require("./publisher");

/* ---------------- ENV ---------------- */

Expand Down Expand Up @@ -104,7 +104,7 @@ process.on("SIGTERM", () => safeExit(143, "SIGTERM"));
async function init() {
await producer.connect();

await publilishEvent(
await publishEvent(
"FRONTEND_PROCESSING",
PROJECT_ID,
DEPLOYMENTID,
Expand All @@ -117,7 +117,7 @@ async function init() {
const frontendPath = path.join(outputDir, FRONTENDPATH || ".");

if (!fs.existsSync(frontendPath)) {
await publilishEvent(
await publishEvent(
"FRONTEND_BUILT_FAILED",
PROJECT_ID,
DEPLOYMENTID,
Expand All @@ -138,7 +138,7 @@ async function init() {

build.on("close", async (code) => {
if (code !== 0) {
await publilishEvent(
await publishEvent(
"FRONTEND_BUILT_FAILED",
PROJECT_ID,
DEPLOYMENTID,
Expand Down Expand Up @@ -168,7 +168,7 @@ async function init() {
}));
}

await publilishEvent(
await publishEvent(
"FRONTEND_BUILT_SUCCESS",
PROJECT_ID,
DEPLOYMENTID,
Expand All @@ -179,7 +179,7 @@ async function init() {
await safeExit(0, "Success");

} catch (err) {
await publilishEvent(
await publishEvent(
"FRONTEND_BUILT_FAILED",
PROJECT_ID,
DEPLOYMENTID,
Expand All @@ -191,7 +191,7 @@ async function init() {
}

init().catch(async (err) => {
await publilishEvent(
await publishEvent(
"FRONTEND_BUILT_FAILED",
PROJECT_ID,
DEPLOYMENTID,
Expand All @@ -203,7 +203,7 @@ init().catch(async (err) => {
/* ---------------- TIMEOUT ---------------- */

setTimeout(async () => {
await publilishEvent(
await publishEvent(
"FRONTEND_BUILT_FAILED",
PROJECT_ID,
DEPLOYMENTID,
Expand Down
Loading
Loading