Skip to content

ConfigEditor: Show error dialog when set variable failed#574

Merged
apop5 merged 1 commit intomicrosoft:mainfrom
PaddyDengAmi:user/paddydeng/SetVarFailAlert
Mar 19, 2026
Merged

ConfigEditor: Show error dialog when set variable failed#574
apop5 merged 1 commit intomicrosoft:mainfrom
PaddyDengAmi:user/paddydeng/SetVarFailAlert

Conversation

@PaddyDengAmi
Copy link
Copy Markdown
Contributor

@PaddyDengAmi PaddyDengAmi commented Mar 16, 2026

Description

Update set_variable_from_file api and display a error dialog when the function call fails.

Originally the set_variable_from_file function does not provide any return value nor raise any exception when set variable operation fails. This change adds a return value indicating the result of the operation, and provide an optional parameter abort_when_failure, which when set to true will cause the function return immediately. The parameter is set to optional and default to False to remain compatibility.

  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

Tested on MU system, originally when bios flash is locked (e.g. during out-of-band flashing), the set variable operation fails silently when there is a RuntimeVar.vl produced by previous load variable or set variable operation.
After the change, ConfigEditor will display a error dialog to notify the user that set variable failed.
Screenshot 2026-03-16 203915

Integration Instructions

N/A

@mu-automation mu-automation bot added language:python Pull requests that update Python code impact:non-functional Does not have a functional impact labels Mar 16, 2026
@os-d os-d requested review from apop5 and kuqin12 March 16, 2026 13:09
@PaddyDengAmi PaddyDengAmi force-pushed the user/paddydeng/SetVarFailAlert branch from 72f321d to 9eb89eb Compare March 19, 2026 06:47
@PaddyDengAmi
Copy link
Copy Markdown
Contributor Author

Amened commit to fix linter error.

Update `set_variable_from_file` api and display a error dialog when the
function call fails.

Originally the `set_variable_from_file` function does not provide any
return value nor raise any exception when set variable operation fails.
This change adds a return value indicating the result of the operation,
and provide an optional parameter `abort_when_failure`, which when set
to true will cause the function return immediately. The parameter is set
to optional and default to `False` to remain compatibility.

Signed-off-by: Paddy Deng <paddydeng@ami.com>
@PaddyDengAmi PaddyDengAmi force-pushed the user/paddydeng/SetVarFailAlert branch from 9eb89eb to f9bfd66 Compare March 19, 2026 07:27
@PaddyDengAmi
Copy link
Copy Markdown
Contributor Author

Hi @apop5 / @os-d / @kuqin12 ,

If there is no further change needed, could you help to merge this PR? It seems I don't have permission to merge it by myself.
Thanks a lot.

@apop5 apop5 merged commit 61c1039 into microsoft:main Mar 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:non-functional Does not have a functional impact language:python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants