Skip to content

created build for agenticfirst prod #1316

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

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

thakaresakshi121
Copy link
Contributor

@thakaresakshi121 thakaresakshi121 commented Apr 29, 2025

What do you want to achieve?

PR Checklist

  • I have tested it locally and all functionalities are working fine.
  • I have compared it with mocks and all design elements are the same.
  • I have tested it in IE Browser.

How was the code tested?

What new thing you came across while writing this code?

In case you fixed a bug then please describe the root cause of it?

Screenshot

NOTE: Make sure you're comparing your branch with the correct base branch

Summary by CodeRabbit

  • New Features
    • Introduced new test and production environment configurations for "AgenticFirst" with dedicated URLs, plugin settings, and third-party integrations.
    • Added new build scripts to support deployment for the "AgenticFirst" environments.

Copy link

github-actions bot commented Apr 29, 2025

Fails
🚫

Changes were made to package.json, but not to package-lock.json - 'Perhaps you need to run npm install?'

Warnings
⚠️ Please add the JIRA issue key to the PR title (e.g. FW-123)
Messages
📖 New Files in this PR: - 0

Generated by 🚫 dangerJS against 7cba3d2

Copy link
Contributor

coderabbitai bot commented Apr 29, 2025

"""

Walkthrough

Two new environment configurations, test_agenticfirst and prod_agenticfirst, have been added to the server configuration with specific ports, URLs, plugin properties, and third-party integration settings. Correspondingly, two new npm scripts, build-test-agenticfirst and build-prod-agenticfirst, were introduced in package.json to set the NODE_ENV environment variable to these new environments and run the existing build steps sequentially. Additionally, the cloudbuild.yaml was updated to include a conditional branch that triggers the build-prod-agenticfirst script when the build environment variable matches. No other environment configurations or scripts were changed.

Changes

File(s) Change Summary
package.json Added npm scripts build-prod-agenticfirst and build-test-agenticfirst to set NODE_ENV and run build-server and gulp-build scripts sequentially.
server/config/config-env.js Added new environment configurations prod_agenticfirst and test_agenticfirst with ports, URLs, plugin properties, and third-party integrations.
cloudbuild.yaml Added conditional branch to run npm run build-prod-agenticfirst when _BUILD_ENV equals prod_agenticfirst.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant NPM
    participant Server

    Developer->>NPM: run build-test-agenticfirst / build-prod-agenticfirst
    NPM->>NPM: Set NODE_ENV=test_agenticfirst / prod_agenticfirst
    NPM->>NPM: Run build-server
    NPM->>NPM: Run gulp-build
    NPM->>Server: Start server with test_agenticfirst / prod_agenticfirst config
Loading

Suggested reviewers

  • panwaranuj01
    """

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
server/config/config-env.js (1)

150-177: DRY up the prod_agenticfirst config by reusing the prod block
This block is nearly identical to prod. Use object spread or a factory to inherit from configEnv.prod and override only hostUrl to reduce duplication and maintenance overhead.

Example refactor:

// after defining configEnv.prod
configEnv.prod_agenticfirst = {
  ...configEnv.prod,
  urls: {
    ...configEnv.prod.urls,
    hostUrl: 'https://widget.agenticfirst.ai',
  },
};
package.json (1)

18-18: Improve cross-platform support for the build script
Using export is Unix-only. Consider using cross-env so Windows users and CI environments can set NODE_ENV reliably.

Suggested diff:

-"build-prod-agenticfirst": "export NODE_ENV=prod_agenticfirst && npm-run-all build-server gulp-build",
+"build-prod-agenticfirst": "cross-env NODE_ENV=prod_agenticfirst npm-run-all build-server gulp-build",
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c7f12fb and 03a59c3.

📒 Files selected for processing (2)
  • package.json (1 hunks)
  • server/config/config-env.js (1 hunks)
🔇 Additional comments (1)
package.json (1)

18-18: Add build script for prod_agenticfirst
The new build-prod-agenticfirst script correctly sets NODE_ENV to prod_agenticfirst and chains the existing build tasks.

