Skip to content

feat(integrations): PHX-297: Send transactions to open mSupply API#9195

Merged
NavarroEmilioLuis merged 46 commits intomainfrom
feature/phx-297-send-transactions-to-open-msupply-api
Mar 18, 2026
Merged

feat(integrations): PHX-297: Send transactions to open mSupply API#9195
NavarroEmilioLuis merged 46 commits intomainfrom
feature/phx-297-send-transactions-to-open-msupply-api

Conversation

@NavarroEmilioLuis
Copy link
Copy Markdown
Contributor

@NavarroEmilioLuis NavarroEmilioLuis commented Feb 19, 2026

Changes

Follows a similar pattern to the DHIS integration. More information on Linear cause there are lots of details here. Note that one third of the LOC is the test file, the other third is probably boilerplate (migration, model, config, dbt) and the rest is the actual task file to send the transactions.

Deploys

  • Deploy to Tamanu Internal

@NavarroEmilioLuis NavarroEmilioLuis requested a review from a team as a code owner February 19, 2026 03:06
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @NavarroEmilioLuis, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request establishes a new, automated integration with the Open mSupply API, designed to streamline the transfer of dispensed medication data from the system. It introduces a robust scheduled process that handles authentication, batches data for efficient transmission, and provides detailed logging for monitoring and troubleshooting. The integration is highly configurable through facility-specific settings, ensuring flexibility and control over how medication data is synchronized with external mSupply instances.

Highlights

  • New mSupply Integration: Introduced a new integration to send dispensed medication data to an Open mSupply API, following a pattern similar to existing DHIS integrations.
  • Scheduled Task Implementation: Implemented a new scheduled task, mSupplyMedIntegrationProcessor, responsible for authenticating with the mSupply API, fetching relevant medication dispense records, and pushing them in batches.
  • Integration Logging and Error Handling: Added a new database table and Sequelize model (MSupplyPushLog) to log the status, messages, and items of each mSupply push attempt, including detailed error logging for failed requests.
  • Configurable Settings: Provided extensive configuration options for the mSupply integration, including API host, store ID, customer code, authentication credentials, and retry backoff settings, all manageable via facility settings.
  • Comprehensive Testing: Included a dedicated test suite for the mSupplyMedIntegrationProcessor covering various scenarios such as configuration validation, batch processing, and error handling.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • packages/database/src/migrations/1769456144965-createMSupplyLogging.ts
    • Created a new migration to add the m_supply_pushes table in the logs schema, designed to store records of mSupply integration push attempts.
  • packages/database/src/models/MSupplyPushLog.ts
    • Added a new Sequelize model, MSupplyPushLog, to represent and interact with the m_supply_pushes table.
  • packages/database/src/models/index.ts
    • Exported the newly created MSupplyPushLog model to make it accessible throughout the application.
  • packages/facility-server/tests/tasks/mSupplyMedIntegrationProcessor.test.js
    • Added a new test file containing unit tests for the mSupplyMedIntegrationProcessor, covering various operational and error conditions.
  • packages/facility-server/app/tasks/index.js
    • Registered the mSupplyMedIntegrationProcessor within the default scheduled tasks, enabling its automatic execution.
  • packages/facility-server/app/tasks/mSupplyMedIntegrationProcessor.js
    • Implemented the mSupplyMedIntegrationProcessor scheduled task, which handles authentication, data retrieval, batch processing, and logging for pushing dispensed medications to the mSupply API.
  • packages/facility-server/config/default.json5
    • Added default configuration entries for the mSupplyMedIntegrationProcessor schedule and the mSupplyMed integration settings.
  • packages/settings/src/schema/facility.ts
    • Extended the facility settings schema to include validation and default values for integrations.mSupplyMed properties, such as host, storeId, customerCode, and backoff parameters.
