-
Notifications
You must be signed in to change notification settings - Fork 441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
project_loader: replace dict keys as well as values #2166
project_loader: replace dict keys as well as values #2166
Conversation
I can confirm this is fixing bug LP: #1778287 |
This should also fix the organize bug, https://bugs.launchpad.net/snapcraft/+bug/1746636, so I am marking LP: #1778287 as a dup of that one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, only reason I am marking as needs fixing is that it seems this was a random request for which we already had a bug, so after affecting the original bug we should be ok.
The snapcraft CLI actually runs a text replacement over the `snapcraft.yaml`, replacing all occurrences of its built-in variables (such as `$SNAPCRAFT_STAGE`) with their actual values, knowing that, once these are migrated into the final `snap.yaml` the variables have no meaning. However, when it comes to running the replacements on dicts, it only checks the values for replacement, not the keys. Fix this by simply running replacements on the keys as well as the values. LP: #1746636 Signed-off-by: Kyle Fazzari <kyrofa@ubuntu.com>
3631a85
to
0d94216
Compare
Codecov Report
@@ Coverage Diff @@
## master #2166 +/- ##
==========================================
+ Coverage 91.29% 91.29% +<.01%
==========================================
Files 200 200
Lines 12580 12585 +5
Branches 1871 1871
==========================================
+ Hits 11485 11490 +5
Misses 741 741
Partials 354 354
Continue to review full report at Codecov.
|
Good catch @sergiusens, forgot about that one. I've fixed the commit as well as the PR description. |
Two potentially related bugs that would be good to get squished at the same time: LP#1746633 and LP#1766878 |
./runtests.sh static
?./runtests.sh unit
?The snapcraft CLI actually runs a text replacement over the
snapcraft.yaml
, replacing all occurrences of its built-in variables (such as$SNAPCRAFT_STAGE
) with their actual values, knowing that, once these are migrated into the finalsnap.yaml
the variables have no meaning. However, when it comes to running the replacements on dicts, it only checks the values for replacement, not the keys. This PR fixes LP: #1746636 by simply running replacements on the keys as well as the values.