Comment on lines 150 to 177
prod_agenticfirst: {
port: '3030',
urls: {
applozicBaseUrl: 'https://chat.kommunicate.io',
kommunicateBaseUrl: 'https://api.kommunicate.io',
botPlatformApi: 'https://bots.kommunicate.io',
hostUrl: 'https://widget.agenticfirst.ai',
dashboardUrl: 'https://dashboard.kommunicate.io',
},
pluginProperties: {
pseudoNameEnabled: true,
},
thirdPartyIntegration: {
sentry: {
nameSpace: '9f71614ef8184d0cab00074555dad9a7',
dsn: 'https://[email protected]/1321911',
enabled: true,
AUTH_TOKEN:
'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',
PROJECT: 'chat-widget',
ORG: 'applozic',
},
aws: {
cdnUrl: 'https://cdn.kommunicate.io',
bucket: 'kom-prod-cdn',
},
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove hard-coded Sentry credentials
Storing DSN and AUTH_TOKEN directly in source exposes secrets and risks leakage. Move these values into environment variables (e.g., process.env.SENTRY_DSN and process.env.SENTRY_AUTH_TOKEN) and fall back to defaults if needed.

Example diff:

-               dsn: 'https://…@sentry.io/1321911',
+               dsn: process.env.SENTRY_DSN,
...
-               AUTH_TOKEN: 'sntrys_…',
+               AUTH_TOKEN: process.env.SENTRY_AUTH_TOKEN,

kommunicateBaseUrl: 'https://api.kommunicate.io',
botPlatformApi: 'https://bots.kommunicate.io',
hostUrl: 'https://widget.agenticfirst.ai',
dashboardUrl: 'https://dashboard.kommunicate.io',
Copy link
Collaborator

Choose a reason for hiding this comment

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

check where is this url? do we need to change this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this host url is getting used in plugin

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
cloudbuild.yaml (1)

42-42: Remove trailing whitespace for YAML compliance.

YAMLlint flags a trailing space at the end of this line, which can cause lint errors or unexpected behavior in some parsers. Please strip the extra space after then.

-        elif [ "${_BUILD_ENV}" = "prod_agenticfirst" ]; then 
+        elif [ "${_BUILD_ENV}" = "prod_agenticfirst" ]; then
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 42-42: trailing spaces

(trailing-spaces)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 65cf270 and 7cba3d2.

📒 Files selected for processing (1)
  • cloudbuild.yaml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
cloudbuild.yaml

[error] 42-42: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: km-prod-widget (km-prod-us)

Comment on lines +42 to +43
elif [ "${_BUILD_ENV}" = "prod_agenticfirst" ]; then
npm run build-prod-agenticfirst;
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Verify environment naming and matching npm script.

Please ensure that the _BUILD_ENV value prod_agenticfirst aligns exactly with the npm script name in package.json (e.g., build-prod-agenticfirst). In addition, consider standardizing on hyphens (prod-agenticfirst) instead of underscores to stay consistent with other environment identifiers (prod-in, prod-eu, etc.) and avoid confusion.

Run this snippet to confirm the script’s presence:


🏁 Script executed:

#!/bin/bash
# Verify that build-prod-agenticfirst exists in package.json
grep -R '"build-prod-agenticfirst"' -n package.json

Length of output: 163


Standardize Environment Naming and Confirm npm Script

Confirmed that the build-prod-agenticfirst script exists in package.json (line 18) and matches the current _BUILD_ENV value. To maintain consistency with other environments (e.g., prod-in, prod-eu), rename underscores to hyphens throughout:

• In cloudbuild.yaml (lines 42–43):

  • Update _BUILD_ENV check from prod_agenticfirstprod-agenticfirst
    • In package.json (line 18):
  • Update NODE_ENV=prod_agenticfirstNODE_ENV=prod-agenticfirst

Proposed diffs:

--- a/cloudbuild.yaml
+++ b/cloudbuild.yaml
@@ -42,2 +42,2 @@ steps:
-        elif [ "${_BUILD_ENV}" = "prod_agenticfirst" ]; then 
-          npm run build-prod-agenticfirst;
+        elif [ "${_BUILD_ENV}" = "prod-agenticfirst" ]; then 
+          npm run build-prod-agenticfirst;
--- a/package.json
+++ b/package.json
@@ -18,1 +18,1 @@
-    "build-prod-agenticfirst": "export NODE_ENV=prod_agenticfirst && npm-run-all build-server gulp-build",
+    "build-prod-agenticfirst": "export NODE_ENV=prod-agenticfirst && npm-run-all build-server gulp-build",
📝 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
elif [ "${_BUILD_ENV}" = "prod_agenticfirst" ]; then
npm run build-prod-agenticfirst;
elif [ "${_BUILD_ENV}" = "prod-agenticfirst" ]; then
npm run build-prod-agenticfirst;
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 42-42: trailing spaces

(trailing-spaces)

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.

3 participants