-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[antlir2][rpms] do a better job of recording feature details
Summary: Before properly cleaning up the way rpm features get merged in the depgraph, make sure we are tracing the target graph through in a way that's easier to read later by recording the original feature label on each `rpm` feature. This also records the antlir2 layer label and resolved transaction in the dnf history table, so it's possible to see why certain things were installed. Test Plan: ``` ❯ buck2 test fbcode//antlir/antlir2/test_images/rpms: Buck UI: https://www.internalfb.com/buck2/fa5cba49-298f-4f1c-996c-72ae200a06a4 Test UI: https://www.internalfb.com/intern/testinfra/testrun/3940649860928808 Network: Up: 11 MiB Down: 0 B (reSessionID-9041bb35-34ca-400d-9e54-1a021cf6798a) Jobs completed: 117. Time elapsed: 53.7s. Cache hits: 0%. Commands: 72 (cached: 0, remote: 0, local: 72) Tests finished: Pass 19. Fail 0. Fatal 0. Skip 0. Build failure 0 ❯ buck2 build --show-output fbcode//antlir/antlir2/test_images/rpms:simple--layer--features Buck UI: https://www.internalfb.com/buck2/848ab645-8d98-4015-a363-7daf34bca7d9 Network: Up: 0 B Down: 0 B Jobs completed: 4. Time elapsed: 0.1s. BUILD SUCCEEDED fbcode//antlir/antlir2/test_images/rpms:simple--layer--features buck-out/v2/gen/fbcode/513e0f216bd9b87a/antlir/antlir2/test_images/rpms/__simple--layer--features__/features.json vmagro@devvm11640.ftw0 in fbsource ❯ jq < buck-out/v2/gen/fbcode/513e0f216bd9b87a/antlir/antlir2/test_images/rpms/__simple--layer--features__/features.json [ { "feature_type": "rpm", "label": "fbcode//antlir/antlir2/test_images/rpms:simple--layer--features", "data": { "items": [ { "action": "install", "rpm": { "subject": "foo-2", "src": null, "subjects_src": null }, "feature_label": "fbcode//antlir/antlir2/test_images/rpms:simple--layer--features" }, { "action": "install", "rpm": { "subject": "foobarbaz", "src": null, "subjects_src": null }, "feature_label": "fbcode//antlir/antlir2/test_images/rpms:simple--layer--features" } ] }, "run_info": [ "buck-out/v2/gen/fbcode/0b8ca35c5e5df329/antlir/antlir2/features/__rpm__/shared/rpm" ] }, ``` Reviewed By: sergeyfd Differential Revision: D47635567 fbshipit-source-id: ec6ac1d5f75bec951e5734ff14e14b1f771d4529
- Loading branch information
1 parent
9eeec53
commit 324ddcf
Showing
8 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,6 +92,7 @@ feature_impl( | |
name = "rpm", | ||
deps = [ | ||
"serde_json", | ||
"//antlir/buck/buck_label:buck_label", | ||
], | ||
) | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
set -e | ||
|
||
# 'foo' should only be touched in transaction 1 | ||
if [ "$(dnf history list foo | tail -n +3 | awk '{ print $1 }')" != "1" ]; then | ||
echo "foo was altered outside of transaction 1!" | ||
dnf history list foo | ||
exit 1 | ||
fi | ||
|
||
tx1comment="$(dnf history info 1)" | ||
if [[ "$tx1comment" != *"//antlir/antlir2/test_images/rpms:simple--layer"* ]]; then | ||
echo "comment did not have label" | ||
echo "$tx1comment" | ||
exit 1 | ||
fi | ||
|
||
# 'foobar' should have been touched in transaction 1 and 2 because the reason | ||
# needed to be changed | ||
if [ "$(dnf history list foobar | tail -n +3 | awk '{ print $1 }')" != $'2\n1' ]; then | ||
echo "foobar should have been changed in tx 1 and 2" | ||
dnf history list foobar | ||
exit 1 | ||
fi |