We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Integration tests to pull artifacts from S3Bucket


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bundle-workflow/src/manifests/bundle_manifest.py`
Content:
```
1 # SPDX-License-Identifier: Apache-2.0
2 #
3 # The OpenSearch Contributors require contributions made to
4 # this file be licensed under the Apache-2.0 license or a
5 # compatible open source license.
6 
7 from manifests.manifest import Manifest
8 
9 
10 class BundleManifest(Manifest):
11     """
12     A BundleManifest is an immutable view of the outputs from a assemble step
13     The manifest contains information about the bundle that was built (in the `assemble` section),
14     and the components that made up the bundle in the `components` section.
15 
16     The format for schema version 1.0 is:
17         schema-version: "1.0"
18         build:
19           name: string
20           version: string
21           architecture: x64 or arm64
22           location: /relative/path/to/tarball
23         components:
24           - name: string
25             repository: URL of git repository
26             ref: git ref that was built (sha, branch, or tag)
27             commit_id: The actual git commit ID that was built (i.e. the resolved "ref")
28             location: /relative/path/to/artifact
29     """
30 
31     def __init__(self, data):
32         super().__init__(data)
33 
34         self.build = self.Build(data["build"])
35         self.components = list(
36             map(lambda entry: self.Component(entry), data["components"])
37         )
38 
39     def __to_dict__(self):
40         return {
41             "schema-version": "1.0",
42             "build": self.build.__to_dict__(),
43             "components": list(
44                 map(lambda component: component.__to_dict__(), self.components)
45             ),
46         }
47 
48     class Build:
49         def __init__(self, data):
50             self.name = data["name"]
51             self.version = data["version"]
52             self.architecture = data["architecture"]
53             self.location = data["location"]
54             self.id = data["id"]
55 
56         def __to_dict__(self):
57             return {
58                 "name": self.name,
59                 "version": self.version,
60                 "architecture": self.architecture,
61                 "location": self.location,
62                 "id": self.id,
63             }
64 
65     class Component:
66         def __init__(self, data):
67             self.name = data["name"]
68             self.repository = data["repository"]
69             self.ref = data["ref"]
70             self.commit_id = data["commit_id"]
71             self.location = data["location"]
72 
73         def __to_dict__(self):
74             return {
75                 "name": self.name,
76                 "repository": self.repository,
77                 "ref": self.ref,
78                 "commit_id": self.commit_id,
79                 "location": self.location,
80             }
81
```

Path: `bundle-workflow/src/manifests/build_manifest.py`
Content:
```
1 # SPDX-License-Identifier: Apache-2.0
2 #
3 # The OpenSearch Contributors require contributions made to
4 # this file be licensed under the Apache-2.0 license or a
5 # compatible open source license.
6 
7 from manifests.manifest import Manifest
8 
9 """
10 A BuildManifest is an immutable view of the outputs from a build step
11 The manifest contains information about the product that was built (in the `build` section),
12 and the components that made up the build in the `components` section.
13 
14 The format for schema version 1.0 is:
15 schema-version: "1.0"
16 build:
17   name: string
18   version: string
19   architecture: x64 or arm64
20 components:
21   - name: string
22     repository: URL of git repository
23     ref: git ref that was built (sha, branch, or tag)
24     commit_id: The actual git commit ID that was built (i.e. the resolved "ref")
25     artifacts:
26       maven:
27         - maven/relative/path/to/artifact
28         - ...
29       plugins:
30         - plugins/relative/path/to/artifact
31         - ...
32       libs:
33         - libs/relative/path/to/artifact
34         - ...
35   - ...
36 """
37 
38 
39 class BuildManifest(Manifest):
40     def __init__(self, data):
41         super().__init__(data)
42 
43         self.build = self.Build(data["build"])
44         self.components = list(
45             map(lambda entry: self.Component(entry), data["components"])
46         )
47 
48     def __to_dict__(self):
49         return {
50             "schema-version": "1.0",
51             "build": self.build.__to_dict__(),
52             "components": list(
53                 map(lambda component: component.__to_dict__(), self.components)
54             ),
55         }
56 
57     class Build:
58         def __init__(self, data):
59             self.name = data["name"]
60             self.version = data["version"]
61             self.architecture = data["architecture"]
62             self.id = data["id"]
63 
64         def __to_dict__(self):
65             return {
66                 "name": self.name,
67                 "version": self.version,
68                 "architecture": self.architecture,
69                 "id": self.id,
70             }
71 
72     class Component:
73         def __init__(self, data):
74             self.name = data["name"]
75             self.repository = data["repository"]
76             self.ref = data["ref"]
77             self.commit_id = data["commit_id"]
78             self.artifacts = data["artifacts"]
79             self.version = data["version"]
80 
81         def __to_dict__(self):
82             return {
83                 "name": self.name,
84                 "repository": self.repository,
85                 "ref": self.ref,
86                 "commit_id": self.commit_id,
87                 "artifacts": self.artifacts,
88                 "version": self.version,
89             }
90
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/bundle-workflow/src/manifests/build_manifest.py b/bundle-workflow/src/manifests/build_manifest.py
--- a/bundle-workflow/src/manifests/build_manifest.py
+++ b/bundle-workflow/src/manifests/build_manifest.py
@@ -4,6 +4,9 @@
 # this file be licensed under the Apache-2.0 license or a
 # compatible open source license.
 
