Skip to content

fix : made required changes so build succeeds#93

Merged
drtechie merged 8 commits intoPSMRI:developfrom
Zapper9982:bugfix/issue-57
Apr 11, 2025
Merged

fix : made required changes so build succeeds#93
drtechie merged 8 commits intoPSMRI:developfrom
Zapper9982:bugfix/issue-57

Conversation

@Zapper9982
Copy link
Copy Markdown
Contributor

@Zapper9982 Zapper9982 commented Apr 9, 2025

📋 Description

JIRA ID:

GitHub Issue: Fixes PSMRI/AMRIT#57

Changes Made :

  • Updated the submodule to the latest commit.

  • GitHub Actions: Build on Pull Request

    • Updated .github/workflows/build-on-pull-request.yml to properly handle submodules during the build.
  • GitHub Actions: Package Workflow

    • Replaced deprecated versions in .github/workflows/. upgrade all to latets versions .
  • Consistent Build Handling:
    -- environment is first touched , and then the the command are run.

    • build-ci
    • build-prod
    • build-dev
    • build-test
  • Removed deprecated and unused nodemodules:

    • removed node-sass
    • removed ng2-smart-table


✅ 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)

Screenshots

image

Summary by CodeRabbit

  • Chores
    • Enhanced CI/CD workflows by updating GitHub Actions to the latest versions for improved build efficiency and stability.
    • Removed the workflow responsible for packaging production builds.
    • Optimized environment configurations by adding file replacements for production and development builds.
    • Streamlined dependency management by removing legacy packages.
    • Added new environment variables for improved configuration options.
    • Updated ESLint rules for better code quality and consistency in JavaScript and TypeScript files.
    • Updated .gitignore to exclude new environment configuration files.
    • Modified build scripts to ensure environment files are present before execution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2025

Walkthrough

This pull request updates multiple GitHub Actions workflows by upgrading action versions (e.g., checkout, setup-java, setup-node, and upload-artifact) and removing specific npm install commands related to certain dependencies. It also updates environment file usage in Angular configurations and package build scripts by ensuring that the environment file exists before a build. Additional modifications include an updated subproject commit in Common-UI, a new entry in the .gitignore, added environment variables in a CI prebuild script, and a revised import path in an Angular component. These changes are made to improve the CI/CD pipeline consistency and maintain dependency configurations.

Changes

File(s) Change Summary
.github/workflows/build-on-pull-request.yml,
.github/workflows/package.yml
Upgraded GitHub Actions versions (checkout, setup-java, setup-node, and upload-artifact) and removed specific npm install commands for ng2-smart-table and node-sass.
.github/workflows/package-prod.yml Removed the entire workflow for packaging a production build.
.gitignore Added new ignore entry for src/environments/environment.ci.ts.
Common-UI Updated the subproject commit reference from 7e67d68... to 881c233....
angular.json Added fileReplacements entries for production and development builds to switch environment files.
package.json Modified build scripts to check for (and create, if missing) src/environments/environment.ts and removed the ng2-smart-table dependency.
scripts/ci-prebuild.js Added two new properties, HWC_API_BASE and SESSION_STORAGE_ENC_KEY, to defaultEnvValues.
src/app/app-modules/nurse-doctor/screening/oral-cancer-screening/oral-cancer-screening.component.ts Updated the import path for the environment from environment.development to environment.
.eslintrc.json Added a new rule for Angular template click events and a new configuration block for JavaScript and JSX files.

Sequence Diagram(s)

sequenceDiagram
    participant Script
    participant FileSystem
    participant BuildProcess

    Script->>FileSystem: Check if "src/environments/environment.ts" exists
    alt File is missing
        FileSystem-->>Script: Not found
        Script->>FileSystem: Create file using "touch"
    else File exists
        FileSystem-->>Script: File present
    end
    Script->>BuildProcess: Execute Angular build command
Loading

Assessment against linked issues

