Re-derive app config after aioConfigLoader.reload() to fix stale ow credentials in deploy#907
Draft
Re-derive app config after aioConfigLoader.reload() to fix stale ow credentials in deploy#907
Conversation
…eload() Three edge cases identified: 1. config.ow.auth passed to deployActions is stale when pre-deploy hook modifies .env 2. this.appConfig cache not cleared after reload 3. Multi-extension deploys all use stale configs from initial load Agent-Logs-Url: https://github.com/adobe/aio-cli-plugin-app/sessions/96f9b49e-4a86-4996-959a-b15807c820b4 Co-authored-by: purplecabbage <46134+purplecabbage@users.noreply.github.com>
After aioConfigLoader.reload(), clear the appConfig cache and re-load the extension config so that env changes from hooks (e.g. new credentials written to .env) are reflected in all config values like ow.auth and ow.namespace, not just process.env used by input resolution. Agent-Logs-Url: https://github.com/adobe/aio-cli-plugin-app/sessions/96f9b49e-4a86-4996-959a-b15807c820b4 Co-authored-by: purplecabbage <46134+purplecabbage@users.noreply.github.com>
Agent-Logs-Url: https://github.com/adobe/aio-cli-plugin-app/sessions/96f9b49e-4a86-4996-959a-b15807c820b4 Co-authored-by: purplecabbage <46134+purplecabbage@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
purplecabbage
April 6, 2026 21:15
View session
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
shazron
requested changes
Apr 7, 2026
| this.error(hookResults.failures.map(f => `${f.plugin.name} : ${f.error.message}`).join('\nError: '), { exit: 1 }) | ||
| } | ||
| aioConfigLoader.reload() | ||
| // Re-derive the app config so that env changes from hooks |
Member
There was a problem hiding this comment.
reloading of config (nulling out of this.config) should be a function in BaseCommand.js that is called.
Member
There was a problem hiding this comment.
This change is from the last pr that was already approved and merged.
https://github.com/adobe/aio-cli-plugin-app/pull/906/changes#diff-ef6fdb9ce6a580102fb8f0ca000a2352ba0ad42dee61d6951457984ec7499b61R234
Member
There was a problem hiding this comment.
that's confusing, it shouldn't show up as a change here if this PR was re-based
iivvaannxx
approved these changes
Apr 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR #906 added
aioConfigLoader.reload()beforedeployActionsto pick up.envchanges from hooks. This refreshesprocess.env(sufficient for YAML input resolution viaprocessInputs), but theconfigobject passed todeployActionsis still the one computed at initial load —config.ow.auth,config.ow.namespace, etc. remain stale.Problem
This also affects multi-extension deploys: all extension configs are computed once before the loop, so every extension uses pre-hook values.
Fix
After
aioConfigLoader.reload(), clear the cachedthis.appConfigand re-derive the extension config:Tests added
deployActionsreflects freshow.authwhen pre-deploy hook modifies.envthis.appConfigcache is cleared after reloadAll three tests fail without the fix and pass with it. Full suite (834 tests, 56 suites) passes.