cipd_upload: Fix manifest revision
Bug: b/332357274
Change-Id: I77dfa584e1339a72f9b999a9b3a9239ae67eeba8
Reviewed-on: https://pigweed-review.googlesource.com/c/infra/recipes/+/206471
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
diff --git a/recipe_modules/cipd_upload/api.py b/recipe_modules/cipd_upload/api.py
index 4a2d7f1..b1a337f 100644
--- a/recipe_modules/cipd_upload/api.py
+++ b/recipe_modules/cipd_upload/api.py
@@ -116,7 +116,7 @@
cipd_manifest=manifest,
build_dir=build_dir,
repository=checkout.root,
- git_revision=checkout.revision,
+ git_revision=checkout.revision(),
upload_to_cipd=upload_to_cipd,
cas_digests=cas_digests,
)
diff --git a/recipe_modules/cipd_upload/tests/manifest.expected/manifest.json b/recipe_modules/cipd_upload/tests/manifest.expected/manifest.json
index c63c316..8ad2a17 100644
--- a/recipe_modules/cipd_upload/tests/manifest.expected/manifest.json
+++ b/recipe_modules/cipd_upload/tests/manifest.expected/manifest.json
@@ -541,6 +541,20 @@
},
{
"cmd": [
+ "git",
+ "log",
+ "--max-count=1",
+ "--pretty=format:%H"
+ ],
+ "cwd": "[START_DIR]/checkout",
+ "name": "git log",
+ "timeout": 600.0,
+ "~followup_annotations": [
+ "@@@STEP_SUMMARY_TEXT@HASH@@@"
+ ]
+ },
+ {
+ "cmd": [
"python3",
"-u",
"RECIPE_MODULE[fuchsia::cipd_util]/resources/hardlink.py",
diff --git a/recipe_modules/pw_presubmit/tests/full.expected/cipd.json b/recipe_modules/pw_presubmit/tests/full.expected/cipd.json
index 06ce1b7..d70e017 100644
--- a/recipe_modules/pw_presubmit/tests/full.expected/cipd.json
+++ b/recipe_modules/pw_presubmit/tests/full.expected/cipd.json
@@ -1784,6 +1784,33 @@
},
{
"cmd": [
+ "git",
+ "log",
+ "--max-count=1",
+ "--pretty=format:%H"
+ ],
+ "cwd": "[START_DIR]/checkout",
+ "luci_context": {
+ "realm": {
+ "name": "project:ci"
+ },
+ "resultdb": {
+ "current_invocation": {
+ "name": "invocations/build:8945511751514863184",
+ "update_token": "token"
+ },
+ "hostname": "rdbhost"
+ }
+ },
+ "name": "step1.builder manifest.git log",
+ "timeout": 600.0,
+ "~followup_annotations": [
+ "@@@STEP_NEST_LEVEL@2@@@",
+ "@@@STEP_SUMMARY_TEXT@HASH@@@"
+ ]
+ },
+ {
+ "cmd": [
"python3",
"-u",
"RECIPE_MODULE[fuchsia::cipd_util]/resources/hardlink.py",