Objective Addressed Explanation
CI/CD pipeline runs successfully with correct Node.js version and build command passes [#57]
Git submodules and required subprojects are correctly initialized [#57]

Possibly related PRs

Suggested reviewers

  • helenKaryamsetty
  • drtechie

Poem

I'm a little rabbit hopping with glee,
Upgrading workflows for our CI spree.
With actions refreshed and scripts set to run,
Our builds now shine like a bright sun.
Hip-hip-hooray for a code-filled day! 🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fbcb39c and 4400130.

📒 Files selected for processing (1)
  • src/environments/environment.ci.ts.template (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/environments/environment.ci.ts.template

🪧 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.

import { ConfirmationService } from 'src/app/app-modules/core/services';
import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component';
import { environment } from 'src/environments/environment.development';
import { environment } from 'src/environments/environment.dev';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

souldn't we use environment.ts here?
Angular anyways replaces the file.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ohh yeah @drtechie , seems valid let me update it !

Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (4)
.github/workflows/package.yml (3)

29-32: Indentation Issue in Java Setup
The java-version and distribution fields under the with: key are indented with 10 spaces rather than the expected 8. Please adjust the indentation to align with YAML standards.

Consider applying this diff:

-          java-version: '17'
-          distribution: 'adopt'
+        java-version: '17'
+        distribution: 'adopt'
🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 31-31: wrong indentation: expected 8 but found 10

(indentation)


40-45: Build Command Update and Trailing Whitespace
The build step now uses npm run build-ci, which aligns with the updated build process. However, static analysis has flagged trailing whitespace (notably on the line with npm run build-ci). Removing these extra spaces will help avoid YAML lint warnings.

For example, ensure the command line reads exactly:

-            npm run build-ci␣␣
+            npm run build-ci

47-55: Upload Artifact Step and Trailing Whitespace
The upload step has been updated to use actions/upload-artifact@v4 and the artifact path has been changed to dist/hwc-ui/hwc-ui.war, which is correct. Please also remove any trailing whitespace (notably on the line specifying the path) as flagged by static analysis.

A diff suggestion to remove trailing spaces on the artifact path line:

-        path: dist/hwc-ui/hwc-ui.war␣
+        path: dist/hwc-ui/hwc-ui.war
🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 47-47: trailing spaces

(trailing-spaces)


[error] 49-49: trailing spaces

(trailing-spaces)


[error] 54-54: trailing spaces

(trailing-spaces)

.github/workflows/build-on-pull-request.yml (1)

22-27: Trailing Whitespace in JDK Setup Section
While the Java setup update to actions/setup-java@v4 is correctly implemented, static analysis identified trailing whitespace on line 27 (the blank or spacing line following the distribution setting). Please remove the extra spaces to conform to YAML formatting guidelines.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 27-27: trailing spaces

(trailing-spaces)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 266a0c1 and 9439a7a.

📒 Files selected for processing (3)
  • .github/workflows/build-on-pull-request.yml (3 hunks)
  • .github/workflows/package-prod.yml (0 hunks)
  • .github/workflows/package.yml (3 hunks)
💤 Files with no reviewable changes (1)
  • .github/workflows/package-prod.yml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/build-on-pull-request.yml

[error] 27-27: trailing spaces

(trailing-spaces)

.github/workflows/package.yml

[warning] 31-31: wrong indentation: expected 8 but found 10

(indentation)


[error] 46-46: trailing spaces

(trailing-spaces)


[error] 47-47: trailing spaces

(trailing-spaces)


[error] 49-49: trailing spaces

(trailing-spaces)


[error] 54-54: trailing spaces

(trailing-spaces)

🔇 Additional comments (5)
.github/workflows/package.yml (2)

19-22: Update to Checkout Action Version
The checkout step now uses actions/checkout@v4 with proper submodule settings and fetch depth. This update looks good.


35-37: Update to Node.js Setup
The Node.js step now correctly uses actions/setup-node@v4 with Node version 18. This update is correct and aligns with the new standards.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 37-37: wrong indentation: expected 8 but found 10

(indentation)


[error] 37-37: trailing spaces

(trailing-spaces)

.github/workflows/build-on-pull-request.yml (3)

11-17: Checkout Action Update Verification
The checkout step in this workflow now uses actions/checkout@v4 along with proper reference extraction and submodule support. This change is implemented correctly.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 17-17: trailing spaces

(trailing-spaces)


28-32: Node.js Setup Update
The Node.js step correctly uses actions/setup-node@v4 with Node version 18. This change is good as-is.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 32-32: trailing spaces

(trailing-spaces)


33-39: Build Command Consistency
The build step uses npm run build-ci, which is consistent with the changes in the other workflow file and the updated build process. No issues are noted here.

@drtechie
Copy link
Copy Markdown
Member

drtechie commented Apr 9, 2025

@Zapper9982 there are conflicts in this PR.

@Zapper9982
Copy link
Copy Markdown
Contributor Author

@drtechie Resolved the merge Conflict

Copy link
Copy Markdown
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: 0

🧹 Nitpick comments (2)
.github/workflows/package.yml (2)

29-32: Updated Setup Java Action Version & Fix YAML Indentation
The Java setup action has been updated to actions/setup-java@v4, ensuring modern configuration and performance improvements. However, YAMLlint has flagged an indentation issue on line 31 (expected 8 spaces but found 10). Please adjust the indentation for consistency.

Example diff:

-          java-version: '17'
-          distribution: 'adopt'
+        java-version: '17'
+        distribution: 'adopt'
🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 31-31: wrong indentation: expected 8 but found 10

(indentation)


46-49: Remove Trailing Whitespace
Static analysis reports trailing whitespace on lines 46, 47, and 49. Removing these extraneous spaces will improve readability and maintain clean formatting.

Example diff:

-            npm run build-ci   
+            npm run build-ci
-    
-    - name: Create WAR file 
+    - name: Create WAR file
-      
+      

Note: Ensure that only the unwanted whitespace is removed so that the intended YAML structure is preserved.

🧰 Tools
🪛 YAMLlint (1.35.1)

[error] 46-46: trailing spaces

(trailing-spaces)


[error] 47-47: trailing spaces

(trailing-spaces)


[error] 49-49: trailing spaces

(trailing-spaces)

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 9439a7a and c85eee3.

📒 Files selected for processing (2)
  • .github/workflows/package.yml (3 hunks)
  • Common-UI (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Common-UI
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/package.yml

[warning] 31-31: wrong indentation: expected 8 but found 10

(indentation)


[error] 46-46: trailing spaces

(trailing-spaces)


[error] 47-47: trailing spaces

(trailing-spaces)


[error] 49-49: trailing spaces

(trailing-spaces)

🔇 Additional comments (4)
.github/workflows/package.yml (4)

19-19: Updated Checkout Action Version
The checkout action is updated to use actions/checkout@v4, which provides improved performance and additional features. The current configuration correctly includes submodules and fetches the full history.


35-37: Updated Setup Node.js Action Version
The Node.js setup action is now using actions/setup-node@v4, which aligns with expected updates. The configuration under the with block appears correct.

🧰 Tools
🪛 YAMLlint (1.35.1)

[warning] 37-37: wrong indentation: expected 8 but found 10

(indentation)


[error] 37-37: trailing spaces

(trailing-spaces)


45-45: Revised Build Command
The build command has been updated to npm run build-ci, ensuring that the CI-specific build process is executed instead of the previous generic build. Verify that the corresponding build-ci script in your package.json is correctly configured.


51-55: Updated Upload Artifact Action and Artifact Path
The upload artifact action now uses actions/upload-artifact@v4, and the artifact path has been changed to dist/hwc-ui/hwc-ui.war. Confirm that this new path correctly points to the built artifact for your project.

Copy link
Copy Markdown
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: 0

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

38-38: Accessibility Override: Verify Intent of Disabling Click Events Key Events Rule
The rule "@angular-eslint/template/click-events-have-key-events": 0 disables the accessibility check for key events on click events in Angular templates. Please ensure that this decision is intentional and that alternative measures are in place to guarantee adequate accessibility in these components.


60-74: New JavaScript/JSX ESLint Override: Check Consistency & Configuration
This override for *.js and *.jsx files introduces a Node.js environment, sets the ECMAScript version to 2020, and enforces stricter linting rules (e.g., "no-unused-vars": "warn", "no-console": "error", and "eqeqeq": ["error", "always"]). Notice that the TypeScript override (lines 11–40) applies "eqeqeq": 1 (a warning) while here it is an error. Please verify that this discrepancy is deliberate and aligns with your project’s linting and code quality standards.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c85eee3 and 5ccb9ec.

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

@Zapper9982
Copy link
Copy Markdown
Contributor Author

@drtechie noticed that the recent commit to the Common-UI causes some import problems, so reverted one commit back on Common-UI

@drtechie
Copy link
Copy Markdown
Member

@Zapper9982, we will need the changes. Also looks like some environment properties are removed in this PR which was recently added in another PR.

@Zapper9982
Copy link
Copy Markdown
Contributor Author

@drtechie I think you should close this Pull request , I'll pull my codebase once and raise another PR with the same , so we can cleanly update the changes !

@helenKaryamsetty
Copy link
Copy Markdown
Member

@Zapper9982 you can delete the environment and language files from PR as those are required and not relevant to your PR. This will help to not remove wanted code.

@Zapper9982
Copy link
Copy Markdown
Contributor Author

@helenKaryamsetty , @drtechie thanks for the help , I made the changes accordingly .

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
91.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@drtechie drtechie merged commit 54440e6 into PSMRI:develop Apr 11, 2025
3 of 4 checks passed
@Zapper9982 Zapper9982 deleted the bugfix/issue-57 branch April 11, 2025 11:57
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 HWC-UI

3 participants