Activity
  • The pull request description indicates that the changes follow a similar pattern to the DHIS integration, suggesting a familiar approach to new integrations.
  • No specific human activity (comments, reviews, or progress updates) has been recorded for this pull request beyond its initial creation and description.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new integration to send medication dispense transactions to an open mSupply API. The changes follow a good pattern, including a database migration for logging, a new Sequelize model, a scheduled task for processing, comprehensive tests, and the necessary configuration and settings schemas. My review focuses on improving the robustness of the data processing. I've identified a potential correctness issue with the batch pagination logic that could lead to data inconsistency under concurrent operations, and a minor issue with logging that might discard useful debugging information. Overall, this is a solid implementation of the new feature.

Comment thread packages/facility-server/app/tasks/mSupplyMedIntegrationProcessor.js Outdated
@NavarroEmilioLuis NavarroEmilioLuis changed the title feat(integratinos): PHX-297: Send transactions to open mSupply API feat(integrations): PHX-297: Send transactions to open mSupply API Feb 19, 2026
Copy link
Copy Markdown
Collaborator

@rohan-bes rohan-bes left a comment

Choose a reason for hiding this comment

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

Have a few comments and optional requests for rename/refactor, but nothing blocking. Looks solid, and with all things integrations there's usually a bit of tweaking once you start actually integrating so best to get to that point sooner rather than later :)

Comment thread packages/facility-server/app/tasks/mSupplyMedIntegrationProcessor.js Outdated
}

