Skip to content

fix: to resolve missing env#21

Open
srinuatpiramal wants to merge 3 commits intodevelopfrom
sandbox
Open

fix: to resolve missing env#21
srinuatpiramal wants to merge 3 commits intodevelopfrom
sandbox

Conversation

@srinuatpiramal
Copy link
Copy Markdown
Contributor

@srinuatpiramal srinuatpiramal commented Apr 21, 2025

📋 Description: Due to missing customization properties, CI/CD build is failing. Added required properties.

JIRA ID: AMM-1093

Please provide a summary of the change and the motivation behind it. Include relevant context and details.


✅ 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

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

Summary by CodeRabbit

  • New Features

    • Added new API endpoint URLs for fetching registration data and retrieving beneficiary IDs via health ID in multiple environments.
    • Introduced support for configuring a FHIR API base URL across local, test, CI, and production environments.
  • Chores

    • Updated environment configuration files to include new constants and endpoints.
    • Added a missing trailing comma and a new environment variable in build scripts.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 21, 2025

## Walkthrough

The changes introduce a new FHIR API base URL configuration across multiple environment files, including local, CI, test, and production settings. New constants for the FHIR API base URL are added or updated, and two new API endpoint URLs—`getAllRegistrationData` and `getBenIdForhealthID`—are included in the relevant environment exports. The CI prebuild script is updated to include the `FHIR_API_BASE` environment variable. Some URL constructions are modified to use path segments instead of port numbers. No existing logic or control flow is altered.

## Changes

| File(s)                                                                                 | Change Summary                                                                                                             |
|----------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| scripts/ci-prebuild.js                                                                 | Added `FHIR_API_BASE` key with default value to `defaultEnvValues`; added missing trailing comma.                         |
| src/environments/environment.ci.ts.template                                            | Introduced `FHIR_API` constant; added `getAllRegistrationData` and `getBenIdForhealthID` endpoints to environment export. |
| src/environments/environment.local.ts                                                  | Added local constants `fhirIP` and `FHIR_API` for FHIR API base URL; no changes to exports.                               |
| src/environments/environment.prod.ts                                                   | Added `fhirIP` and `FHIR_API` constants; added two new endpoints to environment export; reordered one constant.           |
| src/environments/environment.test.ts                                                   | Changed `FHIR_API` construction from port-based to path-based URL.                                                        |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant App
    participant EnvironmentConfig
    participant FHIR_API
    participant COMMON_API

    App->>EnvironmentConfig: Load environment (local/CI/prod/test)
    EnvironmentConfig->>FHIR_API: Set FHIR_API base URL
    EnvironmentConfig->>COMMON_API: Set COMMON_API base URL
    App->>EnvironmentConfig: Get getAllRegistrationData endpoint
    App->>EnvironmentConfig: Get getBenIdForhealthID endpoint
    App->>FHIR_API: Call healthID/getBenIdForhealthID
    App->>COMMON_API: Call customization/fetchAllData

Poem

In the warren of configs, a new path appears,
For FHIR API calls, let’s all give three cheers!
Endpoints now clearer, URLs set just right,
From local to prod, they’re ready for flight.
With a hop and a skip, our code’s in good form—
The rabbits rejoice as the APIs transform!
🐇✨


<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

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

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 06a15efdc3536035d2a8443b23431cbba83d4c69 and 6ed1e69418611f03367160ba3f03e06fcda15a0e.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `src/environments/environment.prod.ts` (3 hunks)

</details>

<details>
<summary>✅ Files skipped from review due to trivial changes (1)</summary>

* src/environments/environment.prod.ts

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (2)</summary>

* GitHub Check: Build
* GitHub Check: Analyze (javascript)

</details>

