Repository navigation
Conversation
When actions.yaml is generated or staged during the lifecycle, return False from get_actions_yaml() so that mediated packaging does not overwrite or unlink it in the prime directory.
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.
When
actions.yamlis staged during the build lifecycle (for example, in charms containing legacy or unenforcedactions.yamlfiles staged from the project tree, or reactive charms generating actions),PackageService.get_actions_yamlnow returnsFalseso that craft-application's package file mediation leaves the staged and primed file untouched instead of unlinking it.Root cause
In #2890, mediated packaging was introduced. When
actions.yamlcontained non-conforming syntax (e.g. intests/spread/smoketests/metafiles-bad-yaml-unenforced),preprocess.add_actionsdid not populateyaml_data['actions'], leavingproject.actionsasNone._get_mediated_yamltherefore returnedNone, causing_write_assetto unlinkactions.yamlfrom the prime directory.Solution
Check if
actions.yamlexists in the stage directory inPackageService.get_actions_yaml(). If present, emit debug and returnFalse, leaving the file untouched inprime.Verification
test_get_actions_yaml_skips_when_exists_in_stageintests/unit/services/test_package.py.make test-fast(2849 passed).ruff check,ruff format --diff, andty check(all passed).