// Designed to post dispensed medications from pharmacy to an Open mSupply instance
export class mSupplyMedIntegrationProcessor extends ScheduledTask {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I know you're following a bit of a convention here with the DHIS2IntegrationProcessor but tbh I don't love that naming convention as its not very clear about what the task actually does. Thoughts on something like MSupplyMedicationStockUpdater?

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.

I'm fine either way, though I'm unsure what we will have to do with the new endpoint update. I'd rather leave it generic + comment

const batchCount = Math.ceil(toProcess / batchSize);

for (let i = 0; i < batchCount; i++) {
const medications = await this.models.MedicationDispense.findAll({
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I could have seen us wanting to group the dispenses by medication code, so that we just send the sum of all dispenses per medication. Was that considered? I guess we get a bit more granularity this way for reporting and can better handle when mSupply stock runs out.

Copy link
Copy Markdown
Contributor Author

@NavarroEmilioLuis NavarroEmilioLuis Feb 23, 2026

Choose a reason for hiding this comment

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

Considered for a second maybe, but I think it's getting ahead. Also, would not work with the current cursor approach as we would have to save a log per group code or something in the likes.

PS: I'd also leave this for later if anything, considering granularity + simplicity + deadline!

Comment thread packages/facility-server/app/tasks/mSupplyMedIntegrationProcessor.js Outdated
NavarroEmilioLuis and others added 2 commits February 23, 2026 12:06
Co-authored-by: Rohan Port <59544282+rohan-bes@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 26, 2026

Android builds 📱

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 26, 2026

🍹 up on tamanu-on-k8s/bes/tamanu-on-k8s/feature-phx-297-send-transactions-to-open-msupply-api

Pulumi report
   Updating (feature-phx-297-send-transactions-to-open-msupply-api)

View Live: https://app.pulumi.com/bes/tamanu-on-k8s/feature-phx-297-send-transactions-to-open-msupply-api/updates/4

Downloading plugin random-4.19.0: starting
Downloading plugin random-4.19.0: done
Installing plugin random-4.19.0: starting
Installing plugin random-4.19.0: done

@ Updating....
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running 
@ Updating....
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running read kubernetes:core/v1:Namespace tamanu-feature-phx-297-send-transactions-to-open-msupply-api
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running read pulumi:pulumi:StackReference bes/k8s-core/tamanu-internal-main
@ Updating....
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running read pulumi:pulumi:StackReference bes/k8s-core/tamanu-internal-main
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Using tailscale proxy https://k8s-operator-tamanu-internal-main.tail53aef.ts.net
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running read pulumi:pulumi:StackReference bes/core/tamanu-internal
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running read pulumi:pulumi:StackReference bes/core/tamanu-internal
@ Updating.....
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running read kubernetes:core/v1:Namespace tamanu-feature-phx-297-send-transactions-to-open-msupply-api
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Waiting for central-db...
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Waiting for facility-1-db...
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Waiting for facility-2-db...
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running read kubernetes:core/v1:ConfigMap actual-provisioning
~  kubernetes:apps/v1:Deployment facility-1-web updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-2-web updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment patient-portal-web updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment central-web updating (0s) [diff: ~spec]
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running read kubernetes:core/v1:ConfigMap actual-provisioning
@ Updating....
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Secret facility-2-db-superuser not found or not ready: Error: HTTP-Code: 404
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Message: Unknown API Status Code!
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"facility-2-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"facility-2-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Headers: {"audit-id":"86969df9-34df-4559-982a-df0b46077fe5","cache-control":"no-cache, private","connection":"close","content-length":"220","content-type":"application/json","date":"Thu, 12 Mar 2026 02:32:10 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Secret central-db-superuser not found or not ready: Error: HTTP-Code: 404
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Message: Unknown API Status Code!
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"central-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"central-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Headers: {"audit-id":"161093bf-b4d4-4609-b161-4f599f781c2e","cache-control":"no-cache, private","connection":"close","content-length":"214","content-type":"application/json","date":"Thu, 12 Mar 2026 02:32:10 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Secret facility-1-db-superuser not found or not ready: Error: HTTP-Code: 404
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Message: Unknown API Status Code!
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"facility-1-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"facility-1-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api running Headers: {"audit-id":"319ff7d8-c845-4210-9d1d-b841caf915ce","cache-control":"no-cache, private","connection":"close","content-length":"220","content-type":"application/json","date":"Thu, 12 Mar 2026 02:32:10 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}
++ kubernetes:batch/v1:Job central-migrator creating replacement (0s) [diff: ~spec]
++ kubernetes:batch/v1:Job central-migrator creating replacement (0s) [diff: ~spec]; 
@ Updating....
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (0s) [diff: ~spec]
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (0s) [diff: ~spec]
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (0s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (0s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job central-migrator creating replacement (1s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/central-migrator-d95d703e" to start
++ kubernetes:batch/v1:Job central-migrator creating replacement (1s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/central-migrator-d95d703e" to succeed (Active: 1 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (0s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-2-migrator-b88ce938" to start
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (0s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-1-migrator-bd8c7531" to start
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (0s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-2-migrator-b88ce938" to succeed (Active: 1 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (0s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-1-migrator-bd8c7531" to succeed (Active: 1 | Succeeded: 0 | Failed: 0)
@ Updating....
~  kubernetes:apps/v1:Deployment facility-1-web updating (2s) [diff: ~spec]; Waiting for app ReplicaSet to be available (0/1 Pods available)
~  kubernetes:apps/v1:Deployment central-web updating (2s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment central-web updating (2s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-web updated (2s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment patient-portal-web updating (2s) [diff: ~spec]; Waiting for app ReplicaSet to be available (0/1 Pods available)
~  kubernetes:apps/v1:Deployment facility-2-web updating (2s) [diff: ~spec]; Waiting for app ReplicaSet to be available (0/1 Pods available)
@ Updating.............
~  kubernetes:apps/v1:Deployment facility-1-web updating (12s) [diff: ~spec]; warning: [Pod tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-1-web-a058c563-65c6f6bc75-fkzdp]: containers with unready status: [http]
~  kubernetes:apps/v1:Deployment patient-portal-web updating (12s) [diff: ~spec]; warning: [Pod tamanu-feature-phx-297-send-transactions-to-open-msupply-api/patient-portal-web-2ebabbdb-55b9955c78-pdf9j]: containers with unready status: [http]
~  kubernetes:apps/v1:Deployment facility-2-web updating (12s) [diff: ~spec]; warning: [Pod tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-2-web-a3bc6ff8-5fd959f9d6-pb2q6]: containers with unready status: [http]
@ Updating....
~  kubernetes:apps/v1:Deployment facility-1-web updating (14s) [diff: ~spec]; Waiting for app ReplicaSet to be available (1/2 Pods available)
~  kubernetes:apps/v1:Deployment patient-portal-web updating (14s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment patient-portal-web updating (14s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment patient-portal-web updated (14s) [diff: ~spec]; 
@ Updating....
~  kubernetes:apps/v1:Deployment facility-2-web updating (15s) [diff: ~spec]; Waiting for app ReplicaSet to be available (1/2 Pods available)
@ Updating......
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (16s) [diff: ~spec]; warning: [Pod tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-1-migrator-bd8c7531-6l8cb]: Container "migrator" completed with exit code 0
@ Updating.....
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (18s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-1-migrator-bd8c7531" to succeed (Active: 0 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (18s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-1-migrator-bd8c7531" to succeed (Active: 0 | Succeeded: 1 | Failed: 0)
++ kubernetes:batch/v1:Job facility-1-migrator creating replacement (18s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-1-migrator created replacement (18s) [diff: ~spec]; 
@ Updating....
+- kubernetes:batch/v1:Job facility-1-migrator replacing (0s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job facility-1-migrator replaced (0.00s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-tasks updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-1-api updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-1-sync updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-1-tasks updating (0s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-1-tasks updating (0s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-tasks updated (0.71s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-api updating (0s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-1-api updating (0s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-api updated (0.87s) [diff: ~spec]; 
@ Updating....
~  kubernetes:apps/v1:Deployment facility-1-sync updating (0s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-1-sync updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-sync updated (1s) [diff: ~spec]; 
@ Updating....
~  kubernetes:apps/v1:Deployment facility-1-web updating (22s) [diff: ~spec]; warning: [Pod tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-1-web-a058c563-65c6f6bc75-bj2ln]: containers with unready status: [http]
~  kubernetes:apps/v1:Deployment facility-2-web updating (22s) [diff: ~spec]; warning: [Pod tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-2-web-a3bc6ff8-5fd959f9d6-8zsp2]: containers with unready status: [http]
@ Updating......
~  kubernetes:apps/v1:Deployment facility-2-web updating (25s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-2-web updating (25s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-2-web updated (25s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-web updating (26s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-1-web updating (26s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-1-web updated (26s) [diff: ~spec]; 
@ Updating..............
++ kubernetes:batch/v1:Job central-migrator creating replacement (36s) [diff: ~spec]; warning: [Pod tamanu-feature-phx-297-send-transactions-to-open-msupply-api/central-migrator-d95d703e-lprrt]: Container "migrator" completed with exit code 0
@ Updating....
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (35s) [diff: ~spec]; warning: [Pod tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-2-migrator-b88ce938-wvwbq]: Container "migrator" completed with exit code 0
@ Updating....
++ kubernetes:batch/v1:Job central-migrator creating replacement (38s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/central-migrator-d95d703e" to succeed (Active: 0 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job central-migrator creating replacement (38s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/central-migrator-d95d703e" to succeed (Active: 0 | Succeeded: 1 | Failed: 0)
++ kubernetes:batch/v1:Job central-migrator creating replacement (38s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (37s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-2-migrator-b88ce938" to succeed (Active: 0 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job central-migrator created replacement (38s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (37s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-2-migrator-b88ce938" to succeed (Active: 0 | Succeeded: 1 | Failed: 0)
++ kubernetes:batch/v1:Job facility-2-migrator creating replacement (37s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job facility-2-migrator created replacement (37s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job central-migrator replacing (0s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job central-migrator replaced (0.00s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job central-provisioner creating replacement (0s) [diff: ~spec]
+- kubernetes:batch/v1:Job facility-2-migrator replacing (0s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job facility-2-migrator replaced (0.01s) [diff: ~spec]; 
@ Updating....
~  kubernetes:apps/v1:Deployment facility-2-api updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-2-sync updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment facility-2-tasks updating (0s) [diff: ~spec]
++ kubernetes:batch/v1:Job central-provisioner creating replacement (0s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job central-provisioner creating replacement (0s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/central-provisioner-d108a7c6" to start
++ kubernetes:batch/v1:Job central-provisioner creating replacement (0s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/central-provisioner-d108a7c6" to succeed (Active: 1 | Succeeded: 0 | Failed: 0)
~  kubernetes:apps/v1:Deployment facility-2-sync updating (0s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-2-sync updating (0s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-2-sync updated (0.96s) [diff: ~spec]; 
@ Updating....
~  kubernetes:apps/v1:Deployment facility-2-api updating (1s) [diff: ~spec]; Waiting for app ReplicaSet to be available (0/1 Pods available)
~  kubernetes:apps/v1:Deployment facility-2-tasks updating (1s) [diff: ~spec]; warning: Replicas scaled to 0 for Deployment "facility-2-tasks-ed5e4291"
~  kubernetes:apps/v1:Deployment facility-2-tasks updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-2-tasks updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-2-tasks updated (1s) [diff: ~spec]; 
@ Updating........
~  kubernetes:apps/v1:Deployment facility-2-api updating (6s) [diff: ~spec]; Waiting for app ReplicaSet to be available (1/2 Pods available)
@ Updating.......
~  kubernetes:apps/v1:Deployment facility-2-api updating (10s) [diff: ~spec]; warning: [Pod tamanu-feature-phx-297-send-transactions-to-open-msupply-api/facility-2-api-548dcfc759-fnnxh]: containers with unready status: [server]
@ Updating....
~  kubernetes:apps/v1:Deployment facility-2-api updating (11s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment facility-2-api updating (11s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment facility-2-api updated (11s) [diff: ~spec]; 
@ Updating............
++ kubernetes:batch/v1:Job central-provisioner creating replacement (20s) [diff: ~spec]; warning: [Pod tamanu-feature-phx-297-send-transactions-to-open-msupply-api/central-provisioner-d108a7c6-tzpfg]: Container "provisioner" completed with exit code 0
@ Updating.....
++ kubernetes:batch/v1:Job central-provisioner creating replacement (22s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/central-provisioner-d108a7c6" to succeed (Active: 0 | Succeeded: 0 | Failed: 0)
++ kubernetes:batch/v1:Job central-provisioner creating replacement (22s) [diff: ~spec]; Waiting for Job "tamanu-feature-phx-297-send-transactions-to-open-msupply-api/central-provisioner-d108a7c6" to succeed (Active: 0 | Succeeded: 1 | Failed: 0)
++ kubernetes:batch/v1:Job central-provisioner creating replacement (22s) [diff: ~spec]; 
++ kubernetes:batch/v1:Job central-provisioner created replacement (22s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job central-provisioner replacing (0s) [diff: ~spec]; 
+- kubernetes:batch/v1:Job central-provisioner replaced (0.00s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-fhir-resolver updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment central-tasks updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment central-fhir-refresh updating (0s) [diff: ~spec]
~  kubernetes:apps/v1:Deployment central-api updating (0s) [diff: ~spec]
@ Updating....
~  kubernetes:apps/v1:Deployment central-fhir-resolver updating (0s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment central-fhir-resolver updating (0s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-fhir-resolver updated (0.75s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-tasks updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment central-tasks updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-tasks updated (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-fhir-refresh updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment central-fhir-refresh updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-fhir-refresh updated (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-api updating (1s) [diff: ~spec]; Deployment initialization complete
~  kubernetes:apps/v1:Deployment central-api updating (1s) [diff: ~spec]; 
~  kubernetes:apps/v1:Deployment central-api updated (1s) [diff: ~spec]; 
@ Updating....
-- kubernetes:batch/v1:Job central-provisioner deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job central-provisioner deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job central-provisioner deleted original (0.37s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job facility-2-migrator deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job facility-1-migrator deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job central-migrator deleting original (0s) [diff: ~spec]; 
@ Updating....
-- kubernetes:batch/v1:Job facility-2-migrator deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job facility-2-migrator deleted original (0.55s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job facility-1-migrator deleting original (0s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job facility-1-migrator deleted original (0.85s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job central-migrator deleting original (1s) [diff: ~spec]; 
-- kubernetes:batch/v1:Job central-migrator deleted original (1s) [diff: ~spec]; 
   pulumi:pulumi:Stack tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api  16 messages
Diagnostics:
 pulumi:pulumi:Stack (tamanu-on-k8s-feature-phx-297-send-transactions-to-open-msupply-api):
   Using tailscale proxy https://k8s-operator-tamanu-internal-main.tail53aef.ts.net

   Secret facility-2-db-superuser not found or not ready: Error: HTTP-Code: 404
   Message: Unknown API Status Code!
   Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"facility-2-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"facility-2-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   Headers: {"audit-id":"86969df9-34df-4559-982a-df0b46077fe5","cache-control":"no-cache, private","connection":"close","content-length":"220","content-type":"application/json","date":"Thu, 12 Mar 2026 02:32:10 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}
   Secret central-db-superuser not found or not ready: Error: HTTP-Code: 404
   Message: Unknown API Status Code!
   Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"central-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"central-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   Headers: {"audit-id":"161093bf-b4d4-4609-b161-4f599f781c2e","cache-control":"no-cache, private","connection":"close","content-length":"214","content-type":"application/json","date":"Thu, 12 Mar 2026 02:32:10 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}
   Secret facility-1-db-superuser not found or not ready: Error: HTTP-Code: 404
   Message: Unknown API Status Code!
   Body: "{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"secrets \\\"facility-1-db-superuser\\\" not found\",\"reason\":\"NotFound\",\"details\":{\"name\":\"facility-1-db-superuser\",\"kind\":\"secrets\"},\"code\":404}
"
   Headers: {"audit-id":"319ff7d8-c845-4210-9d1d-b841caf915ce","cache-control":"no-cache, private","connection":"close","content-length":"220","content-type":"application/json","date":"Thu, 12 Mar 2026 02:32:10 GMT","x-kubernetes-pf-flowschema-uid":"3fb296fc-e46b-45d1-9306-057e37ddd229","x-kubernetes-pf-prioritylevel-uid":"feccf24d-a074-4fa8-aa6f-db82477fc2f5"}

   Waiting for central-db...
   Waiting for facility-1-db...
   Waiting for facility-2-db...

   [Pulumi Neo] Would you like help with these diagnostics?
   https://app.pulumi.com/bes/tamanu-on-k8s/feature-phx-297-send-transactions-to-open-msupply-api/updates/4?explainFailure

Outputs:
   urls: {
       Central      : "https://central.feature-phx-297-send-transactions-to-open-msupply-api.cd.tamanu.app"
       Facility- 1  : "https://facility-1.feature-phx-297-send-transactions-to-open-msupply-api.cd.tamanu.app"
       Facility- 2  : "https://facility-2.feature-phx-297-send-transactions-to-open-msupply-api.cd.tamanu.app"
       PatientPortal: "https://portal.feature-phx-297-send-transactions-to-open-msupply-api.cd.tamanu.app"
   }

Resources:
   ~ 14 updated
   +-4 replaced
   18 changes. 49 unchanged

Duration: 1m11s

   

Comment on lines +125 to +137
"mSupplyMedIntegrationProcessor": {
"enabled": false,
"schedule": "0 2 * * *",
"batchSize": 100,
"batchSleepAsyncDurationInMilliseconds": 50
},
},
"integrations": {
"mSupplyMed": {
"enabled": false,
"username": "",
"password": ""
}
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.

Deployment team, this is the change, new integration and schedule for the facility server

@NavarroEmilioLuis NavarroEmilioLuis merged commit 5368292 into main Mar 18, 2026
231 of 239 checks passed
@NavarroEmilioLuis NavarroEmilioLuis deleted the feature/phx-297-send-transactions-to-open-msupply-api branch March 18, 2026 23:03
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