Skip to content

Ensure Config Reload Before Deploy#906

Merged
pru55e11 merged 2 commits intoadobe:masterfrom
iivvaannxx:ensure-config-pre-deploy
Apr 6, 2026
Merged

Ensure Config Reload Before Deploy#906
pru55e11 merged 2 commits intoadobe:masterfrom
iivvaannxx:ensure-config-pre-deploy

Conversation

@iivvaannxx
Copy link
Copy Markdown
Contributor

Description

Ensure config is reloaded just before deploying runtime actions. This ensures any change to .env files during build or pre-deploy hooks are picked by the code that resolves yaml inputs into actual variables (when reading process.env)

Context: https://magento.slack.com/archives/C013UDBFBGB/p1775048141970419?thread_ts=1774551027.799259&cid=C013UDBFBGB

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

const { sendAppAssetsDeployedAuditLog, sendAppDeployAuditLog } = require('../../lib/audit-logger')
const { setRuntimeApiHostAndAuthHandler, getAccessToken } = require('../../lib/auth-helper')
const logActions = require('../../lib/log-actions')
const aioConfigLoader = require('@adobe/aio-lib-core-config')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@purplecabbage are you ok with this var name?

@pru55e11 pru55e11 merged commit 33eb1a2 into adobe:master Apr 6, 2026
9 checks passed
@purplecabbage
Copy link
Copy Markdown
Member

There is a potential side-effect here. There are numerous places where the in-mem config is modified, it is an object reference that gets passed around and multiple modules write to it or modify it. Forcing a reload in its entirety could lead to broken workflows not neccessarily exposed by our tests.

@pru55e11
Copy link
Copy Markdown
Contributor

pru55e11 commented Apr 6, 2026

There is a potential side-effect here. There are numerous places where the in-mem config is modified, it is an object reference that gets passed around and multiple modules write to it or modify it. Forcing a reload in its entirety could lead to broken workflows not neccessarily exposed by our tests.

what if we re-read the .env file and merge the new values into process.env, rather than reloading the entire config store. Something like:

require('dotenv').config({ override: true })

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.

4 participants