Revert "Generate provenance for global archives."
This reverts commit f372791f2bb977c1e44c7a786ed4047339754c7f.
Reason for revert: Enum is not being translated to string.
Original change's description:
> Generate provenance for global archives.
>
> The global archives are used to generate fat binaries from architecture
> specific builds. This CL adds provenance generation steps for global
> generators. This is the second and final part to enabling provenance
> generation for the flutte engine artifacts.
>
> Bug: https://github.com/flutter/flutter/issues/113193
> Change-Id: Ibf7c4e9818b1e4f9b09fbb5c90719bea2c27b6b9
> Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/35260
> Reviewed-by: Yusuf Mohsinally <mohsinally@google.com>
> Commit-Queue: Godofredo Contreras <godofredoc@google.com>
> Reviewed-by: Jonas Termansen <sortie@google.com>
TBR=sortie@google.com,godofredoc@google.com,flutter-scoped@luci-project-accounts.iam.gserviceaccount.com,mohsinally@google.com
Change-Id: Ib7347271b03b72e4539ff136bebeb7b09f7bbbb2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/flutter/flutter/issues/113193
Reviewed-on: https://flutter-review.googlesource.com/c/recipes/+/35304
Reviewed-by: Godofredo Contreras <godofredoc@google.com>
Commit-Queue: Godofredo Contreras <godofredoc@google.com>
diff --git a/recipe_modules/flutter_bcid/api.py b/recipe_modules/flutter_bcid/api.py
index e3806b9..d15891b 100644
--- a/recipe_modules/flutter_bcid/api.py
+++ b/recipe_modules/flutter_bcid/api.py
@@ -3,21 +3,9 @@
# found in the LICENSE file.
import re
-from enum import Enum
-
from recipe_engine import recipe_api
-class BcidStage(Enum):
- """Enum representing valid bcis stages."""
- START='start',
- FETCH='fetch',
- COMPILE='compile',
- UPLOAD='upload',
- UPLOAD_COMPLETE='upload-complete',
- TEST='test'
-
-
class FlutterBcidApi(recipe_api.RecipeApi):
def _is_official_build(self):
diff --git a/recipes/engine_v2/engine_v2.expected/basic_mac.json b/recipes/engine_v2/engine_v2.expected/basic_mac.json
index 0647b21..07ce18b 100644
--- a/recipes/engine_v2/engine_v2.expected/basic_mac.json
+++ b/recipes/engine_v2/engine_v2.expected/basic_mac.json
@@ -1067,59 +1067,6 @@
},
{
"cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "ensure-directory",
- "--mode",
- "0777",
- "[CLEANUP]/tmp_tmp_1/flutter_infra_release/flutter/12345abcde12345abcde12345abcde12345abcde/bucket"
- ],
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "proj:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "Ensure flutter_infra_release/flutter/12345abcde12345abcde12345abcde12345abcde/bucket"
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "copy",
- "/a/b/c.txt",
- "[CLEANUP]/tmp_tmp_1/flutter_infra_release/flutter/12345abcde12345abcde12345abcde12345abcde/bucket"
- ],
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "proj:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "Copy gs://flutter_archives_v2/flutter_infra_release/flutter/12345abcde12345abcde12345abcde12345abcde/bucket/c.txt"
- },
- {
- "cmd": [
"python3",
"-u",
"RECIPE_MODULE[depot_tools::gsutil]/resources/gsutil_smart_retry.py",
@@ -1128,8 +1075,8 @@
"----",
"cp",
"-r",
- "[CLEANUP]/tmp_tmp_1/*",
- "gs://flutter_archives_v2/"
+ "/a/b/c.txt",
+ "gs://flutter_archives_v2/flutter_infra_release/flutter//bucket/c.txt"
],
"infra_step": true,
"luci_context": {
@@ -1144,9 +1091,9 @@
"hostname": "rdbhost"
}
},
- "name": "gsutil flutter_infra_release/flutter/12345abcde12345abcde12345abcde12345abcde/bucket/c.txt",
+ "name": "gsutil c.txt",
"~followup_annotations": [
- "@@@STEP_LINK@gsutil.upload@https://console.cloud.google.com/storage/browser/flutter_archives_v2/@@@"
+ "@@@STEP_LINK@gsutil.upload@https://console.cloud.google.com/storage/browser/flutter_archives_v2/flutter_infra_release/flutter//bucket/c.txt@@@"
]
},
{
diff --git a/recipes/engine_v2/engine_v2.expected/config_from_file.json b/recipes/engine_v2/engine_v2.expected/config_from_file.json
index d80edac..9464dbd 100644
--- a/recipes/engine_v2/engine_v2.expected/config_from_file.json
+++ b/recipes/engine_v2/engine_v2.expected/config_from_file.json
@@ -929,59 +929,6 @@
},
{
"cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "ensure-directory",
- "--mode",
- "0777",
- "[CLEANUP]/tmp_tmp_1/flutter_infra_release/flutter/12345abcde12345abcde12345abcde12345abcde/bucket"
- ],
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "proj:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "Ensure flutter_infra_release/flutter/12345abcde12345abcde12345abcde12345abcde/bucket"
- },
- {
- "cmd": [
- "vpython3",
- "-u",
- "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
- "--json-output",
- "/path/to/tmp/json",
- "copy",
- "/a/b/c.txt",
- "[CLEANUP]/tmp_tmp_1/flutter_infra_release/flutter/12345abcde12345abcde12345abcde12345abcde/bucket"
- ],
- "infra_step": true,
- "luci_context": {
- "realm": {
- "name": "proj:try"
- },
- "resultdb": {
- "current_invocation": {
- "name": "invocations/build:8945511751514863184",
- "update_token": "token"
- },
- "hostname": "rdbhost"
- }
- },
- "name": "Copy gs://flutter_archives_v2/flutter_infra_release/flutter/12345abcde12345abcde12345abcde12345abcde/bucket/c.txt"
- },
- {
- "cmd": [
"python3",
"-u",
"RECIPE_MODULE[depot_tools::gsutil]/resources/gsutil_smart_retry.py",
@@ -990,8 +937,8 @@
"----",
"cp",
"-r",
- "[CLEANUP]/tmp_tmp_1/*",
- "gs://flutter_archives_v2/"
+ "/a/b/c.txt",
+ "gs://flutter_archives_v2/flutter_infra_release/flutter//bucket/c.txt"
],
"infra_step": true,
"luci_context": {
@@ -1006,9 +953,9 @@
"hostname": "rdbhost"
}
},
- "name": "gsutil flutter_infra_release/flutter/12345abcde12345abcde12345abcde12345abcde/bucket/c.txt",
+ "name": "gsutil c.txt",
"~followup_annotations": [
- "@@@STEP_LINK@gsutil.upload@https://console.cloud.google.com/storage/browser/flutter_archives_v2/@@@"
+ "@@@STEP_LINK@gsutil.upload@https://console.cloud.google.com/storage/browser/flutter_archives_v2/flutter_infra_release/flutter//bucket/c.txt@@@"
]
},
{
diff --git a/recipes/engine_v2/engine_v2.py b/recipes/engine_v2/engine_v2.py
index 81089ac..b9caf3a 100644
--- a/recipes/engine_v2/engine_v2.py
+++ b/recipes/engine_v2/engine_v2.py
@@ -13,7 +13,6 @@
# engine_v2/tester.py.
from contextlib import contextmanager
-from google.protobuf import struct_pb2
from PB.recipes.flutter.engine.engine import InputProperties
from PB.recipes.flutter.engine.engine import EnvProperties
@@ -21,13 +20,10 @@
from PB.go.chromium.org.luci.buildbucket.proto import build as build_pb2
from PB.go.chromium.org.luci.buildbucket.proto \
import builds_service as builds_service_pb2
-
-from RECIPE_MODULES.flutter.flutter_bcid.api import BcidStage
-
+from google.protobuf import struct_pb2
DEPS = [
- 'flutter/archives',
- 'flutter/flutter_bcid',
+ 'depot_tools/gsutil',
'flutter/display_util',
'flutter/flutter_deps',
'flutter/repo_util',
@@ -40,7 +36,6 @@
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
- 'recipe_engine/raw_io',
'recipe_engine/step',
]
@@ -49,7 +44,6 @@
def RunSteps(api, properties, env_properties):
- api.flutter_bcid.report_stage(BcidStage.START)
config_name = api.properties.get('config_name')
builds = api.properties.get('builds')
tests = api.properties.get('tests')
@@ -63,7 +57,6 @@
project = 'engine'
# Only check out the repository, not dependencies.
- api.flutter_bcid.report_stage(BcidStage.FETCH)
checkout_path = api.path['start_dir'].join(project)
api.repo_util.checkout(
project,
@@ -137,7 +130,6 @@
api.shard_util_v2.download_full_builds(build_results, out_builds_path)
with api.step.nest('Global generators') as presentation:
if 'tasks' in generators:
- api.flutter_bcid.report_stage(BcidStage.COMPILE)
for generator_task in generators['tasks']:
# Generators must run from inside flutter folder.
# If platform is mac we need to run the generator from an xcode context.
@@ -159,7 +151,6 @@
api.file.listdir('Final List checkout 2', full_engine_checkout.join('src', 'flutter', 'sky'), recursive=True)
# Global archives
if archives:
- api.flutter_bcid.report_stage(BcidStage.UPLOAD)
# Global archives are stored in out folder from full_engine_checkout inside
# release, debug or profile depending on the runtime mode.
# So far we are uploading files only.
@@ -172,10 +163,13 @@
artifact_path = 'flutter_infra_release/flutter/%s/%s' % (
commit, archive.get('destination')
)
- dst = 'gs://%s/%s' % (bucket, artifact_path)
- api.archives.upload_artifact(source, dst)
- api.flutter_bcid.upload_provenance(source, dst)
- api.flutter_bcid.report_stage(BcidStage.UPLOAD_COMPLETE)
+ api.gsutil.upload(
+ source=source,
+ bucket=bucket,
+ dest=artifact_path,
+ args=['-r'],
+ name=archive.get('name'),
+ )
def _run_global_generator(api, generator_task, full_engine_checkout, env, env_prefixes):
@@ -252,11 +246,6 @@
launch_step="launch builds",
collect_step="collect builds",
),
- api.step_data(
- 'git rev-parse',
- stdout=api.raw_io
- .output_text('12345abcde12345abcde12345abcde12345abcde\n')
- )
)
yield api.test(
@@ -298,11 +287,6 @@
'Read build config file',
api.file.read_json({'builds': builds, 'archives': archives})
),
- api.step_data(
- 'git rev-parse',
- stdout=api.raw_io
- .output_text('12345abcde12345abcde12345abcde12345abcde\n')
- )
)
yield api.test(