Skip to content

Conversation

@abhijeetw035
Copy link
Contributor

@abhijeetw035 abhijeetw035 commented Apr 1, 2025

📋 Description

JIRA ID:

GitHub Issue: Fixes PSMRI/AMRIT#58

  • Updated the Common-UI submodule to the latest commit.
  • Fixed CI build issues by ensuring the correct submodule reference and configuration.
  • Verified that npm run build-ci passes locally and on GitHub Actions.

These updates ensure that the latest changes in Common-UI are correctly integrated into the project without breaking the build process.


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

How Changes Were Tested:

  • Ran npm run build-ci locally to confirm the build process completes without errors.
  • Checked git submodule status to confirm the correct reference is being used.
  • Ensured the updated submodule is initialized properly with git submodule update --init --recursive.

Screenshots:

  • Local Build Success:
    buildci

  • Git Submodule Status:
    submodule


Summary by CodeRabbit

  • Chores
    • Upgraded a core UI dependency to the latest version.
    • Improved the build process by ensuring necessary environment configurations are set up prior to build.
    • Expanded configuration options to support additional API integration and enhance security settings.
    • Introduced environment-specific configurations for production and development builds.

@coderabbitai
Copy link

coderabbitai bot commented Apr 1, 2025

Walkthrough

The changes update the Common-UI subproject by advancing its commit hash, modify the CI build scripts in the package.json to ensure that the src/environments/environment.ts file exists before executing the Angular build, and expand the environment configuration in the ci-prebuild script by adding two new properties (FHIR_API_BASE and SESSION_STORAGE_ENC_KEY). These modifications adjust pre-build preparations and configuration setups without altering the core build functionality.

Changes

File(s) Change Summary
Common-UI Updated subproject commit hash from d12389e2e433de99af585fef88d452ea137625e3 to 840fd9792f07ca75723ad6b2a2e9f4d35969d416.
package.json Modified the "build-dev", "build-prod", "build-ci", and "build-test" scripts to add a touch src/environments/environment.ts command before the Angular build command.
scripts/ci-prebuild.js Expanded the defaultEnvValues object by adding FHIR_API_BASE: '' and SESSION_STORAGE_ENC_KEY: ''; also updated ADMIN_API_BASE formatting for consistency.
angular.json Added fileReplacements property in production and development configurations to replace src/environments/environment.ts with src/environments/environment.prod.ts.

Sequence Diagram(s)

sequenceDiagram
    participant CI as CI Build Process
    participant Scripts as Scripts Directory
    participant Env as Environment File
    participant Angular as Angular CLI Build

    CI->>Scripts: Run chmod & execute ci-prebuild.js
    Scripts-->>CI: Setup environment variables (including new properties)
    CI->>Env: Run "touch src/environments/environment.ts"
    CI->>Angular: Execute Angular build command
    Angular-->>CI: Build process completes
Loading

Assessment against linked issues

Objective Addressed Explanation
CI Build Success & Submodule Update (#58)
Correct Node.js Version Usage (#58) No explicit changes to Node.js version configuration are provided.

Suggested reviewers

  • helenKaryamsetty
  • drtechie

Poem

I'm a rabbit with a hop and a clever little tweak,
Touching files and scripts in a dance so sleek,
Submodules updated, environment set just right,
With cheers in my heart, I celebrate this sight 🐰,
Code hopping along through prebuild delight!
May every build be merry and bright!


🪧 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 docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

package.json Outdated
"build-dev": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=development --aot",
"build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=production --aot",
"build-ci": "chmod +x ./scripts/*.js && ./scripts/ci-prebuild.js && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=ci --aot",
"build-ci": "chmod +x ./scripts/*.js && ./scripts/ci-prebuild.js && touch src/environments/environment.ts && node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --configuration=ci --aot",
Copy link
Member

Choose a reason for hiding this comment

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

Can we add this touch to other scripts too?
Prod and test.

Copy link
Contributor Author

@abhijeetw035 abhijeetw035 Apr 2, 2025

Choose a reason for hiding this comment

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

Sure, will add it!

@abhijeetw035
Copy link
Contributor Author

Ensured environment.ts is created first in all build scripts

In this update, I added touch src/environments/environment.ts to all build scripts (build-prod, build-ci, and build-test). This ensures that the environment file is always created before the build process starts.

Additionally, for build-ci, I moved touch src/environments/environment.ts to the beginning of the script so that the file is created before executing chmod and other prebuild scripts.** This prevents potential issues due to a missing environment.ts file during the build.

Now, all scripts follow a consistent execution order.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 2, 2025

Copy link

@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: 0

🧹 Nitpick comments (2)
angular.json (2)

55-61: Production Configuration: Valid File Replacement Setup
The production configuration now includes a "fileReplacements" array that correctly maps "src/environments/environment.ts" to "src/environments/environment.prod.ts", ensuring production-specific settings are applied at build time. Please verify that all production dependencies and environment-specific variables are appropriately configured in "environment.prod.ts".


69-75: Development Configuration: Verify File Replacement Intent
In the development configuration, "src/environments/environment.ts" is replaced with "src/environments/environment.prod.ts". Typically, one might expect a development-specific environment file (like "environment.dev.ts") to be used. Please confirm if using the production environment file for development builds is intentional for your CI or testing strategy.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69c81d3 and 516e3fd.

📒 Files selected for processing (2)
  • angular.json (1 hunks)
  • package.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

@abhijeetw035
Copy link
Contributor Author

abhijeetw035 commented Apr 2, 2025

Updated angular.json by adding fileReplacements for production and development configurations. Modified build scripts to ensure environment.ts exists before execution and preventing missing file issues.

@drtechie drtechie merged commit 2792b47 into PSMRI:develop Apr 2, 2025
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Jun 13, 2025
10 tasks
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.

[C4GT Community]: Ensure GitHub Actions Pass Successfully with Correct Node Version and Submodules in Admin-UI

2 participants