</details>
<!-- internal state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JNBWxosj0B7FoHcUOXkJB3WMH3AIZNn7vK8Now1eC85+tyBPX8ZVbBa4Vh/DbiEYgWajtQgidQjtArfJRIMcSLqg1xrFO0vdR4CTlqUNMJ3QbKQFBcgBmzfgCintDF9/THKvIrYwUeI1ahXGm5qCFVaEQAhE+qA9CZ/JxTpZ/BiHgbS8/VrcMetrsqVAu2kai7weXfzjnWg5i+oLalwopeDICxDdjMD/zpxgBj4eKvDvAzq0ZH6wEMLwFvBVjQIQjYYeDSod63zpyoyHbtqdgzoGinbrrnahaXoLo3bhB3YTo7BPbGyk4oJXx1Js7RJy6fqIrJ6aBK6FoLg5iQG9LDzRTRRfgq7krzZsGQChy07cq8rrL6qGomrRQADcKu4hDurUoh2hkhfS0hfuchw8SydODOl+sm1+GhWh4hkeMKikzE+8s4mEhA6smeaWQ8wkok2esIVEig0kagskjECkBgTh606gSUO4iASUTefYgotASURsveiEYRyEkAUwAAbFMBMLEEas6GgEagACwCAGpFFFGOhoCZGOiAgqCOhTBoB6rOjOgADsLRrotAroUwJAsQzojoEw8khgThjomRaAUwRqPRtADAroRqro1RMxtAEwjR5RroAgEwroRRXRDAqgjRHRRRDAmRzogxaREAkAmRdA3RhxRRUweq2RUwsQjorocxLRWRjo9CroDxroJAIxsQDAsY4xaAjoHgqR4RLANQURtAMRcRFCdASUqEgxQAA=== -->

<!-- internal state end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=PSMRI/ECD-UI&utm_content=21):

- 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](https://docs.coderabbit.ai/finishing-touches/docstrings) for 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.

### 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@srinuatpiramal srinuatpiramal requested a review from drtechie April 21, 2025 11:01
Copy link
Copy Markdown

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

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 707b72e and 1612f59.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • scripts/ci-prebuild.js (1 hunks)
  • src/environments/environment.ci.ts.template (2 hunks)
  • src/environments/environment.local.ts (1 hunks)
  • src/environments/environment.prod.ts (2 hunks)
  • src/environments/environment.test.ts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build
🔇 Additional comments (6)
scripts/ci-prebuild.js (1)

44-45: Added missing FHIR API environment variable

The addition of FHIR_API_BASE to the defaultEnvValues object properly enables FHIR API configuration in the CI environment, addressing the missing environment customization property that was causing build failures.

src/environments/environment.test.ts (1)

35-35: Updated FHIR endpoint structure from port-based to path-based

The FHIR API URL has been correctly modified to use the path segment fhirapi-v1.0/ instead of a port suffix, which aligns with the approach used in the production environment.

src/environments/environment.ci.ts.template (2)

28-28: Added FHIR API base URL from environment variable

The FHIR_API constant is correctly initialized with the placeholder <%= FHIR_API_BASE %>, which will be replaced with the actual value during build.


215-218: Added customization API endpoints

The two new endpoints for customization APIs are consistently added with proper spacing and formatting. The endpoints reference the FHIR_API constant for the health ID lookup, which correctly completes the configuration.

src/environments/environment.prod.ts (2)

31-31: FHIR API constant added correctly

The FHIR API base URL is correctly constructed using the fhirIP constant.


222-224: API endpoints added correctly for customization and health ID services

The new endpoints have been properly added to the environment configuration, which resolves the missing environment customization properties mentioned in the PR objectives.

Comment on lines +35 to +36
const fhirIP = 'http://localhost';
const FHIR_API = `${fhirIP}:8085/`;
Copy link
Copy Markdown

@coderabbitai coderabbitai bot Apr 21, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

FHIR API configuration for local environment

The addition of FHIR API constants for the local environment is consistent with the changes in other environment files, providing proper separation between environments.

However, I noticed that while you've defined these constants, they're not yet being used in the exported environment object like they are in the test and CI environments. You may need to add the customization API endpoints to maintain consistency.


🏁 Script executed:

#!/bin/bash
# Search for any potential usage of FHIR_API in other files that might expect these endpoints
rg -A 2 -B 2 "getAllRegistrationData|getBenIdForhealthID" --type ts

Length of output: 870


Add missing customization endpoints in environment.local.ts

The FHIR_API constant is defined but not yet used in the exported environment object. To match environment.test.ts and environment.prod.ts, add the two customization API endpoints:

• File to update: src/environments/environment.local.ts
• Around the exported object, insert:

 export const environment = {
   production: false,
   fhirIP,
   FHIR_API,
+  // Customization APIs
+  getAllRegistrationData: `${COMMON_API}customization/fetchAllData`,
+  getBenIdForhealthID: `${FHIR_API}healthID/getBenIdForhealthID`,
   // …other endpoints
 };

This ensures consistent API availability across all environments.

Committable suggestion skipped: line range outside the PR's diff.

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.

@srinuatpiramal are these variables present?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Copy Markdown
Contributor Author

@srinuatpiramal srinuatpiramal left a comment

Choose a reason for hiding this comment

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

Changed const fhirIP value

@sonarqubecloud
Copy link
Copy Markdown

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.

2 participants