+import os
+
+from aws.s3_bucket import S3Bucket
 from manifests.manifest import Manifest
 
 """
@@ -54,6 +57,20 @@
             ),
         }
 
+    @staticmethod
+    def get_build_manifest_relative_location(build_id, opensearch_version, architecture):
+        return f"builds/{opensearch_version}/{build_id}/{architecture}/manifest.yml"
+
+    @staticmethod
+    def from_s3(bucket_name, build_id, opensearch_version, architecture, work_dir=None):
+        work_dir = work_dir if not None else str(os.getcwd())
+        manifest_s3_path = BuildManifest.get_build_manifest_relative_location(build_id, opensearch_version, architecture)
+        S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)
+        with open('manifest.yml', 'r') as file:
+            build_manifest = BuildManifest.from_file(file)
+        os.remove(os.path.realpath(os.path.join(work_dir, 'manifest.yml')))
+        return build_manifest
+
     class Build:
         def __init__(self, data):
             self.name = data["name"]
diff --git a/bundle-workflow/src/manifests/bundle_manifest.py b/bundle-workflow/src/manifests/bundle_manifest.py
--- a/bundle-workflow/src/manifests/bundle_manifest.py
+++ b/bundle-workflow/src/manifests/bundle_manifest.py
@@ -4,6 +4,9 @@
 # this file be licensed under the Apache-2.0 license or a
 # compatible open source license.
 
+import os
+
+from aws.s3_bucket import S3Bucket
 from manifests.manifest import Manifest
 
 
@@ -45,6 +48,28 @@
             ),
         }
 
+    @staticmethod
+    def from_s3(bucket_name, build_id, opensearch_version, architecture, work_dir=None):
+        work_dir = work_dir if not None else str(os.getcwd())
+        manifest_s3_path = BundleManifest.get_bundle_manifest_relative_location(build_id, opensearch_version, architecture)
+        S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)
+        with open('manifest.yml', 'r') as file:
+            bundle_manifest = BundleManifest.from_file(file)
+        os.remove(os.path.realpath(os.path.join(work_dir, 'manifest.yml')))
+        return bundle_manifest
+
+    @staticmethod
+    def get_tarball_relative_location(build_id, opensearch_version, architecture):
+        return f"bundles/{opensearch_version}/{build_id}/{architecture}/opensearch-{opensearch_version}-linux-{architecture}.tar.gz"
+
+    @staticmethod
+    def get_tarball_name(opensearch_version, architecture):
+        return f"opensearch-{opensearch_version}-linux-{architecture}.tar.gz"
+
+    @staticmethod
+    def get_bundle_manifest_relative_location(build_id, opensearch_version, architecture):
+        return f"bundles/{opensearch_version}/{build_id}/{architecture}/manifest.yml"
+
     class Build:
         def __init__(self, data):
             self.name = data["name"]

{"golden_diff": "diff --git a/bundle-workflow/src/manifests/build_manifest.py b/bundle-workflow/src/manifests/build_manifest.py\n--- a/bundle-workflow/src/manifests/build_manifest.py\n+++ b/bundle-workflow/src/manifests/build_manifest.py\n@@ -4,6 +4,9 @@\n # this file be licensed under the Apache-2.0 license or a\n # compatible open source license.\n \n+import os\n+\n+from aws.s3_bucket import S3Bucket\n from manifests.manifest import Manifest\n \n \"\"\"\n@@ -54,6 +57,20 @@\n             ),\n         }\n \n+    @staticmethod\n+    def get_build_manifest_relative_location(build_id, opensearch_version, architecture):\n+        return f\"builds/{opensearch_version}/{build_id}/{architecture}/manifest.yml\"\n+\n+    @staticmethod\n+    def from_s3(bucket_name, build_id, opensearch_version, architecture, work_dir=None):\n+        work_dir = work_dir if not None else str(os.getcwd())\n+        manifest_s3_path = BuildManifest.get_build_manifest_relative_location(build_id, opensearch_version, architecture)\n+        S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)\n+        with open('manifest.yml', 'r') as file:\n+            build_manifest = BuildManifest.from_file(file)\n+        os.remove(os.path.realpath(os.path.join(work_dir, 'manifest.yml')))\n+        return build_manifest\n+\n     class Build:\n         def __init__(self, data):\n             self.name = data[\"name\"]\ndiff --git a/bundle-workflow/src/manifests/bundle_manifest.py b/bundle-workflow/src/manifests/bundle_manifest.py\n--- a/bundle-workflow/src/manifests/bundle_manifest.py\n+++ b/bundle-workflow/src/manifests/bundle_manifest.py\n@@ -4,6 +4,9 @@\n # this file be licensed under the Apache-2.0 license or a\n # compatible open source license.\n \n+import os\n+\n+from aws.s3_bucket import S3Bucket\n from manifests.manifest import Manifest\n \n \n@@ -45,6 +48,28 @@\n             ),\n         }\n \n+    @staticmethod\n+    def from_s3(bucket_name, build_id, opensearch_version, architecture, work_dir=None):\n+        work_dir = work_dir if not None else str(os.getcwd())\n+        manifest_s3_path = BundleManifest.get_bundle_manifest_relative_location(build_id, opensearch_version, architecture)\n+        S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)\n+        with open('manifest.yml', 'r') as file:\n+            bundle_manifest = BundleManifest.from_file(file)\n+        os.remove(os.path.realpath(os.path.join(work_dir, 'manifest.yml')))\n+        return bundle_manifest\n+\n+    @staticmethod\n+    def get_tarball_relative_location(build_id, opensearch_version, architecture):\n+        return f\"bundles/{opensearch_version}/{build_id}/{architecture}/opensearch-{opensearch_version}-linux-{architecture}.tar.gz\"\n+\n+    @staticmethod\n+    def get_tarball_name(opensearch_version, architecture):\n+        return f\"opensearch-{opensearch_version}-linux-{architecture}.tar.gz\"\n+\n+    @staticmethod\n+    def get_bundle_manifest_relative_location(build_id, opensearch_version, architecture):\n+        return f\"bundles/{opensearch_version}/{build_id}/{architecture}/manifest.yml\"\n+\n     class Build:\n         def __init__(self, data):\n             self.name = data[\"name\"]\n", "issue": "Integration tests to pull artifacts from S3Bucket\n\n", "before_files": [{"content": "# SPDX-License-Identifier: Apache-2.0\n#\n# The OpenSearch Contributors require contributions made to\n# this file be licensed under the Apache-2.0 license or a\n# compatible open source license.\n\nfrom manifests.manifest import Manifest\n\n\nclass BundleManifest(Manifest):\n    \"\"\"\n    A BundleManifest is an immutable view of the outputs from a assemble step\n    The manifest contains information about the bundle that was built (in the `assemble` section),\n    and the components that made up the bundle in the `components` section.\n\n    The format for schema version 1.0 is:\n        schema-version: \"1.0\"\n        build:\n          name: string\n          version: string\n          architecture: x64 or arm64\n          location: /relative/path/to/tarball\n        components:\n          - name: string\n            repository: URL of git repository\n            ref: git ref that was built (sha, branch, or tag)\n            commit_id: The actual git commit ID that was built (i.e. the resolved \"ref\")\n            location: /relative/path/to/artifact\n    \"\"\"\n\n    def __init__(self, data):\n        super().__init__(data)\n\n        self.build = self.Build(data[\"build\"])\n        self.components = list(\n            map(lambda entry: self.Component(entry), data[\"components\"])\n        )\n\n    def __to_dict__(self):\n        return {\n            \"schema-version\": \"1.0\",\n            \"build\": self.build.__to_dict__(),\n            \"components\": list(\n                map(lambda component: component.__to_dict__(), self.components)\n            ),\n        }\n\n    class Build:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.version = data[\"version\"]\n            self.architecture = data[\"architecture\"]\n            self.location = data[\"location\"]\n            self.id = data[\"id\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"version\": self.version,\n                \"architecture\": self.architecture,\n                \"location\": self.location,\n                \"id\": self.id,\n            }\n\n    class Component:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.repository = data[\"repository\"]\n            self.ref = data[\"ref\"]\n            self.commit_id = data[\"commit_id\"]\n            self.location = data[\"location\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"repository\": self.repository,\n                \"ref\": self.ref,\n                \"commit_id\": self.commit_id,\n                \"location\": self.location,\n            }\n", "path": "bundle-workflow/src/manifests/bundle_manifest.py"}, {"content": "# SPDX-License-Identifier: Apache-2.0\n#\n# The OpenSearch Contributors require contributions made to\n# this file be licensed under the Apache-2.0 license or a\n# compatible open source license.\n\nfrom manifests.manifest import Manifest\n\n\"\"\"\nA BuildManifest is an immutable view of the outputs from a build step\nThe manifest contains information about the product that was built (in the `build` section),\nand the components that made up the build in the `components` section.\n\nThe format for schema version 1.0 is:\nschema-version: \"1.0\"\nbuild:\n  name: string\n  version: string\n  architecture: x64 or arm64\ncomponents:\n  - name: string\n    repository: URL of git repository\n    ref: git ref that was built (sha, branch, or tag)\n    commit_id: The actual git commit ID that was built (i.e. the resolved \"ref\")\n    artifacts:\n      maven:\n        - maven/relative/path/to/artifact\n        - ...\n      plugins:\n        - plugins/relative/path/to/artifact\n        - ...\n      libs:\n        - libs/relative/path/to/artifact\n        - ...\n  - ...\n\"\"\"\n\n\nclass BuildManifest(Manifest):\n    def __init__(self, data):\n        super().__init__(data)\n\n        self.build = self.Build(data[\"build\"])\n        self.components = list(\n            map(lambda entry: self.Component(entry), data[\"components\"])\n        )\n\n    def __to_dict__(self):\n        return {\n            \"schema-version\": \"1.0\",\n            \"build\": self.build.__to_dict__(),\n            \"components\": list(\n                map(lambda component: component.__to_dict__(), self.components)\n            ),\n        }\n\n    class Build:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.version = data[\"version\"]\n            self.architecture = data[\"architecture\"]\n            self.id = data[\"id\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"version\": self.version,\n                \"architecture\": self.architecture,\n                \"id\": self.id,\n            }\n\n    class Component:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.repository = data[\"repository\"]\n            self.ref = data[\"ref\"]\n            self.commit_id = data[\"commit_id\"]\n            self.artifacts = data[\"artifacts\"]\n            self.version = data[\"version\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"repository\": self.repository,\n                \"ref\": self.ref,\n                \"commit_id\": self.commit_id,\n                \"artifacts\": self.artifacts,\n                \"version\": self.version,\n            }\n", "path": "bundle-workflow/src/manifests/build_manifest.py"}], "after_files": [{"content": "# SPDX-License-Identifier: Apache-2.0\n#\n# The OpenSearch Contributors require contributions made to\n# this file be licensed under the Apache-2.0 license or a\n# compatible open source license.\n\nimport os\n\nfrom aws.s3_bucket import S3Bucket\nfrom manifests.manifest import Manifest\n\n\nclass BundleManifest(Manifest):\n    \"\"\"\n    A BundleManifest is an immutable view of the outputs from a assemble step\n    The manifest contains information about the bundle that was built (in the `assemble` section),\n    and the components that made up the bundle in the `components` section.\n\n    The format for schema version 1.0 is:\n        schema-version: \"1.0\"\n        build:\n          name: string\n          version: string\n          architecture: x64 or arm64\n          location: /relative/path/to/tarball\n        components:\n          - name: string\n            repository: URL of git repository\n            ref: git ref that was built (sha, branch, or tag)\n            commit_id: The actual git commit ID that was built (i.e. the resolved \"ref\")\n            location: /relative/path/to/artifact\n    \"\"\"\n\n    def __init__(self, data):\n        super().__init__(data)\n\n        self.build = self.Build(data[\"build\"])\n        self.components = list(\n            map(lambda entry: self.Component(entry), data[\"components\"])\n        )\n\n    def __to_dict__(self):\n        return {\n            \"schema-version\": \"1.0\",\n            \"build\": self.build.__to_dict__(),\n            \"components\": list(\n                map(lambda component: component.__to_dict__(), self.components)\n            ),\n        }\n\n    @staticmethod\n    def from_s3(bucket_name, build_id, opensearch_version, architecture, work_dir=None):\n        work_dir = work_dir if not None else str(os.getcwd())\n        manifest_s3_path = BundleManifest.get_bundle_manifest_relative_location(build_id, opensearch_version, architecture)\n        S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)\n        with open('manifest.yml', 'r') as file:\n            bundle_manifest = BundleManifest.from_file(file)\n        os.remove(os.path.realpath(os.path.join(work_dir, 'manifest.yml')))\n        return bundle_manifest\n\n    @staticmethod\n    def get_tarball_relative_location(build_id, opensearch_version, architecture):\n        return f\"bundles/{opensearch_version}/{build_id}/{architecture}/opensearch-{opensearch_version}-linux-{architecture}.tar.gz\"\n\n    @staticmethod\n    def get_tarball_name(opensearch_version, architecture):\n        return f\"opensearch-{opensearch_version}-linux-{architecture}.tar.gz\"\n\n    @staticmethod\n    def get_bundle_manifest_relative_location(build_id, opensearch_version, architecture):\n        return f\"bundles/{opensearch_version}/{build_id}/{architecture}/manifest.yml\"\n\n    class Build:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.version = data[\"version\"]\n            self.architecture = data[\"architecture\"]\n            self.location = data[\"location\"]\n            self.id = data[\"id\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"version\": self.version,\n                \"architecture\": self.architecture,\n                \"location\": self.location,\n                \"id\": self.id,\n            }\n\n    class Component:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.repository = data[\"repository\"]\n            self.ref = data[\"ref\"]\n            self.commit_id = data[\"commit_id\"]\n            self.location = data[\"location\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"repository\": self.repository,\n                \"ref\": self.ref,\n                \"commit_id\": self.commit_id,\n                \"location\": self.location,\n            }\n", "path": "bundle-workflow/src/manifests/bundle_manifest.py"}, {"content": "# SPDX-License-Identifier: Apache-2.0\n#\n# The OpenSearch Contributors require contributions made to\n# this file be licensed under the Apache-2.0 license or a\n# compatible open source license.\n\nimport os\n\nfrom aws.s3_bucket import S3Bucket\nfrom manifests.manifest import Manifest\n\n\"\"\"\nA BuildManifest is an immutable view of the outputs from a build step\nThe manifest contains information about the product that was built (in the `build` section),\nand the components that made up the build in the `components` section.\n\nThe format for schema version 1.0 is:\nschema-version: \"1.0\"\nbuild:\n  name: string\n  version: string\n  architecture: x64 or arm64\ncomponents:\n  - name: string\n    repository: URL of git repository\n    ref: git ref that was built (sha, branch, or tag)\n    commit_id: The actual git commit ID that was built (i.e. the resolved \"ref\")\n    artifacts:\n      maven:\n        - maven/relative/path/to/artifact\n        - ...\n      plugins:\n        - plugins/relative/path/to/artifact\n        - ...\n      libs:\n        - libs/relative/path/to/artifact\n        - ...\n  - ...\n\"\"\"\n\n\nclass BuildManifest(Manifest):\n    def __init__(self, data):\n        super().__init__(data)\n\n        self.build = self.Build(data[\"build\"])\n        self.components = list(\n            map(lambda entry: self.Component(entry), data[\"components\"])\n        )\n\n    def __to_dict__(self):\n        return {\n            \"schema-version\": \"1.0\",\n            \"build\": self.build.__to_dict__(),\n            \"components\": list(\n                map(lambda component: component.__to_dict__(), self.components)\n            ),\n        }\n\n    @staticmethod\n    def get_build_manifest_relative_location(build_id, opensearch_version, architecture):\n        return f\"builds/{opensearch_version}/{build_id}/{architecture}/manifest.yml\"\n\n    @staticmethod\n    def from_s3(bucket_name, build_id, opensearch_version, architecture, work_dir=None):\n        work_dir = work_dir if not None else str(os.getcwd())\n        manifest_s3_path = BuildManifest.get_build_manifest_relative_location(build_id, opensearch_version, architecture)\n        S3Bucket(bucket_name).download_file(manifest_s3_path, work_dir)\n        with open('manifest.yml', 'r') as file:\n            build_manifest = BuildManifest.from_file(file)\n        os.remove(os.path.realpath(os.path.join(work_dir, 'manifest.yml')))\n        return build_manifest\n\n    class Build:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.version = data[\"version\"]\n            self.architecture = data[\"architecture\"]\n            self.id = data[\"id\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"version\": self.version,\n                \"architecture\": self.architecture,\n                \"id\": self.id,\n            }\n\n    class Component:\n        def __init__(self, data):\n            self.name = data[\"name\"]\n            self.repository = data[\"repository\"]\n            self.ref = data[\"ref\"]\n            self.commit_id = data[\"commit_id\"]\n            self.artifacts = data[\"artifacts\"]\n            self.version = data[\"version\"]\n\n        def __to_dict__(self):\n            return {\n                \"name\": self.name,\n                \"repository\": self.repository,\n                \"ref\": self.ref,\n                \"commit_id\": self.commit_id,\n                \"artifacts\": self.artifacts,\n                \"version\": self.version,\n            }\n", "path": "bundle-workflow/src/manifests/build_manifest.py"}]}